Skip to content

Commit

Permalink
Add playwright test
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon-suse committed May 6, 2023
1 parent 8dcf744 commit 02dc2c8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
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('FLAVOR') !~ /default/ && get_var('FLAVOR') !~ /ALP/);
if (is_serial_terminal()) {
wait_serial(qr/Password:\s*$/i, timeout => 30);
} else {
Expand Down
8 changes: 8 additions & 0 deletions schedule/yam/agama/agama_installation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: agama_installation
description: >
Playwright test on agama
schedule:
- installation/bootloader_start
- yam/agama/agama_installation
- boot/boot_to_desktop
39 changes: 39 additions & 0 deletions tests/yam/agama/agama_installation.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## 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
set_var
script_output
upload_logs
);
use power_action_utils 'power_action';
use transactional 'process_reboot';

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(script_output('find . -name trace.zip'));
#set_var('BOOT_HDD_IMAGE', 1);
#power_action('reboot', textmode => 1, keepconsole => 1);
assert_script_run('reboot');
assert_screen('grub2', 120);
my @tags = ("welcome-to", "login");
assert_screen(\@tags, 300);
}

1;

0 comments on commit 02dc2c8

Please sign in to comment.