From 2cd43c09c558e8bd316bdba5a4713f05d9225efe Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Tue, 14 May 2024 18:27:11 +0100 Subject: [PATCH 1/3] Add new tests for live iso testing --- testcases/ubuntu-mate/24.04/i18n/en_US | 1 + .../24.04/test_boot_to_live_environment | 78 +++++++++++++++++++ .../daily-live/test_boot_to_live_environment | 78 +++++++++++++++++++ testcases/ubuntu/24.04/i18n/en_US | 2 + .../24.04/test_boot_to_live_environment | 74 ++++++++++++++++++ testcases/ubuntu/daily-live/i18n/en_US | 2 + .../daily-live/test_boot_to_live_environment | 77 ++++++++++++++++++ 7 files changed, 312 insertions(+) create mode 100644 testcases/ubuntu-mate/24.04/test_boot_to_live_environment create mode 100644 testcases/ubuntu-mate/daily-live/test_boot_to_live_environment create mode 100644 testcases/ubuntu/24.04/test_boot_to_live_environment create mode 100644 testcases/ubuntu/daily-live/test_boot_to_live_environment diff --git a/testcases/ubuntu-mate/24.04/i18n/en_US b/testcases/ubuntu-mate/24.04/i18n/en_US index 121bfca..8f05432 100755 --- a/testcases/ubuntu-mate/24.04/i18n/en_US +++ b/testcases/ubuntu-mate/24.04/i18n/en_US @@ -51,6 +51,7 @@ text_installation_select_your_timezone_title="Select your timezone" text_installation_ready_to_install_title="Ready to install" +text_firefox_welcome_to_firefox="Welcome to Firefox" text_installation_complete_body1="Ubuntu-MATE 24.04 LTS is installed and ready to use" text_installation_complete_body2="Any changes you make will not be saved" diff --git a/testcases/ubuntu-mate/24.04/test_boot_to_live_environment b/testcases/ubuntu-mate/24.04/test_boot_to_live_environment new file mode 100644 index 0000000..db3c346 --- /dev/null +++ b/testcases/ubuntu-mate/24.04/test_boot_to_live_environment @@ -0,0 +1,78 @@ +# Boot to live environment +######################################################################################## +# # +# Name: test_boot_to_live_environment # +# Author: Alan Pope # +# Date: 2024-05-13 # +# Version: 1 # +# Description: Boot to the graphical desktop # +# # +######################################################################################## + +function test_setup() { + # No setup required + echo "No setup required" +} + +function test_post_boot_grub() { + # Wait a while for EUFI or BIOS to pass + # We could skip having this function, but it's nice to have + # So we have the opportunity to click that stupid dialog + qt_wait_for_seconds 10 + # Wait for the grub menu + qt_wait_for_text "$FUNCNAME" "$text_console_gnu_grub" 5 5 + qt_screenshot_ppm "$FUNCNAME" + # Press enter on the 'Try or install Ubuntu' GRUB option + qt_send_key "return" +} + +function test_installer_initial_load() { + # Wait for the installer to load + # Takes a while initially to get started so we give it 10 loads of 30 seconds + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_title" 10 30 + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_body" 10 3 + qt_send_key_combo "alt-f4" + qt_wait_for_seconds 1 +} + +function test_open_terminal_capture_xrandr() { + # Open a terminal + qt_send_key_combo "ctrl-alt-t" + qt_screenshot_ppm "$FUNCNAME" + qt_wait_for_seconds 1 + # Maximize the window + qt_send_key_combo "alt-space" + qt_send_key "x" + qt_wait_for_seconds 1 + # Put something vaguely interesting useful in the terminal + qt_send_string_return "xrandr" + qt_send_string_return "lsb_release -a" + qt_send_string_return "uname -a" + qt_wait_for_seconds 1 + # Get a pretty screenshot + qt_screenshot_ppm "$FUNCNAME" + # Close the terminal + qt_send_key_combo "ctrl-shift-q" +} + +function test_launch_firefox { + # Launch Firefox + qt_send_key_combo "meta_l" + qt_send_string_return "firefox" + qt_wait_for_text "$FUNCNAME" "$text_firefox_welcome_to_firefox" 10 5 + qt_send_key_combo "alt-f4" +} + +function test_power_off_vm() { + # send power off + qt_poweroff_vm +} + +function test_boot_to_live_environment() { + test_setup + test_post_boot_grub + test_installer_initial_load + test_open_terminal_capture_xrandr + test_launch_firefox + test_power_off_vm +} \ No newline at end of file diff --git a/testcases/ubuntu-mate/daily-live/test_boot_to_live_environment b/testcases/ubuntu-mate/daily-live/test_boot_to_live_environment new file mode 100644 index 0000000..db3c346 --- /dev/null +++ b/testcases/ubuntu-mate/daily-live/test_boot_to_live_environment @@ -0,0 +1,78 @@ +# Boot to live environment +######################################################################################## +# # +# Name: test_boot_to_live_environment # +# Author: Alan Pope # +# Date: 2024-05-13 # +# Version: 1 # +# Description: Boot to the graphical desktop # +# # +######################################################################################## + +function test_setup() { + # No setup required + echo "No setup required" +} + +function test_post_boot_grub() { + # Wait a while for EUFI or BIOS to pass + # We could skip having this function, but it's nice to have + # So we have the opportunity to click that stupid dialog + qt_wait_for_seconds 10 + # Wait for the grub menu + qt_wait_for_text "$FUNCNAME" "$text_console_gnu_grub" 5 5 + qt_screenshot_ppm "$FUNCNAME" + # Press enter on the 'Try or install Ubuntu' GRUB option + qt_send_key "return" +} + +function test_installer_initial_load() { + # Wait for the installer to load + # Takes a while initially to get started so we give it 10 loads of 30 seconds + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_title" 10 30 + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_body" 10 3 + qt_send_key_combo "alt-f4" + qt_wait_for_seconds 1 +} + +function test_open_terminal_capture_xrandr() { + # Open a terminal + qt_send_key_combo "ctrl-alt-t" + qt_screenshot_ppm "$FUNCNAME" + qt_wait_for_seconds 1 + # Maximize the window + qt_send_key_combo "alt-space" + qt_send_key "x" + qt_wait_for_seconds 1 + # Put something vaguely interesting useful in the terminal + qt_send_string_return "xrandr" + qt_send_string_return "lsb_release -a" + qt_send_string_return "uname -a" + qt_wait_for_seconds 1 + # Get a pretty screenshot + qt_screenshot_ppm "$FUNCNAME" + # Close the terminal + qt_send_key_combo "ctrl-shift-q" +} + +function test_launch_firefox { + # Launch Firefox + qt_send_key_combo "meta_l" + qt_send_string_return "firefox" + qt_wait_for_text "$FUNCNAME" "$text_firefox_welcome_to_firefox" 10 5 + qt_send_key_combo "alt-f4" +} + +function test_power_off_vm() { + # send power off + qt_poweroff_vm +} + +function test_boot_to_live_environment() { + test_setup + test_post_boot_grub + test_installer_initial_load + test_open_terminal_capture_xrandr + test_launch_firefox + test_power_off_vm +} \ No newline at end of file diff --git a/testcases/ubuntu/24.04/i18n/en_US b/testcases/ubuntu/24.04/i18n/en_US index 0d11203..0b33f32 100755 --- a/testcases/ubuntu/24.04/i18n/en_US +++ b/testcases/ubuntu/24.04/i18n/en_US @@ -51,6 +51,8 @@ text_installation_select_your_timezone_title="Select your timezone" text_installation_ready_to_install_title="Ready to install" +text_firefox_welcome_to_firefox="Welcome to Firefox" + # Installation finished screen text_installation_complete_title="Installation complete" diff --git a/testcases/ubuntu/24.04/test_boot_to_live_environment b/testcases/ubuntu/24.04/test_boot_to_live_environment new file mode 100644 index 0000000..708c36f --- /dev/null +++ b/testcases/ubuntu/24.04/test_boot_to_live_environment @@ -0,0 +1,74 @@ +# Boot to live environment +######################################################################################## +# # +# Name: test_boot_to_live_environment # +# Author: Alan Pope # +# Date: 2024-05-13 # +# Version: 1 # +# Description: Boot to the graphical desktop # +# # +######################################################################################## + +function test_setup() { + # No setup required + echo "No setup required" +} + +function test_post_boot_grub() { + # Wait a while for EUFI or BIOS to pass + # We could skip having this function, but it's nice to have + # So we have the opportunity to click that stupid dialog + qt_wait_for_seconds 10 + # Wait for the grub menu + qt_wait_for_text "$FUNCNAME" "$text_console_gnu_grub" 10 5 + qt_screenshot_ppm "$FUNCNAME" + # Press enter on the 'Try or install Ubuntu' GRUB option + qt_send_key "return" +} + +function test_installer_initial_load() { + # Wait for the installer to load + # Takes a while initially to get started so we give it 10 loads of 30 seconds + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_title" 10 30 + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_body" 10 3 + qt_send_key_combo "alt-f4" +} + +## This is temporary for debugging +function test_open_terminal_capture_xrandr() { + # Open a terminal + qt_send_key_combo "ctrl-alt-t" + qt_screenshot_ppm "$FUNCNAME" + qt_wait_for_seconds 1 + # Maximize the window + qt_send_key_combo "meta_l-up" + qt_wait_for_seconds 1 + qt_send_string_return "xrandr" + qt_screenshot_ppm "$FUNCNAME" + # Get a pretty screenshot + qt_screenshot_ppm "$FUNCNAME" + # Close the terminal + qt_send_key_combo "ctrl-shift-q" +} + +function test_launch_firefox { + # Launch Firefox + qt_send_key_combo "meta_l" + qt_send_string_return "firefox" + qt_wait_for_text "$FUNCNAME" "$text_firefox_welcome_to_firefox" 10 5 + qt_send_key_combo "alt-f4" +} + +function test_power_off_vm() { + # send power off + qt_poweroff_vm +} + +function test_boot_to_live_environment() { + test_setup + test_post_boot_grub + test_installer_initial_load + test_open_terminal_capture_xrandr + test_launch_firefox + test_power_off_vm +} \ No newline at end of file diff --git a/testcases/ubuntu/daily-live/i18n/en_US b/testcases/ubuntu/daily-live/i18n/en_US index cf47412..293ea3e 100755 --- a/testcases/ubuntu/daily-live/i18n/en_US +++ b/testcases/ubuntu/daily-live/i18n/en_US @@ -56,6 +56,8 @@ text_installation_select_your_timezone_title="Select your timezone" text_installation_ready_to_install_title="Ready to install" +text_firefox_welcome_to_firefox="Welcome to Firefox" + # Installation finished screen text_installation_complete_title="Installation complete" diff --git a/testcases/ubuntu/daily-live/test_boot_to_live_environment b/testcases/ubuntu/daily-live/test_boot_to_live_environment new file mode 100644 index 0000000..6ef2a97 --- /dev/null +++ b/testcases/ubuntu/daily-live/test_boot_to_live_environment @@ -0,0 +1,77 @@ +# Boot to welcome screen +######################################################################################## +# # +# Name: test_boot_to_welcome_screen # +# Author: Alan Pope # +# Date: 2024-05-13 # +# Version: 1 # +# Description: Boot to the graphical installer # +# # +######################################################################################## + +function test_setup() { + # No setup required + echo "No setup required" +} + +function test_post_boot_grub() { + # Wait a while for EUFI or BIOS to pass + # We could skip having this function, but it's nice to have + # So we have the opportunity to click that stupid dialog + qt_wait_for_seconds 10 + # Wait for the grub menu + qt_wait_for_text "$FUNCNAME" "$text_console_gnu_grub" 5 5 + qt_screenshot_ppm "$FUNCNAME" + # Press enter on the 'Try or install Ubuntu' GRUB option + qt_send_key "return" +} + +function test_installer_initial_load() { + # Wait for the installer to load + # Takes a while initially to get started so we give it 10 loads of 30 seconds + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_title" 10 30 + qt_wait_for_text "$FUNCNAME" "$text_installation_welcome_to_ubuntu_body" 10 3 + qt_send_key_combo "alt-f4" + qt_wait_for_seconds 1 +} + +function test_open_terminal_capture_xrandr() { + # Open a terminal + qt_send_key_combo "ctrl-alt-t" + qt_screenshot_ppm "$FUNCNAME" + qt_wait_for_seconds 1 + # Maximize the window + qt_send_key_combo "meta_l-up" + qt_wait_for_seconds 1 + # Put something vaguely interesting useful in the terminal + qt_send_string_return "xrandr" + qt_send_string_return "lsb_release -a" + qt_send_string_return "uname -a" + qt_wait_for_seconds 1 + # Get a pretty screenshot + qt_screenshot_ppm "$FUNCNAME" + # Close the terminal + qt_send_key_combo "ctrl-d" +} + +function test_launch_firefox { + # Launch Firefox + qt_send_key_combo "meta_l" + qt_send_string_return "firefox" + qt_wait_for_text "$FUNCNAME" "$text_firefox_welcome_to_firefox" 10 5 + qt_send_key_combo "alt-f4" +} + +function test_power_off_vm() { + # send power off + qt_poweroff_vm +} + +function test_boot_to_live_environment() { + test_setup + test_post_boot_grub + test_installer_initial_load + test_open_terminal_capture_xrandr + test_launch_firefox + test_power_off_vm +} \ No newline at end of file From 954c2c2d18739a521c473c10d3d9cc78f0da29bd Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Tue, 14 May 2024 18:35:08 +0100 Subject: [PATCH 2/3] remove unnecessary maximise window --- testcases/ubuntu-mate/24.04/test_boot_to_live_environment | 4 ---- .../ubuntu-mate/daily-live/test_boot_to_live_environment | 4 ---- testcases/ubuntu/daily-live/test_boot_to_live_environment | 3 --- 3 files changed, 11 deletions(-) diff --git a/testcases/ubuntu-mate/24.04/test_boot_to_live_environment b/testcases/ubuntu-mate/24.04/test_boot_to_live_environment index db3c346..743381d 100644 --- a/testcases/ubuntu-mate/24.04/test_boot_to_live_environment +++ b/testcases/ubuntu-mate/24.04/test_boot_to_live_environment @@ -40,10 +40,6 @@ function test_open_terminal_capture_xrandr() { qt_send_key_combo "ctrl-alt-t" qt_screenshot_ppm "$FUNCNAME" qt_wait_for_seconds 1 - # Maximize the window - qt_send_key_combo "alt-space" - qt_send_key "x" - qt_wait_for_seconds 1 # Put something vaguely interesting useful in the terminal qt_send_string_return "xrandr" qt_send_string_return "lsb_release -a" diff --git a/testcases/ubuntu-mate/daily-live/test_boot_to_live_environment b/testcases/ubuntu-mate/daily-live/test_boot_to_live_environment index db3c346..743381d 100644 --- a/testcases/ubuntu-mate/daily-live/test_boot_to_live_environment +++ b/testcases/ubuntu-mate/daily-live/test_boot_to_live_environment @@ -40,10 +40,6 @@ function test_open_terminal_capture_xrandr() { qt_send_key_combo "ctrl-alt-t" qt_screenshot_ppm "$FUNCNAME" qt_wait_for_seconds 1 - # Maximize the window - qt_send_key_combo "alt-space" - qt_send_key "x" - qt_wait_for_seconds 1 # Put something vaguely interesting useful in the terminal qt_send_string_return "xrandr" qt_send_string_return "lsb_release -a" diff --git a/testcases/ubuntu/daily-live/test_boot_to_live_environment b/testcases/ubuntu/daily-live/test_boot_to_live_environment index 6ef2a97..d2c297a 100644 --- a/testcases/ubuntu/daily-live/test_boot_to_live_environment +++ b/testcases/ubuntu/daily-live/test_boot_to_live_environment @@ -40,9 +40,6 @@ function test_open_terminal_capture_xrandr() { qt_send_key_combo "ctrl-alt-t" qt_screenshot_ppm "$FUNCNAME" qt_wait_for_seconds 1 - # Maximize the window - qt_send_key_combo "meta_l-up" - qt_wait_for_seconds 1 # Put something vaguely interesting useful in the terminal qt_send_string_return "xrandr" qt_send_string_return "lsb_release -a" From 7b66a103f3cca830ff18469441077434da23f549 Mon Sep 17 00:00:00 2001 From: Alan Pope Date: Tue, 14 May 2024 18:40:00 +0100 Subject: [PATCH 3/3] Remove maximise for consistency --- testcases/ubuntu/24.04/test_boot_to_live_environment | 3 --- 1 file changed, 3 deletions(-) diff --git a/testcases/ubuntu/24.04/test_boot_to_live_environment b/testcases/ubuntu/24.04/test_boot_to_live_environment index 708c36f..86459fa 100644 --- a/testcases/ubuntu/24.04/test_boot_to_live_environment +++ b/testcases/ubuntu/24.04/test_boot_to_live_environment @@ -40,9 +40,6 @@ function test_open_terminal_capture_xrandr() { qt_send_key_combo "ctrl-alt-t" qt_screenshot_ppm "$FUNCNAME" qt_wait_for_seconds 1 - # Maximize the window - qt_send_key_combo "meta_l-up" - qt_wait_for_seconds 1 qt_send_string_return "xrandr" qt_screenshot_ppm "$FUNCNAME" # Get a pretty screenshot