From a83ef1a219e234550b5228f0280ef67e120dc8e8 Mon Sep 17 00:00:00 2001 From: rena-cheng <119469212+rena-cheng@users.noreply.github.com> Date: Fri, 13 Dec 2024 06:08:05 +0000 Subject: [PATCH] test: squish gui submitter job bundle test suite Signed-off-by: rena-cheng <119469212+rena-cheng@users.noreply.github.com> --- .../job_bundle_one/asset_references.yaml | 10 + .../mock_test_scene/squish_anim_test.txt | 8 + .../job_bundle_one/template.yaml | 108 +++++++ .../job_bundle_two/template.yaml | 135 ++++++++ .../scripts/choose_jobbundledir_helpers.py | 76 +++++ .../scripts/choose_jobbundledir_locators.py | 31 ++ .../shared/scripts/config.py | 12 + .../shared/scripts/gui_submitter_helpers.py | 53 ++++ .../shared/scripts/gui_submitter_locators.py | 259 ++++++++++++++++ .../shared/scripts/loginout_helpers.py | 21 +- .../shared/scripts/loginout_locators.py | 8 +- .../shared/scripts/names.py | 290 ++++++++++++++++++ ...lpers.py => workstation_config_helpers.py} | 94 ++++-- ...tors.py => workstation_config_locators.py} | 0 test/squish/suite_deadline_gui/suite.conf | 2 +- .../tst_verify_gui_submitter_bundles/test.py | 70 +++++ .../tst_verify_settings_dialogue/test.py | 62 ++-- 17 files changed, 1178 insertions(+), 61 deletions(-) create mode 100644 test/squish/deadline_gui_test_samples/job_bundle_one/asset_references.yaml create mode 100644 test/squish/deadline_gui_test_samples/job_bundle_one/mock_test_scene/squish_anim_test.txt create mode 100644 test/squish/deadline_gui_test_samples/job_bundle_one/template.yaml create mode 100644 test/squish/deadline_gui_test_samples/job_bundle_two/template.yaml create mode 100644 test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_helpers.py create mode 100644 test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_locators.py create mode 100644 test/squish/suite_deadline_gui/shared/scripts/gui_submitter_helpers.py create mode 100644 test/squish/suite_deadline_gui/shared/scripts/gui_submitter_locators.py rename test/squish/suite_deadline_gui/shared/scripts/{gui_helpers.py => workstation_config_helpers.py} (50%) rename test/squish/suite_deadline_gui/shared/scripts/{gui_locators.py => workstation_config_locators.py} (100%) create mode 100644 test/squish/suite_deadline_gui/tst_verify_gui_submitter_bundles/test.py diff --git a/test/squish/deadline_gui_test_samples/job_bundle_one/asset_references.yaml b/test/squish/deadline_gui_test_samples/job_bundle_one/asset_references.yaml new file mode 100644 index 00000000..35ac3908 --- /dev/null +++ b/test/squish/deadline_gui_test_samples/job_bundle_one/asset_references.yaml @@ -0,0 +1,10 @@ +assetReferences: + inputs: + directories: + - ./test_directory + filenames: + - ./mock_test_scene/squish_anim_test.txt + outputs: + directories: + - ./output_images + referencedPaths: [] \ No newline at end of file diff --git a/test/squish/deadline_gui_test_samples/job_bundle_one/mock_test_scene/squish_anim_test.txt b/test/squish/deadline_gui_test_samples/job_bundle_one/mock_test_scene/squish_anim_test.txt new file mode 100644 index 00000000..18b84303 --- /dev/null +++ b/test/squish/deadline_gui_test_samples/job_bundle_one/mock_test_scene/squish_anim_test.txt @@ -0,0 +1,8 @@ +{\rtf1\ansi\ansicpg1252\cocoartf2761 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +\margl1440\margr1440\vieww11520\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 + +\f0\fs24 \cf0 This is a test .txt file used in Squish automated testing for the GUI Submitters. } \ No newline at end of file diff --git a/test/squish/deadline_gui_test_samples/job_bundle_one/template.yaml b/test/squish/deadline_gui_test_samples/job_bundle_one/template.yaml new file mode 100644 index 00000000..6097b3a2 --- /dev/null +++ b/test/squish/deadline_gui_test_samples/job_bundle_one/template.yaml @@ -0,0 +1,108 @@ +specificationVersion: 'jobtemplate-2023-09' +name: GUI Submitter Testing - Job Bundle One +description: | + This is a custom job bundle created for the Squish Automated Test Suite which verifies the GUI Submitter UI. + It is one of two custom job bundles created for the Squish Automated Test Suite. + This is not intended for general use other than testing the GUI Submitter UI in Deadline Cloud CLI. + +parameterDefinitions: +# Input Details +- name: MockJobName + type: STRING + userInterface: + control: LINE_EDIT + label: Mock Job Name + groupLabel: Mock Job Details + default: Squish GUI Submitter Test - Job Bundle One + description: Enter the name of the job. +- name: Frames + type: STRING + userInterface: + control: LINE_EDIT + groupLabel: Mock Job Details + default: 1-150 + description: Enter the number of frames to test. +- name: SquishMockSceneFile + type: PATH + objectType: FILE + dataFlow: IN + userInterface: + control: CHOOSE_INPUT_FILE + label: GUI Submitter Test File + groupLabel: Mock Job Details + default: "./mock_test_scene/squish_anim_test.txt" + description: Choose the GUI Submitter file to run tests against. +# Checkboxes +- name: CheckBoxOne + type: STRING + userInterface: + groupLabel: Custom Plugins + control: CHECK_BOX + label: Squish Custom Plugin + default: "True" + allowedValues: ["True", "False"] + description: This checkbox defaults to "True". +- name: CheckBoxTwo + type: STRING + userInterface: + groupLabel: Custom Plugins + control: CHECK_BOX + label: Additional Squish Custom Plugin + default: "False" + allowedValues: ["True", "False"] + description: This checkbox defaults to "False". +# Output Details +- name: OutputDir + type: PATH + objectType: DIRECTORY + dataFlow: OUT + userInterface: + control: CHOOSE_DIRECTORY + label: Output Directory + groupLabel: Output Details + default: "./output_images" + description: Choose the GUI Submitter test output directory. +- name: OutputPattern + type: STRING + userInterface: + control: LINE_EDIT + label: Output File Pattern + groupLabel: Output Details + default: "gui_submitter_output_####" + description: Enter the output filename pattern (without extension). +- name: Format + type: STRING + userInterface: + control: DROPDOWN_LIST + label: Output File Format + groupLabel: Output Details + description: Choose the file format to render as. + default: OPEN_EXR + allowedValues: [TGA, RAWTGA, JPEG, IRIS, IRIZ, PNG, HDR, TIFF, OPEN_EXR, OPEN_EXR_MULTILAYER, CINEON, DPX, DDS, JP2, WEBP] +# Steps +steps: +- name: GUISubmitterTesting + script: + actions: + onRun: + command: bash + args: ['{{Task.File.runScript}}'] + embeddedFiles: + - name: runScript + type: TEXT + data: | + #!/usr/bin/env bash + + echo 'MockJobName value:' + echo '{{Param.MockJobName}}' + + echo 'Frames value:' + echo '{{Param.Frames}}' + + echo 'SquishMockSceneFile value:' + echo '{{Param.SquishMockSceneFile}}' + + echo 'OutputDir value:' + echo '{{Param.OutputDir}}' + + echo 'This completes the GUI Submitter Testing for Job Bundle One.' diff --git a/test/squish/deadline_gui_test_samples/job_bundle_two/template.yaml b/test/squish/deadline_gui_test_samples/job_bundle_two/template.yaml new file mode 100644 index 00000000..79104a5c --- /dev/null +++ b/test/squish/deadline_gui_test_samples/job_bundle_two/template.yaml @@ -0,0 +1,135 @@ +specificationVersion: 'jobtemplate-2023-09' +name: GUI Submitter Testing - Job Bundle Two +description: | + This is a custom job bundle created for the Squish Automated Test Suite which verifies the GUI Submitter UI. + It is two of two custom job bundles created for the Squish Automated Test Suite. + This is not intended for general use other than testing the GUI Submitter UI in Deadline Cloud CLI. + +parameterDefinitions: +# Input/Output Details +- name: MockJobName + type: PATH + default: "gui_submitter_test.txt" + objectType: FILE + dataFlow: IN + userInterface: + control: CHOOSE_INPUT_FILE + label: GUI Submitter Test File + groupLabel: Render Parameters + description: Select the mock scene file for running GUI Submitter Tests. +- name: ResolutionX + type: INT + default: 1920 + userInterface: + control: SPIN_BOX + label: Resolution X + groupLabel: Render Parameters + description: Enter the X resolution value +- name: ResolutionY + type: INT + default: 1080 + userInterface: + control: SPIN_BOX + label: Resolution Y + groupLabel: Render Parameters + description: Enter the Y resolution value +- name: OutputDir + type: PATH + objectType: DIRECTORY + dataFlow: OUT + userInterface: + control: CHOOSE_DIRECTORY + label: Output Directory + groupLabel: Output Details + default: "./output_images" + description: Choose the GUI Submitter test output directory. +# Mock Settings - Float +- name: FloatSpinner + type: FLOAT + userInterface: + control: SPIN_BOX + label: Depth of Field + groupLabel: Depth of Field + description: Mock Depth of Field Setting + default: 100 +- name: FloatSizeMaximum + type: FLOAT + userInterface: + control: SPIN_BOX + label: Maximum + groupLabel: Depth of Field + decimals: 1 + description: Maximum float setting. + default: 0.0 +- name: FloatSizeMinimum + type: FLOAT + userInterface: + control: SPIN_BOX + label: Minimum + groupLabel: Depth of Field + decimals: 1 + description: Minimum float setting + default: 0.0 +- name: FloatDropdown + type: FLOAT + userInterface: + control: DROPDOWN_LIST + label: Intensity + groupLabel: Depth of Field + description: Float values representing intensity. + default: 0.0 + allowedValues: [.25, .50, .75, 0.0, 1.0] +# Other Mock Settingss +- name: CameraFiltersStringDropdown + type: STRING + userInterface: + control: DROPDOWN_LIST + label: Camera Filters + groupLabel: Other Settings + description: Apply a camera filter + default: "" + allowedValues: ["", UV, POLARIZER, NEUTRAL DENSITY, DIFFUSION, INFRARED, DIOPTER] +- name: MaskStringDropdown + type: STRING + userInterface: + control: DROPDOWN_LIST + label: Mask + groupLabel: Other Settings + description: Mask + default: "" + allowedValues: ["", rgba.red, rgba.green, rgba.blue, rgba.alpha] +# Label +- name: Label + type: STRING + userInterface: + control: MULTILINE_EDIT + label: Label + groupLabel: Node + default: "" +# Steps +steps: +- name: GUISubmitterTesting + script: + actions: + onRun: + command: bash + args: ['{{Task.File.runScript}}'] + embeddedFiles: + - name: runScript + type: TEXT + data: | + #!/usr/bin/env bash + + echo 'MockJobName value:' + echo '{{Param.MockJobName}}' + + echo 'ResolutionX value:' + echo '{{Param.ResolutionX}}' + + echo 'ResolutionY value:' + echo '{{Param.ResolutionY}}' + + echo 'OutputDir value:' + echo '{{Param.OutputDir}}' + + echo 'This completes the GUI Submitter Testing for Job Bundle Two.' \ No newline at end of file diff --git a/test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_helpers.py b/test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_helpers.py new file mode 100644 index 00000000..0ad1e3e1 --- /dev/null +++ b/test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_helpers.py @@ -0,0 +1,76 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# -*- coding: utf-8 -* +# mypy: disable-error-code="attr-defined" + +import choose_jobbundledir_locators +import gui_submitter_helpers +import gui_submitter_locators +import squish +import test + + +def launch_jobbundle_dir(): + squish.startApplication("deadline bundle gui-submit --browse") + test.log("Launched Choose Job Bundle Directory.") + + +def select_jobbundle(filepath: str): + # enter job bundle directory file path in directory text input + squish.type( + squish.waitForObject(choose_jobbundledir_locators.jobbundle_filepath_input), filepath + ) + test.log("Entered job bundle file path in Choose Job Bundle Directory.") + # verify text input appears + test.compare( + str( + squish.waitForObjectExists( + choose_jobbundledir_locators.jobbundle_filepath_input + ).displayText + ), + filepath, + "Expect job bundle file path to be input in dialogue.", + ) + # hit 'choose' button + test.log("Hitting 'Choose' button to open Submitter dialogue for selected job bundle.") + squish.clickButton( + squish.waitForObject(choose_jobbundledir_locators.choose_jobbundledir_button) + ) + + +def load_different_job_bundle(): + # click on job specific settings tab to navigate and ensure tests are on correct tab + gui_submitter_helpers.navigate_job_specific_settings() + # verify load different job bundle button exists and contains correct button text + test.compare( + str( + squish.waitForObjectExists(gui_submitter_locators.load_different_job_bundle_button).text + ), + "Load a different job bundle", + "Expect Load a different job bundle button to contain correct text.", + ) + # verify load a different job bundle button is enabled + test.compare( + squish.waitForObjectExists(gui_submitter_locators.load_different_job_bundle_button).enabled, + True, + "Expect Load a different job bundle button to be enabled.", + ) + # click on load a different job bundle button + test.log("Hitting `Load a different job bundle` button.") + squish.clickButton( + squish.waitForObject(gui_submitter_locators.load_different_job_bundle_button) + ) + # verify Choose Job Bundle directory is open + test.compare( + str( + squish.waitForObjectExists( + choose_jobbundledir_locators.choose_job_bundle_dir + ).windowTitle + ), + "Choose job bundle directory", + "Expect Choose job bundle directory window title to be present.", + ) + test.compare( + squish.waitForObjectExists(choose_jobbundledir_locators.choose_job_bundle_dir).visible, + True, + "Expect Choose job bundle directory to be open.", + ) diff --git a/test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_locators.py b/test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_locators.py new file mode 100644 index 00000000..4033bc6e --- /dev/null +++ b/test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_locators.py @@ -0,0 +1,31 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# -*- coding: utf-8 -*- + +# choose job bundle directory +choose_job_bundle_dir = {"name": "QFileDialog", "type": "QFileDialog", "visible": 1} +directory_text_label = { + "name": "fileNameLabel", + "type": "QLabel", + "visible": 1, + "window": choose_job_bundle_dir, +} +jobbundle_filepath_input = { + "buddy": directory_text_label, + "name": "fileNameEdit", + "type": "QLineEdit", + "visible": 1, +} +choose_jobbundledir_button = { + "text": "Choose", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": choose_job_bundle_dir, +} +jobbundledir_cancel_button = { + "text": "Cancel", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": choose_job_bundle_dir, +} diff --git a/test/squish/suite_deadline_gui/shared/scripts/config.py b/test/squish/suite_deadline_gui/shared/scripts/config.py index f9365d53..82d010bc 100644 --- a/test/squish/suite_deadline_gui/shared/scripts/config.py +++ b/test/squish/suite_deadline_gui/shared/scripts/config.py @@ -1,9 +1,11 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # mypy: disable-error-code="attr-defined" +# Deadline Workstation Configuration profile_name = "(default)" job_hist_dir = "~/.deadline/job_history/(default)" farm_name = "Deadline Cloud Squish Farm" +farm_desc = "Squish Automation Test Framework" queue_name = "Squish Automation Queue" storage_profile = "Squish Storage Profile" job_attachments = "COPIED" @@ -14,3 +16,13 @@ conflict_res_option = "NOT\\_SELECTED" conflict_res_option_expected_text = conflict_res_option.replace("\\_", "_") logging_level = "WARNING" + +# GUI Submitter Job Bundle One +# shared job settings +jobbundle_one = "./deadline-cloud/test/squish/deadline_gui_test_samples/job_bundle_one" +jobbundle_one_name = "GUI Submitter Testing - Job Bundle One" + +# GUI Submitter Job Bundle Two +# shared job settings +jobbundle_two = "./deadline-cloud/test/squish/deadline_gui_test_samples/job_bundle_two" +jobbundle_two_name = "GUI Submitter Testing - Job Bundle Two" diff --git a/test/squish/suite_deadline_gui/shared/scripts/gui_submitter_helpers.py b/test/squish/suite_deadline_gui/shared/scripts/gui_submitter_helpers.py new file mode 100644 index 00000000..fb7e49e4 --- /dev/null +++ b/test/squish/suite_deadline_gui/shared/scripts/gui_submitter_helpers.py @@ -0,0 +1,53 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# -*- coding: utf-8 -* +# mypy: disable-error-code="attr-defined" + +import gui_submitter_locators +import squish +import test + + +def navigate_shared_job_settings(): + # click on Shared job settings tab + test.log("Navigate to Shared job settings tab.") + squish.clickTab( + squish.waitForObject(gui_submitter_locators.shared_jobsettings_tab), "Shared job settings" + ) + # verify on shared job settings tab + test.compare( + squish.waitForObjectExists( + gui_submitter_locators.shared_jobsettings_properties_box + ).visible, + True, + "Expect user to be on Shared job settings tab.", + ) + + +def navigate_job_specific_settings(): + # click on Job-specific settings tab + test.log("Navigate to Job-specific settings tab.") + squish.clickTab( + squish.waitForObject(gui_submitter_locators.job_specificsettings_tab), + "Job-specific settings", + ) + # verify on job specific settings tab + test.compare( + squish.waitForObjectExists(gui_submitter_locators.job_specificsettings_properties).visible, + True, + "Expect user to be on Job-specific settings tab.", + ) + + +def verify_shared_job_settings( + job_name: str, +): + # click on shared job settings tab to navigate and ensure tests are on correct tab + navigate_shared_job_settings() + # verify job name is set correctly + test.compare( + str( + squish.waitForObjectExists(gui_submitter_locators.job_properties_name_input).displayText + ), + job_name, + "Expect correct job bundle job name to be displayed by default.", + ) diff --git a/test/squish/suite_deadline_gui/shared/scripts/gui_submitter_locators.py b/test/squish/suite_deadline_gui/shared/scripts/gui_submitter_locators.py new file mode 100644 index 00000000..68d48b91 --- /dev/null +++ b/test/squish/suite_deadline_gui/shared/scripts/gui_submitter_locators.py @@ -0,0 +1,259 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# -*- coding: utf-8 -*- + +aws_submitter_dialogue = { + "type": "SubmitJobToDeadlineDialog", + "unnamed": 1, + "visible": 1, + "windowTitle": "Submit to AWS Deadline Cloud", +} +# Settings button +settings_button = { + "text": "Settings...", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": aws_submitter_dialogue, +} +shared_jobsettings_tab = { + "type": "QTabWidget", + "unnamed": 1, + "visible": 1, + "window": aws_submitter_dialogue, +} +job_specificsettings_tab = { + "type": "QTabWidget", + "unnamed": 1, + "visible": 1, + "window": aws_submitter_dialogue, +} +tabs_and_properties_widget = { + "name": "qt_tabwidget_stackedwidget", + "type": "QStackedWidget", + "visible": 1, + "window": aws_submitter_dialogue, +} +# qt_tabwidget_stackedwidget_QScrollArea +properties_only_widget = { + "container": tabs_and_properties_widget, + "type": "QScrollArea", + "unnamed": 1, + "visible": 1, +} +# shared job settings tab +shared_jobsettings_jobproperties_widget = { + "container": properties_only_widget, + "type": "SharedJobSettingsWidget", + "unnamed": 1, + "visible": 1, +} +shared_jobsettings_properties_box = { + "container": properties_only_widget, + "title": "Job Properties", + "type": "SharedJobPropertiesWidget", + "unnamed": 1, + "visible": 1, +} +job_properties_name_label = { + "container": shared_jobsettings_properties_box, + "text": "Name", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +job_properties_name_input = { + "buddy": job_properties_name_label, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} + +job_properties_desc_label = { + "container": shared_jobsettings_properties_box, + "text": "Description", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +job_properties_desc_input = { + "aboveWidget": job_properties_name_input, + "container": shared_jobsettings_properties_box, + "leftWidget": job_properties_desc_label, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +deadline_cloud_settings_widget = { + "container": properties_only_widget, + "title": "Deadline Cloud settings", + "type": "DeadlineCloudSettingsWidget", + "unnamed": 1, + "visible": 1, +} +# Deadline Cloud Squish Farm text element +deadline_cloud_settings_farm_name = { + "container": deadline_cloud_settings_widget, + "text": "Deadline Cloud Squish Farm", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +# Squish Automation Queue text element +deadline_cloud_settings_queue_name = { + "container": deadline_cloud_settings_widget, + "text": "Squish Automation Queue", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +queue_environment_conda_widget = { + "container": properties_only_widget, + "name": "Queue Environment: Conda", + "type": "_JobTemplateGroupLayout", + "visible": 1, +} +conda_packages_text_label = { + "container": queue_environment_conda_widget, + "text": "Conda Packages", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +conda_packages_text_input = { + "container": queue_environment_conda_widget, + "leftWidget": conda_packages_text_label, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +conda_channels_text_label = { + "container": queue_environment_conda_widget, + "text": "Conda Channels", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +conda_channels_text_input = { + "container": queue_environment_conda_widget, + "leftWidget": conda_channels_text_label, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +# job-specific settings tab +job_specificsettings_properties = { + "container": properties_only_widget, + "type": "JobBundleSettingsWidget", + "unnamed": 1, + "visible": 1, +} +render_parameters_widget = { + "container": properties_only_widget, + "name": "Render Parameters", + "type": "_JobTemplateGroupLayout", + "visible": 1, +} +render_parameters_frames_label = { + "container": render_parameters_widget, + "text": "Frames", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +render_parameters_frames_text_input = { + "container": render_parameters_widget, + "leftWidget": render_parameters_frames_label, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +render_parameters_output_dir_filepath = { + "container": render_parameters_widget, + "occurrence": 3, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +render_parameters_output_file_pattern_label = { + "container": render_parameters_widget, + "text": "Output File Pattern", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +render_parameters_output_file_pattern_text_input = { + "container": render_parameters_widget, + "leftWidget": render_parameters_output_file_pattern_label, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +render_parameters_output_file_format_label = { + "container": render_parameters_widget, + "text": "Output File Format", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +render_parameters_output_file_format_dropdown = { + "container": render_parameters_widget, + "leftWidget": render_parameters_output_file_format_label, + "type": "QComboBox", + "unnamed": 1, + "visible": 1, +} +software_environment_widget = { + "container": properties_only_widget, + "name": "Software Environment", + "type": "_JobTemplateGroupLayout", + "visible": 1, +} +software_environment_condapackages_label = { + "container": software_environment_widget, + "text": "Conda Packages", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +software_environment_condapackages_text_input = { + "container": software_environment_widget, + "leftWidget": software_environment_condapackages_label, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +# load different job bundle button in AWS Submitter dialogue (job-specific settings tab) +load_different_job_bundle_button = { + "container": properties_only_widget, + "text": "Load a different job bundle", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, +} +# job history directory default filepath input +job_hist_dir_dropdown = { + "container": properties_only_widget, + "name": "lookInCombo", + "type": "QComboBox", + "visible": 1, +} + + +def deadlinecloud_farmname_locator(farm_name): + return { + "container": deadline_cloud_settings_widget, + "text": farm_name, + "type": "QLabel", + "unnamed": 1, + "visible": 1, + } + + +def deadlinecloud_queuename_locator(queue_name): + return { + "container": deadline_cloud_settings_widget, + "text": queue_name, + "type": "QLabel", + "unnamed": 1, + "visible": 1, + } diff --git a/test/squish/suite_deadline_gui/shared/scripts/loginout_helpers.py b/test/squish/suite_deadline_gui/shared/scripts/loginout_helpers.py index 6f3da0b0..d3f7d6cf 100644 --- a/test/squish/suite_deadline_gui/shared/scripts/loginout_helpers.py +++ b/test/squish/suite_deadline_gui/shared/scripts/loginout_helpers.py @@ -2,7 +2,9 @@ # mypy: disable-error-code="attr-defined" import loginout_locators -import gui_locators +import workstation_config_locators +import workstation_config_helpers +import config import squish import test @@ -47,16 +49,18 @@ def check_and_close_refresh_error_dialogues(): def set_aws_profile_name_and_verify_auth(profile_name: str): # open AWS profile drop down menu squish.mouseClick( - squish.waitForObjectExists(gui_locators.globalsettings_awsprofile_dropdown), + squish.waitForObjectExists(workstation_config_locators.globalsettings_awsprofile_dropdown), ) test.log("Opened AWS profile drop down menu.") test.compare( - squish.waitForObjectExists(gui_locators.profile_name_locator(profile_name)).text, + squish.waitForObjectExists( + workstation_config_locators.profile_name_locator(profile_name) + ).text, profile_name, "Expect AWS profile name to be present in drop down.", ) # select AWS profile - squish.mouseClick(gui_locators.profile_name_locator(profile_name)) + squish.mouseClick(workstation_config_locators.profile_name_locator(profile_name)) test.log("Selected AWS profile name.") # verify user is authenticated - confirm statuses appear and text is correct test.log("Verifying user is authenticated...") @@ -98,3 +102,12 @@ def set_aws_profile_name_and_verify_auth(profile_name: str): "AUTHORIZED", "Expect `AWS Deadline Cloud API: AUTHORIZED` text to be correct.", ) + + +def authenticate_submitter_settings_dialogue(): + # hit Settings button to open Deadline Settings dialogue + workstation_config_helpers.open_settings_dialogue() + # authenticate in settings dialogue (using default aws profile) if not authenticated before running tests + set_aws_profile_name_and_verify_auth(config.profile_name) + # close Settings dialogue + workstation_config_helpers.close_deadline_config_gui() diff --git a/test/squish/suite_deadline_gui/shared/scripts/loginout_locators.py b/test/squish/suite_deadline_gui/shared/scripts/loginout_locators.py index c35b1351..4986a797 100644 --- a/test/squish/suite_deadline_gui/shared/scripts/loginout_locators.py +++ b/test/squish/suite_deadline_gui/shared/scripts/loginout_locators.py @@ -1,7 +1,7 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # encoding: UTF-8 -import gui_locators +import workstation_config_locators # authentication status credential_source_auth_group = { @@ -9,21 +9,21 @@ "type": "AuthenticationStatusGroup", "unnamed": 1, "visible": 1, - "window": gui_locators.deadline_config_dialog, + "window": workstation_config_locators.deadline_config_dialog, } authentication_status_auth_group = { "title": "Authentication status", "type": "AuthenticationStatusGroup", "unnamed": 1, "visible": 1, - "window": gui_locators.deadline_config_dialog, + "window": workstation_config_locators.deadline_config_dialog, } deadlinecloud_api_auth_group = { "title": "AWS Deadline Cloud API", "type": "AuthenticationStatusGroup", "unnamed": 1, "visible": 1, - "window": gui_locators.deadline_config_dialog, + "window": workstation_config_locators.deadline_config_dialog, } credential_source_hostprovided_label = { "container": credential_source_auth_group, diff --git a/test/squish/suite_deadline_gui/shared/scripts/names.py b/test/squish/suite_deadline_gui/shared/scripts/names.py index 5fb70a36..2a65a122 100644 --- a/test/squish/suite_deadline_gui/shared/scripts/names.py +++ b/test/squish/suite_deadline_gui/shared/scripts/names.py @@ -288,3 +288,293 @@ "unnamed": 1, "visible": 1, } +qFileDialog_fileNameLabel_QLabel = { + "name": "fileNameLabel", + "type": "QLabel", + "visible": 1, + "window": qFileDialog_QFileDialog, +} +fileNameEdit_QLineEdit = { + "buddy": qFileDialog_fileNameLabel_QLabel, + "name": "fileNameEdit", + "type": "QLineEdit", + "visible": 1, +} +qFileDialog_Choose_QPushButton = { + "text": "Choose", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": qFileDialog_QFileDialog, +} +qFileDialog_Cancel_QPushButton = { + "text": "Cancel", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": qFileDialog_QFileDialog, +} +error_running_deadline_bundle_gui_submit_browse_QMessageBox = { + "type": "QMessageBox", + "unnamed": 1, + "visible": 1, + "windowTitle": 'Error running "deadline bundle gui-submit --browse"', +} +error_running_deadline_bundle_gui_submit_browse_OK_QPushButton = { + "text": "OK", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": error_running_deadline_bundle_gui_submit_browse_QMessageBox, +} +submit_to_AWS_Deadline_Cloud_SubmitJobToDeadlineDialog = { + "type": "SubmitJobToDeadlineDialog", + "unnamed": 1, + "visible": 1, + "windowTitle": "Submit to AWS Deadline Cloud", +} +submit_to_AWS_Deadline_Cloud_Settings_QPushButton = { + "text": "Settings...", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, + "window": submit_to_AWS_Deadline_Cloud_SubmitJobToDeadlineDialog, +} +submit_to_AWS_Deadline_Cloud_qt_tabwidget_stackedwidget_QStackedWidget = { + "name": "qt_tabwidget_stackedwidget", + "type": "QStackedWidget", + "visible": 1, + "window": submit_to_AWS_Deadline_Cloud_SubmitJobToDeadlineDialog, +} +qt_tabwidget_stackedwidget_QScrollArea = { + "container": submit_to_AWS_Deadline_Cloud_qt_tabwidget_stackedwidget_QStackedWidget, + "type": "QScrollArea", + "unnamed": 1, + "visible": 1, +} +job_Properties_SharedJobPropertiesWidget = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "title": "Job Properties", + "type": "SharedJobPropertiesWidget", + "unnamed": 1, + "visible": 1, +} +job_Properties_Name_QLabel = { + "container": job_Properties_SharedJobPropertiesWidget, + "text": "Name", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +name_QLineEdit = { + "buddy": job_Properties_Name_QLabel, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +qFileDialog_splitter_QSplitter = { + "name": "splitter", + "type": "QSplitter", + "visible": 1, + "window": qFileDialog_QFileDialog, +} +splitter_frame_QFrame = { + "container": qFileDialog_splitter_QSplitter, + "name": "frame", + "type": "QFrame", + "visible": 1, +} +frame_stackedWidget_QStackedWidget = { + "container": splitter_frame_QFrame, + "name": "stackedWidget", + "type": "QStackedWidget", + "visible": 1, +} +stackedWidget_treeView_QTreeView = { + "container": frame_stackedWidget_QStackedWidget, + "name": "treeView", + "type": "QTreeView", + "visible": 1, +} +job_Properties_Description_QLabel = { + "container": job_Properties_SharedJobPropertiesWidget, + "text": "Description", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +job_Properties_Description_QLineEdit = { + "aboveWidget": name_QLineEdit, + "container": job_Properties_SharedJobPropertiesWidget, + "leftWidget": job_Properties_Description_QLabel, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +deadline_Cloud_settings_DeadlineCloudSettingsWidget = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "title": "Deadline Cloud settings", + "type": "DeadlineCloudSettingsWidget", + "unnamed": 1, + "visible": 1, +} +deadline_Cloud_settings_Deadline_Cloud_Squish_Farm_QLabel = { + "container": deadline_Cloud_settings_DeadlineCloudSettingsWidget, + "text": "Deadline Cloud Squish Farm", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +deadline_Cloud_settings_Squish_Automation_Queue_QLabel = { + "container": deadline_Cloud_settings_DeadlineCloudSettingsWidget, + "text": "Squish Automation Queue", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +queue_Environment_Conda_JobTemplateGroupLayout = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "name": "Queue Environment: Conda", + "type": "_JobTemplateGroupLayout", + "visible": 1, +} +queue_Environment_Conda_Conda_Packages_QLabel = { + "container": queue_Environment_Conda_JobTemplateGroupLayout, + "text": "Conda Packages", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +queue_Environment_Conda_Conda_Channels_QLabel = { + "container": queue_Environment_Conda_JobTemplateGroupLayout, + "text": "Conda Channels", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +o_SharedJobSettingsWidget = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "type": "SharedJobSettingsWidget", + "unnamed": 1, + "visible": 1, +} +submit_to_AWS_Deadline_Cloud_DeadlineAuthenticationStatusWidget = { + "type": "DeadlineAuthenticationStatusWidget", + "unnamed": 1, + "visible": 1, + "window": submit_to_AWS_Deadline_Cloud_SubmitJobToDeadlineDialog, +} +queue_Environment_Conda_Conda_Packages_QLineEdit = { + "container": queue_Environment_Conda_JobTemplateGroupLayout, + "leftWidget": queue_Environment_Conda_Conda_Packages_QLabel, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +queue_Environment_Conda_Conda_Channels_QLineEdit = { + "container": queue_Environment_Conda_JobTemplateGroupLayout, + "leftWidget": queue_Environment_Conda_Conda_Channels_QLabel, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +submit_to_AWS_Deadline_Cloud_QTabWidget = { + "type": "QTabWidget", + "unnamed": 1, + "visible": 1, + "window": submit_to_AWS_Deadline_Cloud_SubmitJobToDeadlineDialog, +} +software_Environment_JobTemplateGroupLayout = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "name": "Software Environment", + "type": "_JobTemplateGroupLayout", + "visible": 1, +} +software_Environment_Conda_Packages_QLabel = { + "container": software_Environment_JobTemplateGroupLayout, + "text": "Conda Packages", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +software_Environment_Conda_Packages_QLineEdit = { + "container": software_Environment_JobTemplateGroupLayout, + "leftWidget": software_Environment_Conda_Packages_QLabel, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +render_Parameters_JobTemplateGroupLayout = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "name": "Render Parameters", + "type": "_JobTemplateGroupLayout", + "visible": 1, +} +render_Parameters_QLineEdit = { + "container": render_Parameters_JobTemplateGroupLayout, + "occurrence": 3, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +render_Parameters_Output_File_Pattern_QLabel = { + "container": render_Parameters_JobTemplateGroupLayout, + "text": "Output File Pattern", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +render_Parameters_Output_File_Pattern_QLineEdit = { + "container": render_Parameters_JobTemplateGroupLayout, + "leftWidget": render_Parameters_Output_File_Pattern_QLabel, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +render_Parameters_Output_File_Format_QLabel = { + "container": render_Parameters_JobTemplateGroupLayout, + "text": "Output File Format", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +render_Parameters_Output_File_Format_QComboBox = { + "container": render_Parameters_JobTemplateGroupLayout, + "leftWidget": render_Parameters_Output_File_Format_QLabel, + "type": "QComboBox", + "unnamed": 1, + "visible": 1, +} +render_Parameters_Frames_QLabel = { + "container": render_Parameters_JobTemplateGroupLayout, + "text": "Frames", + "type": "QLabel", + "unnamed": 1, + "visible": 1, +} +render_Parameters_Frames_QLineEdit = { + "container": render_Parameters_JobTemplateGroupLayout, + "leftWidget": render_Parameters_Frames_QLabel, + "type": "QLineEdit", + "unnamed": 1, + "visible": 1, +} +o_JobBundleSettingsWidget = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "type": "JobBundleSettingsWidget", + "unnamed": 1, + "visible": 1, +} +load_a_different_job_bundle_QPushButton = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "text": "Load a different job bundle", + "type": "QPushButton", + "unnamed": 1, + "visible": 1, +} +lookInCombo_QComboBox = { + "container": qt_tabwidget_stackedwidget_QScrollArea, + "name": "lookInCombo", + "type": "QComboBox", + "visible": 1, +} diff --git a/test/squish/suite_deadline_gui/shared/scripts/gui_helpers.py b/test/squish/suite_deadline_gui/shared/scripts/workstation_config_helpers.py similarity index 50% rename from test/squish/suite_deadline_gui/shared/scripts/gui_helpers.py rename to test/squish/suite_deadline_gui/shared/scripts/workstation_config_helpers.py index ca7a9b13..fb836e0b 100644 --- a/test/squish/suite_deadline_gui/shared/scripts/gui_helpers.py +++ b/test/squish/suite_deadline_gui/shared/scripts/workstation_config_helpers.py @@ -1,7 +1,8 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # mypy: disable-error-code="attr-defined" -import gui_locators +import workstation_config_locators +import gui_submitter_locators import squish import test @@ -11,79 +12,110 @@ def launch_deadline_config_gui(): squish.startApplication("deadline config gui") - test.log("Launched Deadline Config GUI.") + test.log("Launched Deadline Workstation Config GUI.") test.log( - "Sleep for " + str(snooze_timeout) + " second(s) to allow GUI authentication to fully load." + "Sleep for " + str(snooze_timeout) + " second(s) to allow authentication to fully load." ) squish.snooze(snooze_timeout) test.compare( - squish.waitForObjectExists(gui_locators.deadline_config_dialog).visible, + squish.waitForObjectExists(workstation_config_locators.deadline_config_dialog).visible, True, - "Expect the Deadline Config GUI to be open.", + "Expect the Deadline Workstation Config GUI to be open.", ) def close_deadline_config_gui(): - test.log("Hitting `OK` button to close Deadline Config GUI.") + test.log("Hitting `OK` button to close Deadline Settings.") # hit 'OK' button to close Deadline Config GUI - squish.clickButton(squish.waitForObject(gui_locators.deadlinedialog_ok_button)) + squish.clickButton(squish.waitForObject(workstation_config_locators.deadlinedialog_ok_button)) + + +def open_settings_dialogue(): + test.log("Hitting `Settings` button to open Deadline Settings dialogue.") + # click on Settings button to open Deadline Settings dialogue from Submitter + squish.clickButton(squish.waitForObject(gui_submitter_locators.settings_button)) + test.log("Opened Deadline Workstation Settings dialogue.") + # verify Settings dialogue is opened + test.compare( + squish.waitForObjectExists(workstation_config_locators.deadline_config_dialog).visible, + True, + "Expect the Deadline Settings dialogue to be open.", + ) def hit_apply_button(): test.log("Hitting `Apply` button to apply selected settings.") # hit 'Apply' button - squish.clickButton(squish.waitForObject(gui_locators.deadlinedialog_apply_button)) + squish.clickButton( + squish.waitForObject(workstation_config_locators.deadlinedialog_apply_button) + ) test.log("Settings have been applied.") def set_farm_name(farm_name: str): # open Default farm drop down menu - squish.mouseClick(squish.waitForObject(gui_locators.profilesettings_defaultfarm_dropdown)) + squish.mouseClick( + squish.waitForObject(workstation_config_locators.profilesettings_defaultfarm_dropdown) + ) test.log("Opened farm name drop down menu.") test.compare( - squish.waitForObjectExists(gui_locators.farm_name_locator(farm_name)).text, + squish.waitForObjectExists(workstation_config_locators.farm_name_locator(farm_name)).text, farm_name, "Expect farm name to be present in drop down.", ) # select Default farm squish.mouseClick( - squish.waitForObjectItem(gui_locators.profilesettings_defaultfarm_dropdown, farm_name) + squish.waitForObjectItem( + workstation_config_locators.profilesettings_defaultfarm_dropdown, farm_name + ) ) test.log("Selected farm name.") def open_close_job_hist_directory(): # hit '...' button to open Choose Job history directory file browser - squish.clickButton(squish.waitForObject(gui_locators.open_job_hist_dir_button)) + squish.clickButton(squish.waitForObject(workstation_config_locators.open_job_hist_dir_button)) test.log("Opened job history directory dialogue.") # verify job history directory dialogue is open test.compare( - str(squish.waitForObjectExists(gui_locators.choosejobhistdir_filebrowser).windowTitle), + str( + squish.waitForObjectExists( + workstation_config_locators.choosejobhistdir_filebrowser + ).windowTitle + ), "Choose Job history directory", "Expect Choose Job history directory dialogue window title to be present.", ) test.compare( - squish.waitForObjectExists(gui_locators.choosejobhistdir_filebrowser).visible, + squish.waitForObjectExists( + workstation_config_locators.choosejobhistdir_filebrowser + ).visible, True, "Expect Choose Job history directory dialogue to be open.", ) # hit 'choose' button to set default and close file browser - squish.clickButton(squish.waitForObject(gui_locators.choosejobhistdir_choose_button)) + squish.clickButton( + squish.waitForObject(workstation_config_locators.choosejobhistdir_choose_button) + ) test.log("Closed job history directory dialogue.") def set_queue_name(queue_name: str): # open Default queue drop down menu - squish.mouseClick(squish.waitForObject(gui_locators.farmsettings_defaultqueue_dropdown)) + squish.mouseClick( + squish.waitForObject(workstation_config_locators.farmsettings_defaultqueue_dropdown) + ) test.log("Opened queue name drop down menu.") test.compare( - squish.waitForObjectExists(gui_locators.queue_name_locator(queue_name)).text, + squish.waitForObjectExists(workstation_config_locators.queue_name_locator(queue_name)).text, queue_name, "Expect queue name to be present in drop down.", ) # select Default queue squish.mouseClick( - squish.waitForObjectItem(gui_locators.farmsettings_defaultqueue_dropdown, queue_name) + squish.waitForObjectItem( + workstation_config_locators.farmsettings_defaultqueue_dropdown, queue_name + ) ) test.log("Selected queue name.") @@ -91,18 +123,22 @@ def set_queue_name(queue_name: str): def set_storage_profile(storage_profile: str): # open Default storage profile drop down menu squish.mouseClick( - squish.waitForObject(gui_locators.farmsettings_defaultstorageprofile_dropdown) + squish.waitForObject( + workstation_config_locators.farmsettings_defaultstorageprofile_dropdown + ) ) test.log("Opened storage profile drop down menu.") test.compare( - squish.waitForObjectExists(gui_locators.storage_profile_locator(storage_profile)).text, + squish.waitForObjectExists( + workstation_config_locators.storage_profile_locator(storage_profile) + ).text, storage_profile, "Expect storage profile to be present in drop down.", ) # select Default storage profile squish.mouseClick( squish.waitForObjectItem( - gui_locators.farmsettings_defaultstorageprofile_dropdown, storage_profile + workstation_config_locators.farmsettings_defaultstorageprofile_dropdown, storage_profile ) ) test.log("Selected storage profile.") @@ -111,13 +147,15 @@ def set_storage_profile(storage_profile: str): def set_job_attachments_filesystem_options(job_attachments: str): # open Job attachments filesystem options drop down menu squish.mouseClick( - squish.waitForObject(gui_locators.farmsettings_jobattachmentsoptions_dropdown) + squish.waitForObject( + workstation_config_locators.farmsettings_jobattachmentsoptions_dropdown + ) ) test.log("Opened job attachments filesystem options drop down menu.") # select Job attachments filesystem options squish.mouseClick( squish.waitForObjectItem( - gui_locators.farmsettings_jobattachmentsoptions_dropdown, job_attachments + workstation_config_locators.farmsettings_jobattachmentsoptions_dropdown, job_attachments ) ) test.log("Selected job attachments filesystem option.") @@ -126,13 +164,13 @@ def set_job_attachments_filesystem_options(job_attachments: str): def set_conflict_resolution_option(conflict_res_option: str): # open Conflict resolution option drop down menu squish.mouseClick( - squish.waitForObject(gui_locators.conflictresolution_option_dropdown), + squish.waitForObject(workstation_config_locators.conflictresolution_option_dropdown), ) test.log("Opened conflict resolution option drop down menu.") # select Conflict resolution option squish.mouseClick( squish.waitForObjectItem( - gui_locators.conflictresolution_option_dropdown, conflict_res_option + workstation_config_locators.conflictresolution_option_dropdown, conflict_res_option ), ) test.log("Selected conflict resolution option.") @@ -141,11 +179,13 @@ def set_conflict_resolution_option(conflict_res_option: str): def set_current_logging_level(logging_level: str): # open Current logging level drop down menu squish.mouseClick( - squish.waitForObject(gui_locators.currentlogging_level_dropdown), + squish.waitForObject(workstation_config_locators.currentlogging_level_dropdown), ) test.log("Opened current logging level drop down menu.") # select Current logging level squish.mouseClick( - squish.waitForObjectItem(gui_locators.currentlogging_level_dropdown, logging_level), + squish.waitForObjectItem( + workstation_config_locators.currentlogging_level_dropdown, logging_level + ), ) test.log("Selected current logging level.") diff --git a/test/squish/suite_deadline_gui/shared/scripts/gui_locators.py b/test/squish/suite_deadline_gui/shared/scripts/workstation_config_locators.py similarity index 100% rename from test/squish/suite_deadline_gui/shared/scripts/gui_locators.py rename to test/squish/suite_deadline_gui/shared/scripts/workstation_config_locators.py diff --git a/test/squish/suite_deadline_gui/suite.conf b/test/squish/suite_deadline_gui/suite.conf index 4cf869b6..a0e22654 100644 --- a/test/squish/suite_deadline_gui/suite.conf +++ b/test/squish/suite_deadline_gui/suite.conf @@ -4,6 +4,6 @@ HOOK_SUB_PROCESSES=true IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_verify_settings_dialogue +TEST_CASES=tst_verify_settings_dialogue tst_verify_gui_submitter_bundles VERSION=3 WRAPPERS=Qt diff --git a/test/squish/suite_deadline_gui/tst_verify_gui_submitter_bundles/test.py b/test/squish/suite_deadline_gui/tst_verify_gui_submitter_bundles/test.py new file mode 100644 index 00000000..e08da5e8 --- /dev/null +++ b/test/squish/suite_deadline_gui/tst_verify_gui_submitter_bundles/test.py @@ -0,0 +1,70 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# -*- coding: utf-8 -*- +# mypy: disable-error-code="attr-defined" + +import config +import choose_jobbundledir_helpers +import choose_jobbundledir_locators +import gui_submitter_helpers +import gui_submitter_locators +import squish + +import test + + +def init(): + # launch Choose job bundle directory using deadline bundle gui-submit --browse command + choose_jobbundledir_helpers.launch_jobbundle_dir() + # verify Choose job bundle directory is open + test.compare( + str( + squish.waitForObjectExists( + choose_jobbundledir_locators.choose_job_bundle_dir + ).windowTitle + ), + "Choose job bundle directory", + "Expect Choose job bundle directory window title to be present.", + ) + test.compare( + squish.waitForObjectExists(choose_jobbundledir_locators.choose_job_bundle_dir).visible, + True, + "Expect Choose job bundle directory to be open.", + ) + + +def main(): + # select job bundle one + choose_jobbundledir_helpers.select_jobbundle(config.jobbundle_one) + # verify GUI Submitter dialogue opens + test.compare( + str(squish.waitForObjectExists(gui_submitter_locators.aws_submitter_dialogue).windowTitle), + "Submit to AWS Deadline Cloud", + "Expect AWS Deadline Cloud Submitter window title to be present.", + ) + test.compare( + squish.waitForObjectExists(gui_submitter_locators.aws_submitter_dialogue).visible, + True, + "Expect AWS Deadline Cloud Submitter to be open.", + ) + # verify shared job settings tab for job bundle one + test.log("Start verifying Shared Job Settings tab for Job Bundle One") + gui_submitter_helpers.verify_shared_job_settings( + config.jobbundle_one_name, + ) + # verify load different job bundle flow + test.log("Navigate to Job-Specific Settings tab and verify Load a different job bundle flow") + choose_jobbundledir_helpers.load_different_job_bundle() + # select job bundle two + choose_jobbundledir_helpers.select_jobbundle(config.jobbundle_two) + # verify shared job settings tab for job bundle two + test.log("Start verifying Shared Job Settings tab for Job Bundle Two") + gui_submitter_helpers.verify_shared_job_settings( + config.jobbundle_two_name, + ) + + +def cleanup(): + test.log("Closing AWS Submitter dialogue by sending QCloseEvent to 'x' button.") + squish.sendEvent( + "QCloseEvent", squish.waitForObject(gui_submitter_locators.aws_submitter_dialogue) + ) diff --git a/test/squish/suite_deadline_gui/tst_verify_settings_dialogue/test.py b/test/squish/suite_deadline_gui/tst_verify_settings_dialogue/test.py index 022e4b0a..1d21a526 100644 --- a/test/squish/suite_deadline_gui/tst_verify_settings_dialogue/test.py +++ b/test/squish/suite_deadline_gui/tst_verify_settings_dialogue/test.py @@ -2,8 +2,8 @@ # mypy: disable-error-code="attr-defined" import config -import gui_helpers -import gui_locators +import workstation_config_helpers +import workstation_config_locators import loginout_helpers import squish @@ -11,13 +11,15 @@ def init(): - # launch deadline config gui - gui_helpers.launch_deadline_config_gui() + # launch Deadline Workstation Config using deadline config gui command + workstation_config_helpers.launch_deadline_config_gui() # using aws credential/non-DCM profile, set aws profile name to `(default)` loginout_helpers.set_aws_profile_name_and_verify_auth(config.profile_name) # verify correct aws profile name is set test.compare( - squish.waitForObjectExists(gui_locators.globalsettings_awsprofile_dropdown).currentText, + squish.waitForObjectExists( + workstation_config_locators.globalsettings_awsprofile_dropdown + ).currentText, config.profile_name, "Expect selected AWS profile name to be set.", ) @@ -26,59 +28,61 @@ def init(): def main(): # verify default job history directory file path is correct test.compare( - squish.waitForObjectExists(gui_locators.job_hist_dir_input).displayText, + squish.waitForObjectExists(workstation_config_locators.job_hist_dir_input).displayText, config.job_hist_dir, "Expect correct job history directory file path to be displayed by default.", ) # open and close job history directory file browser - gui_helpers.open_close_job_hist_directory() + workstation_config_helpers.open_close_job_hist_directory() # verify selected job history directory path is set test.compare( - str(squish.waitForObjectExists(gui_locators.job_hist_dir_input).displayText), + str(squish.waitForObjectExists(workstation_config_locators.job_hist_dir_input).displayText), config.job_hist_dir, "Expect selected job history directory file path to be set.", ) # set farm name - gui_helpers.set_farm_name(config.farm_name) + workstation_config_helpers.set_farm_name(config.farm_name) # verify correct farm name is set test.compare( str( squish.waitForObjectExists( - gui_locators.profilesettings_defaultfarm_dropdown + workstation_config_locators.profilesettings_defaultfarm_dropdown ).currentText ), config.farm_name, "Expect selected farm name to be set.", ) # set queue name - gui_helpers.set_queue_name(config.queue_name) + workstation_config_helpers.set_queue_name(config.queue_name) # verify correct queue name is set test.compare( str( - squish.waitForObjectExists(gui_locators.farmsettings_defaultqueue_dropdown).currentText + squish.waitForObjectExists( + workstation_config_locators.farmsettings_defaultqueue_dropdown + ).currentText ), config.queue_name, "Expect selected queue name to be set.", ) # set storage profile - gui_helpers.set_storage_profile(config.storage_profile) + workstation_config_helpers.set_storage_profile(config.storage_profile) # verify correct storage profile name is set test.compare( str( squish.waitForObjectExists( - gui_locators.farmsettings_defaultstorageprofile_dropdown + workstation_config_locators.farmsettings_defaultstorageprofile_dropdown ).currentText ), config.storage_profile, "Expect selected storage profile to be set.", ) # set job attachments filesystem options - gui_helpers.set_job_attachments_filesystem_options(config.job_attachments) + workstation_config_helpers.set_job_attachments_filesystem_options(config.job_attachments) # verify job attachments filesystem options is set to 'COPIED' test.compare( str( squish.waitForObjectExists( - gui_locators.farmsettings_jobattachmentsoptions_dropdown + workstation_config_locators.farmsettings_jobattachmentsoptions_dropdown ).currentText ), config.job_attachments, @@ -88,7 +92,7 @@ def main(): test.compare( str( squish.waitForObjectExists( - gui_locators.farmsettings_jobattachmentsoptions_dropdown + workstation_config_locators.farmsettings_jobattachmentsoptions_dropdown ).toolTip ), config.tooltip_text_copied, @@ -98,7 +102,7 @@ def main(): test.compare( str( squish.waitForObjectExists( - gui_locators.jobattachments_filesystemoptions_lightbulb_icon + workstation_config_locators.jobattachments_filesystemoptions_lightbulb_icon ).toolTip ), config.tooltip_text_lightbulb, @@ -106,31 +110,39 @@ def main(): ) # verify auto accept prompt defaults checkbox is checkable test.compare( - squish.waitForObjectExists(gui_locators.autoaccept_promptdefaults_checkbox).checkable, + squish.waitForObjectExists( + workstation_config_locators.autoaccept_promptdefaults_checkbox + ).checkable, True, "Expect auto accept prompt defaults checkbox to be checkable.", ) # verify telemetry opt out checkbox is checkable test.compare( - squish.waitForObjectExists(gui_locators.telemetry_optout_checkbox).checkable, + squish.waitForObjectExists(workstation_config_locators.telemetry_optout_checkbox).checkable, True, "Expect telemetry opt out checkbox to be checkable.", ) # set conflict resolution option - gui_helpers.set_conflict_resolution_option(config.conflict_res_option) + workstation_config_helpers.set_conflict_resolution_option(config.conflict_res_option) # verify conflict resolution option is set to 'NOT_SELECTED' test.compare( str( - squish.waitForObjectExists(gui_locators.conflictresolution_option_dropdown).currentText + squish.waitForObjectExists( + workstation_config_locators.conflictresolution_option_dropdown + ).currentText ), config.conflict_res_option_expected_text, "Expect selected conflict resolution option to be set.", ) # set current logging level option - gui_helpers.set_current_logging_level(config.logging_level) + workstation_config_helpers.set_current_logging_level(config.logging_level) # verify current logging level option is set to 'WARNING' test.compare( - str(squish.waitForObjectExists(gui_locators.currentlogging_level_dropdown).currentText), + str( + squish.waitForObjectExists( + workstation_config_locators.currentlogging_level_dropdown + ).currentText + ), config.logging_level, "Expect selected current logging level to be set.", ) @@ -142,4 +154,4 @@ def cleanup(): loginout_helpers.set_aws_profile_name_and_verify_auth(config.profile_name) test.log("Reset aws profile name to `(default)` for test cleanup.") # close deadline config gui - gui_helpers.close_deadline_config_gui() + workstation_config_helpers.close_deadline_config_gui()