diff --git a/lib/anacondatest.pm b/lib/anacondatest.pm index ef02d10d..aac3bd3d 100644 --- a/lib/anacondatest.pm +++ b/lib/anacondatest.pm @@ -180,16 +180,6 @@ sub custom_delete_part { assert_and_click "anaconda_part_delete"; } -sub switch_layout { - # switch to 'native' or 'us' keyboard layout - my ($self, $layout) = @_; - $layout //= 'us'; - # if already selected, we're good - return if (check_screen "anaconda_layout_$layout", 3); - send_key "alt-shift"; - assert_screen "anaconda_layout_$layout", 3; -} - sub get_full_repo { my ($self, $repourl) = @_; # trivial thing we kept repeating: fill out an HTTP or HTTPS diff --git a/lib/main_common.pm b/lib/main_common.pm index 86cbabeb..e9ff8220 100644 --- a/lib/main_common.pm +++ b/lib/main_common.pm @@ -6,7 +6,7 @@ use base 'Exporter'; use Exporter; 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 console_loadkeys_us/; +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/; sub run_with_error_check { my ($func, $error_screen) = @_; @@ -75,6 +75,23 @@ sub console_switch_layout { } } +# switch to 'native' or 'us' keyboard layout in a graphical desktop +# 'environment' can be a desktop name or 'anaconda' for anaconda +# if not set, will use get_var('DESKTOP') or default 'anaconda' +sub desktop_switch_layout { + my ($layout, $environment) = @_; + $layout //= 'us'; + $environment //= get_var("DESKTOP", "anaconda"); + # if already selected, we're good + return if (check_screen "${environment}_layout_${layout}", 3); + # otherwise we need to switch + my $switcher = "alt-shift"; # anaconda + $switcher = "super-spc" if $environment eq 'gnome'; + # KDE? not used yet + send_key $switcher; + assert_screen "${environment}_layout_${layout}", 3; +} + # this subroutine handles logging in as a root/specified user into console # it requires TTY to be already displayed (handled by the root_console() # method of distribution classes) diff --git a/needles/anaconda/package_selection/workstation_highlighted.json b/needles/anaconda/package_selection/workstation_highlighted.json new file mode 100644 index 00000000..97c56160 --- /dev/null +++ b/needles/anaconda/package_selection/workstation_highlighted.json @@ -0,0 +1,14 @@ +{ + "area": [ + { + "height": 13, + "type": "match", + "width": 125, + "xpos": 48, + "ypos": 254 + } + ], + "tags": [ + "anaconda_workstation_highlighted" + ] +} diff --git a/needles/anaconda/package_selection/workstation_highlighted.png b/needles/anaconda/package_selection/workstation_highlighted.png new file mode 100644 index 00000000..c9750e62 Binary files /dev/null and b/needles/anaconda/package_selection/workstation_highlighted.png differ diff --git a/needles/anaconda/package_selection/workstation_selected.json b/needles/anaconda/package_selection/workstation_selected.json new file mode 100644 index 00000000..cc4b3acf --- /dev/null +++ b/needles/anaconda/package_selection/workstation_selected.json @@ -0,0 +1,14 @@ +{ + "area": [ + { + "height": 13, + "type": "match", + "width": 145, + "xpos": 28, + "ypos": 254 + } + ], + "tags": [ + "anaconda_workstation_selected" + ] +} \ No newline at end of file diff --git a/needles/anaconda/package_selection/workstation_selected.png b/needles/anaconda/package_selection/workstation_selected.png new file mode 100644 index 00000000..c9750e62 Binary files /dev/null and b/needles/anaconda/package_selection/workstation_selected.png differ diff --git a/needles/gnome/french/desktop_clean_french-20161215.json b/needles/gnome/french/desktop_clean_french-20161215.json new file mode 100644 index 00000000..9dba2820 --- /dev/null +++ b/needles/gnome/french/desktop_clean_french-20161215.json @@ -0,0 +1,24 @@ +{ + "area": [ + { + "type": "match", + "ypos": 6, + "width": 62, + "xpos": 10, + "height": 15 + }, + { + "ypos": 4, + "width": 43, + "type": "match", + "xpos": 968, + "height": 18 + } + ], + "tags": [ + "DESKTOP-gnome", + "LANGUAGE-french", + "graphical_desktop_clean" + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/gnome/french/desktop_clean_french-20161215.png b/needles/gnome/french/desktop_clean_french-20161215.png new file mode 100644 index 00000000..cc4725ea Binary files /dev/null and b/needles/gnome/french/desktop_clean_french-20161215.png differ diff --git a/needles/gnome/french/getting_started_french-20161215.json b/needles/gnome/french/getting_started_french-20161215.json new file mode 100644 index 00000000..a5d5d414 --- /dev/null +++ b/needles/gnome/french/getting_started_french-20161215.json @@ -0,0 +1,16 @@ +{ + "tags": [ + "LANGUAGE-french", + "getting_started" + ], + "properties": [], + "area": [ + { + "xpos": 467, + "ypos": 36, + "width": 88, + "height": 16, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/french/getting_started_french-20161215.png b/needles/gnome/french/getting_started_french-20161215.png new file mode 100644 index 00000000..d7348884 Binary files /dev/null and b/needles/gnome/french/getting_started_french-20161215.png differ diff --git a/needles/gnome/french/login_gdm_input_french-20161215.json b/needles/gnome/french/login_gdm_input_french-20161215.json new file mode 100644 index 00000000..e3e457f3 --- /dev/null +++ b/needles/gnome/french/login_gdm_input_french-20161215.json @@ -0,0 +1,17 @@ +{ + "area": [ + { + "xpos": 343, + "ypos": 375, + "width": 338, + "height": 58, + "type": "match" + } + ], + "tags": [ + "DESKTOP-gnome", + "LANGUAGE-french", + "graphical_login_input" + ], + "properties": [] +} \ No newline at end of file diff --git a/needles/gnome/french/login_gdm_input_french-20161215.png b/needles/gnome/french/login_gdm_input_french-20161215.png new file mode 100644 index 00000000..0074cb3f Binary files /dev/null and b/needles/gnome/french/login_gdm_input_french-20161215.png differ diff --git a/needles/gnome/french/next_button_french-20161215.json b/needles/gnome/french/next_button_french-20161215.json new file mode 100644 index 00000000..f09cde6a --- /dev/null +++ b/needles/gnome/french/next_button_french-20161215.json @@ -0,0 +1,16 @@ +{ + "properties": [], + "tags": [ + "LANGUAGE-french", + "next_button" + ], + "area": [ + { + "xpos": 955, + "ypos": 43, + "width": 47, + "height": 14, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/french/next_button_french-20161215.png b/needles/gnome/french/next_button_french-20161215.png new file mode 100644 index 00000000..763dd2e3 Binary files /dev/null and b/needles/gnome/french/next_button_french-20161215.png differ diff --git a/needles/gnome/french/skip_button_french-20161215.json b/needles/gnome/french/skip_button_french-20161215.json new file mode 100644 index 00000000..bb427c5b --- /dev/null +++ b/needles/gnome/french/skip_button_french-20161215.json @@ -0,0 +1,16 @@ +{ + "tags": [ + "LANGUAGE-french", + "skip_button" + ], + "properties": [], + "area": [ + { + "xpos": 960, + "ypos": 43, + "width": 43, + "height": 14, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/french/skip_button_french-20161215.png b/needles/gnome/french/skip_button_french-20161215.png new file mode 100644 index 00000000..2c5dd47b Binary files /dev/null and b/needles/gnome/french/skip_button_french-20161215.png differ diff --git a/needles/gnome/getting_started-20160901.json b/needles/gnome/getting_started-20160901.json index da7fa86c..92d02682 100644 --- a/needles/gnome/getting_started-20160901.json +++ b/needles/gnome/getting_started-20160901.json @@ -10,6 +10,7 @@ ], "properties": [], "tags": [ - "getting_started" + "getting_started", + "LANGUAGE-english" ] -} \ No newline at end of file +} diff --git a/needles/gnome/getting_started.json b/needles/gnome/getting_started.json index 12029602..69e708d9 100644 --- a/needles/gnome/getting_started.json +++ b/needles/gnome/getting_started.json @@ -10,6 +10,7 @@ ], "properties": [], "tags": [ - "getting_started" + "getting_started", + "LANGUAGE-english" ] -} \ No newline at end of file +} diff --git a/needles/gnome/layout_us-20161215.json b/needles/gnome/layout_us-20161215.json new file mode 100644 index 00000000..afda8b51 --- /dev/null +++ b/needles/gnome/layout_us-20161215.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "height": 13, + "width": 33, + "ypos": 7, + "type": "match", + "xpos": 854 + } + ], + "properties": [], + "tags": [ + "gnome_layout_us" + ] +} \ No newline at end of file diff --git a/needles/gnome/layout_us-20161215.png b/needles/gnome/layout_us-20161215.png new file mode 100644 index 00000000..3feda689 Binary files /dev/null and b/needles/gnome/layout_us-20161215.png differ diff --git a/needles/gnome/layout_us-gdm-20161215.json b/needles/gnome/layout_us-gdm-20161215.json new file mode 100644 index 00000000..91dd0898 --- /dev/null +++ b/needles/gnome/layout_us-gdm-20161215.json @@ -0,0 +1,14 @@ +{ + "area": [ + { + "height": 13, + "type": "match", + "width": 33, + "xpos": 853, + "ypos": 7 + } + ], + "tags": [ + "gnome_layout_us" + ] +} diff --git a/needles/gnome/layout_us-gdm-20161215.png b/needles/gnome/layout_us-gdm-20161215.png new file mode 100644 index 00000000..deb62761 Binary files /dev/null and b/needles/gnome/layout_us-gdm-20161215.png differ diff --git a/needles/gnome/login_gdm.json b/needles/gnome/login_gdm.json index a206859f..e095993b 100644 --- a/needles/gnome/login_gdm.json +++ b/needles/gnome/login_gdm.json @@ -2,10 +2,7 @@ "tags": [ "graphical_login", "login_screen", - "DESKTOP-gnome", - "ENV-DISTRI-fedora", - "LANGUAGE-english", - "ENV-FLAVOR-develop" + "DESKTOP-gnome" ], "properties": [], "area": [ diff --git a/needles/gnome/next_button-20160823.json b/needles/gnome/next_button-20160823.json index d1c6012d..2a9fa5fd 100644 --- a/needles/gnome/next_button-20160823.json +++ b/needles/gnome/next_button-20160823.json @@ -10,6 +10,7 @@ ], "properties": [], "tags": [ - "next_button" + "next_button", + "LANGUAGE-english" ] -} \ No newline at end of file +} diff --git a/needles/gnome/next_button-20160824.json b/needles/gnome/next_button-20160824.json index a92ca51a..4974bb63 100644 --- a/needles/gnome/next_button-20160824.json +++ b/needles/gnome/next_button-20160824.json @@ -1,6 +1,7 @@ { "tags": [ - "next_button" + "next_button", + "LANGUAGE-english" ], "area": [ { @@ -12,4 +13,4 @@ } ], "properties": [] -} \ No newline at end of file +} diff --git a/needles/gnome/next_button.json b/needles/gnome/next_button.json index 0c76dcfb..cef8e5a5 100644 --- a/needles/gnome/next_button.json +++ b/needles/gnome/next_button.json @@ -10,6 +10,7 @@ ], "properties": [], "tags": [ - "next_button" + "next_button", + "LANGUAGE-english" ] -} \ No newline at end of file +} diff --git a/needles/gnome/russian/desktop_clean_russian-20161215.json b/needles/gnome/russian/desktop_clean_russian-20161215.json new file mode 100644 index 00000000..e79cd766 --- /dev/null +++ b/needles/gnome/russian/desktop_clean_russian-20161215.json @@ -0,0 +1,25 @@ +{ + "area": [ + { + "height": 15, + "type": "match", + "width": 44, + "ypos": 7, + "xpos": 12 + }, + { + "height": 18, + "width": 43, + "ypos": 4, + "type": "match", + "xpos": 968 + } + ], + "properties": [], + "tags": [ + "DESKTOP-gnome", + "ENV-DISTRI-fedora", + "LANGUAGE-russian", + "graphical_desktop_clean" + ] +} \ No newline at end of file diff --git a/needles/gnome/russian/desktop_clean_russian-20161215.png b/needles/gnome/russian/desktop_clean_russian-20161215.png new file mode 100644 index 00000000..c79d8b98 Binary files /dev/null and b/needles/gnome/russian/desktop_clean_russian-20161215.png differ diff --git a/needles/gnome/russian/getting_started_russian-20161215.json b/needles/gnome/russian/getting_started_russian-20161215.json new file mode 100644 index 00000000..c281ddde --- /dev/null +++ b/needles/gnome/russian/getting_started_russian-20161215.json @@ -0,0 +1,16 @@ +{ + "tags": [ + "LANGUAGE-russian", + "getting_started" + ], + "properties": [], + "area": [ + { + "height": 17, + "type": "match", + "width": 104, + "ypos": 34, + "xpos": 460 + } + ] +} \ No newline at end of file diff --git a/needles/gnome/russian/getting_started_russian-20161215.png b/needles/gnome/russian/getting_started_russian-20161215.png new file mode 100644 index 00000000..1075c011 Binary files /dev/null and b/needles/gnome/russian/getting_started_russian-20161215.png differ diff --git a/needles/gnome/russian/layout_native_russian-20161215.json b/needles/gnome/russian/layout_native_russian-20161215.json new file mode 100644 index 00000000..a2533115 --- /dev/null +++ b/needles/gnome/russian/layout_native_russian-20161215.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "height": 13, + "type": "match", + "width": 33, + "xpos": 853, + "ypos": 7 + } + ], + "tags": [ + "gnome_layout_native", + "LANGUAGE-russian" + ] +} diff --git a/needles/gnome/russian/layout_native_russian-20161215.png b/needles/gnome/russian/layout_native_russian-20161215.png new file mode 100644 index 00000000..34cc0fc8 Binary files /dev/null and b/needles/gnome/russian/layout_native_russian-20161215.png differ diff --git a/needles/gnome/russian/layout_native_russian-gdm-20161215.json b/needles/gnome/russian/layout_native_russian-gdm-20161215.json new file mode 100644 index 00000000..a2533115 --- /dev/null +++ b/needles/gnome/russian/layout_native_russian-gdm-20161215.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "height": 13, + "type": "match", + "width": 33, + "xpos": 853, + "ypos": 7 + } + ], + "tags": [ + "gnome_layout_native", + "LANGUAGE-russian" + ] +} diff --git a/needles/gnome/russian/layout_native_russian-gdm-20161215.png b/needles/gnome/russian/layout_native_russian-gdm-20161215.png new file mode 100644 index 00000000..afd6a947 Binary files /dev/null and b/needles/gnome/russian/layout_native_russian-gdm-20161215.png differ diff --git a/needles/gnome/russian/login_gdm_input_russian-20161215.json b/needles/gnome/russian/login_gdm_input_russian-20161215.json new file mode 100644 index 00000000..d7bdbc54 --- /dev/null +++ b/needles/gnome/russian/login_gdm_input_russian-20161215.json @@ -0,0 +1,17 @@ +{ + "tags": [ + "DESKTOP-gnome", + "LANGUAGE-russian", + "graphical_login_input" + ], + "properties": [], + "area": [ + { + "type": "match", + "width": 341, + "ypos": 374, + "xpos": 341, + "height": 59 + } + ] +} \ No newline at end of file diff --git a/needles/gnome/russian/login_gdm_input_russian-20161215.png b/needles/gnome/russian/login_gdm_input_russian-20161215.png new file mode 100644 index 00000000..be4baa92 Binary files /dev/null and b/needles/gnome/russian/login_gdm_input_russian-20161215.png differ diff --git a/needles/gnome/russian/next_button_russian-20161215.json b/needles/gnome/russian/next_button_russian-20161215.json new file mode 100644 index 00000000..22c645ac --- /dev/null +++ b/needles/gnome/russian/next_button_russian-20161215.json @@ -0,0 +1,16 @@ +{ + "tags": [ + "LANGUAGE-russian", + "next_button" + ], + "properties": [], + "area": [ + { + "xpos": 952, + "type": "match", + "ypos": 37, + "width": 55, + "height": 25 + } + ] +} \ No newline at end of file diff --git a/needles/gnome/russian/next_button_russian-20161215.png b/needles/gnome/russian/next_button_russian-20161215.png new file mode 100644 index 00000000..ff8f6fa0 Binary files /dev/null and b/needles/gnome/russian/next_button_russian-20161215.png differ diff --git a/needles/gnome/russian/skip_button_russian-20161215.json b/needles/gnome/russian/skip_button_russian-20161215.json new file mode 100644 index 00000000..384625eb --- /dev/null +++ b/needles/gnome/russian/skip_button_russian-20161215.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "xpos": 921, + "type": "match", + "ypos": 41, + "width": 82, + "height": 20 + } + ], + "properties": [], + "tags": [ + "LANGUAGE-russian", + "skip_button" + ] +} \ No newline at end of file diff --git a/needles/gnome/russian/skip_button_russian-20161215.png b/needles/gnome/russian/skip_button_russian-20161215.png new file mode 100644 index 00000000..dc933bc5 Binary files /dev/null and b/needles/gnome/russian/skip_button_russian-20161215.png differ diff --git a/needles/gnome/skip_button.json b/needles/gnome/skip_button.json index a0bcb8b3..dddce192 100644 --- a/needles/gnome/skip_button.json +++ b/needles/gnome/skip_button.json @@ -10,6 +10,7 @@ ], "properties": [], "tags": [ - "skip_button" + "skip_button", + "LANGUAGE-english" ] -} \ No newline at end of file +} diff --git a/templates b/templates index 7e4efa5f..d3105b81 100755 --- a/templates +++ b/templates @@ -1933,19 +1933,27 @@ name => "install_european_language", settings => [ { key => "LANGUAGE", value => "french" }, + { key => "DESKTOP", value => "gnome" }, + { key => "PACKAGE_SET", value => "workstation" }, { key => "USER_LOGIN", value => "qwerty" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, { key => "ENCRYPT_PASSWORD", value => "weakpassword" }, + { key => "POSTINSTALL", value => "_console_login" }, + { key => "REPOSITORY_VARIATION", value => "%LOCATION%" }, ], }, { name => "install_cyrillic_language", settings => [ { key => "LANGUAGE", value => "russian" }, + { key => "DESKTOP", value => "gnome" }, + { key => "PACKAGE_SET", value => "workstation" }, { key => "SWITCHED_LAYOUT", value => "1" }, { key => "USER_LOGIN", value => "qwerty" }, { key => "ROOT_PASSWORD", value => "weakpassword" }, { key => "ENCRYPT_PASSWORD", value => "weakpassword" }, + { key => "POSTINSTALL", value => "_console_login" }, + { key => "REPOSITORY_VARIATION", value => "%LOCATION%" }, ], }, { diff --git a/tests/_console_login.pm b/tests/_console_login.pm new file mode 100644 index 00000000..6605c9f9 --- /dev/null +++ b/tests/_console_login.pm @@ -0,0 +1,29 @@ +use base "fedorabase"; +use strict; +use testapi; +use main_common; + +sub run { + my $self = shift; + send_key "ctrl-alt-f3"; + + # do user login unless USER_LOGIN is set to string 'false' + unless (get_var("USER_LOGIN") eq "false") { + console_login(user=>get_var("USER_LOGIN", "test"), password=>get_var("USER_PASSWORD", "weakpassword")); + } + if (get_var("ROOT_PASSWORD")) { + console_login(user=>"root", password=>get_var("ROOT_PASSWORD")); + } +} + +sub test_flags { + # without anything - rollback to 'lastgood' snapshot if failed + # 'fatal' - whole test suite is in danger if this fails + # 'milestone' - after this test succeeds, update 'lastgood' + # 'important' - if this fails, set the overall state to 'fail' + return { fatal => 1, milestone => 1 }; +} + +1; + +# vim: set sw=4 et: diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index fa6858c1..887ff23e 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -9,9 +9,9 @@ sub type_user_password { if (get_var("SWITCHED_LAYOUT")) { # we double the password, the second time using the native # layout, so the password has both US and native characters - $self->switch_layout("us"); + desktop_switch_layout "us", "anaconda"; type_very_safely $user_password; - $self->switch_layout("native"); + desktop_switch_layout "native", "anaconda"; type_very_safely $user_password; } else { @@ -37,7 +37,7 @@ sub run { assert_screen "anaconda_install_root_password_screen"; # wait out animation wait_still_screen 2; - $self->switch_layout("us") if (get_var("SWITCHED_LAYOUT")); + desktop_switch_layout("us", "anaconda") if (get_var("SWITCHED_LAYOUT")); if (get_var("IMAGETYPE") eq 'dvd-ostree') { # we can't type SUPER safely for ostree installer tests, as # the install completes quite fast and if we type too slow diff --git a/tests/_graphical_wait_login.pm b/tests/_graphical_wait_login.pm index e713b100..aee81587 100644 --- a/tests/_graphical_wait_login.pm +++ b/tests/_graphical_wait_login.pm @@ -22,7 +22,19 @@ sub run { send_key "ret"; } assert_screen "graphical_login_input"; - type_very_safely get_var("USER_PASSWORD", "weakpassword"); + my $password = get_var("USER_PASSWORD", "weakpassword"); + if (get_var("SWITCHED_LAYOUT")) { + # see _do_install_and_reboot; when layout is switched + # user password is doubled to contain both US and native + # chars + desktop_switch_layout 'us'; + type_very_safely $password; + desktop_switch_layout 'native'; + type_very_safely $password; + } + else { + type_very_safely $password; + } send_key "ret"; # Handle initial-setup, for GNOME, unless START_AFTER_TEST @@ -52,6 +64,11 @@ sub run { mouse_set(300, 200); # KDE can take ages to start up assert_screen "graphical_desktop_clean", 120; + if (get_var("SWITCHED_LAYOUT")) { + # check both layouts are available at the desktop + desktop_switch_layout 'us'; + desktop_switch_layout 'native'; + } } } diff --git a/tests/disk_guided_encrypted.pm b/tests/disk_guided_encrypted.pm index a66d99e7..39a5c424 100644 --- a/tests/disk_guided_encrypted.pm +++ b/tests/disk_guided_encrypted.pm @@ -16,14 +16,14 @@ sub run { # type password for disk encryption wait_idle 5; if (get_var("SWITCHED_LAYOUT")) { - $self->switch_layout("us"); + desktop_switch_layout "us", "anaconda"; } type_safely get_var("ENCRYPT_PASSWORD"); wait_screen_change { send_key "tab"; }; type_safely get_var("ENCRYPT_PASSWORD"); if (get_var("SWITCHED_LAYOUT")) { # work around RHBZ #1333984 - $self->switch_layout("native"); + desktop_switch_layout "native", "anaconda"; } assert_and_click "anaconda_install_destination_save_passphrase";