diff --git a/lib/utils.pm b/lib/utils.pm index de0b63f6..be846acf 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -7,7 +7,7 @@ use Exporter; use lockapi; use testapi; -our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type repo_setup setup_workaround_repo disable_updates_repos mount_update_image umount_update_image cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications solidify_wallpaper check_and_install_git download_testdata make_serial_writable/; +our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type repo_setup setup_workaround_repo disable_updates_repos mount_update_image umount_update_image cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications solidify_wallpaper check_and_install_git download_testdata make_serial_writable switch_highcontrast/; # We introduce this global variable to hold the list of applications that have # registered during the apps_startstop_test when they have sucessfully run. @@ -1531,4 +1531,16 @@ sub make_serial_writable { sleep 2; } +# This routine will switch high contrast in Gnome +sub switch_highcontrast { + send_key("super"); + type_very_safely("contrast"); + assert_and_click("accessibility_launcher"); + assert_and_click("accessibility_seeing"); + assert_and_click("accessibility_highcontrast"); + assert_and_click("icon_window_off"); + wait_still_screen(3); +} + + 1; diff --git a/templates.fif.json b/templates.fif.json index e2705aca..ba82a71f 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -1071,6 +1071,24 @@ "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" } }, + "calculator_highcontrast": { + "profiles": { + "fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50, + "fedora-Silverblue-dvd_ostree-iso-x86_64-*-64bit": 50, + "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 20, + "fedora-Workstation-live-iso-x86_64-*-64bit": 20, + "fedora-Workstation-upgrade-x86_64-*-64bit": 40, + "fedora-Workstation-upgrade-aarch64-*-aarch64": 40, + "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22 + }, + "settings": { + "BOOTFROM": "c", + "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", + "POSTINSTALL_PATH": "tests/applications/calculator", + "HIGHCONTRAST": "true", + "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%" + } + }, "clocks": { "profiles": { "fedora-Silverblue-dvd_ostree-iso-ppc64le-*-ppc64le": 50, diff --git a/tests/applications/calculator/aaa_setup.pm b/tests/applications/calculator/aaa_setup.pm index 47e3fa12..28f85418 100644 --- a/tests/applications/calculator/aaa_setup.pm +++ b/tests/applications/calculator/aaa_setup.pm @@ -10,6 +10,9 @@ sub run { # Run the application menu_launch_type("Calculator"); assert_screen("apps_run_calculator"); + + # Switch High Contrast if required + switch_highcontrast if (get_var("HIGHCONTRAST")); } sub test_flags { diff --git a/tests/desktop_browser.pm b/tests/desktop_browser.pm index 689e8587..5672ce30 100644 --- a/tests/desktop_browser.pm +++ b/tests/desktop_browser.pm @@ -34,13 +34,7 @@ sub run { desktop_vt; # In case of high contrast testing switch it on. if (get_var('HIGHCONTRAST')) { - send_key("super"); - type_very_safely("contrast"); - assert_and_click("accessibility_launcher"); - assert_and_click("accessibility_seeing"); - assert_and_click("accessibility_highcontrast"); - assert_and_click("icon_window_off"); - wait_still_screen(3); + switch_highcontrast(); } send_key 'super'; # wait out animations