Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Playwright automation test #16956

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/susedistribution.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sub handle_password_prompt {
my ($console) = @_;
$console //= '';

return if (get_var("LIVETEST") || get_var('LIVECD')) && get_var('FLAVOR') !~ /d-installer/;
return if (get_var("LIVETEST") || get_var('LIVECD')) && (get_var('VERSION') !~ /agama/);
if (is_serial_terminal()) {
wait_serial(qr/Password:\s*$/i, timeout => 30);
} else {
Expand Down
7 changes: 7 additions & 0 deletions schedule/yam/agama/agama_installation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: agama_installation
description: >
Playwright test on agama
schedule:
- installation/bootloader_start
- yam/agama/agama_installation
35 changes: 35 additions & 0 deletions tests/yam/agama/agama_installation.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Copyright 2023 SUSE LLC
# SPDX-License-Identifier: GPL-2.0-or-later

# Summary: Run interactive installation with Agama,
# run playwright tests directly from the Live ISO.
# Maintainer: QE YaST and Migration (QE Yam) <qe-yam at suse de>

use base 'y2_installbase';
use strict;
use warnings;

use testapi qw(
assert_screen
assert_script_run
select_console
upload_logs
);
use power_action_utils 'power_action';
use transactional 'process_reboot';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you didn't use it at the end.


sub run {
assert_screen('agama_product_selection', 120);
$testapi::password = 'linux';
select_console 'root-console';

assert_script_run('RUN_INSTALLATION=1 playwright test --trace on --project chromium --config /usr/share/agama-playwright take_screenshots', timeout => 600);

upload_logs('./test-results/take_screenshots-The-Installer-installs-the-system-chromium/trace.zip');
assert_script_run('reboot');
assert_screen('grub2', 120);
my @tags = ("welcome-to", "login");
assert_screen(\@tags, 300);
}

1;