Skip to content

Commit

Permalink
Fix evoultion smoke test
Browse files Browse the repository at this point in the history
Test also handles loading a user's email
  • Loading branch information
DeepthiYV committed Jul 30, 2024
1 parent 985eb32 commit 7227095
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 23 deletions.
Binary file added data/evolution/evolution-backup.tar.gz
Binary file not shown.
27 changes: 27 additions & 0 deletions lib/x11test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,33 @@ sub start_evolution {
wait_still_screen(2);
}

sub start_evolution_from_backupfile {
my ($self, $mail_box) = @_;

# Cleanup past configs and start Evolution.
x11_start_program("xterm -e \"killall -9 evolution; find ~ -name evolution | xargs rm -rf;\"", valid => 0);
x11_start_program('evolution', target_match => [qw(evolution-default-client-ask test-evolution-1 evolution-welcome-not_focused)]);

# Follow the wizard to setup mail account.
if (match_has_tag 'evolution-default-client-ask') {
assert_and_click "evolution-default-client-agree";
assert_screen "test-evolution-1";
}
elsif (match_has_tag "evolution-welcome-not_focused") {
assert_and_click "evolution-welcome-not_focused";
}
send_key "super-up";
assert_and_click("evolution_welcome-max-window-click");

# restore from backup file and click next.
assert_and_click("evolution_wizard-restore-backup-click");
assert_and_click("evolution_wizard-restore-backup-file");
assert_screen 'evolution_choose_backupfile_torestore';
assert_and_click 'evolution-home-directory';
assert_and_click 'evolution-select-backupfile', dclick => 1;
assert_and_click 'evolution_restore_backup_next';
}

sub evolution_add_self_signed_ca {
my ($self, $account) = @_;
# add self-signed CA with internal account
Expand Down
2 changes: 1 addition & 1 deletion schedule/functional/gnome.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ conditional_schedule:
- x11/oomath
- x11/oocalc
- x11/gnome_music
- x11/evolution
- x11/evolution/evolution_smoke
- x11/inkscape
- x11/gimp
- x11/hexchat
Expand Down
50 changes: 28 additions & 22 deletions tests/x11/evolution/evolution_smoke.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,49 @@ use base "x11test";
use testapi;
use utils;
use version_utils qw(is_sle is_tumbleweed);
use x11utils;
use serial_terminal 'select_serial_terminal';

sub run {
my $self = shift;
my $mail_box = '[email protected]';
my $mail_passwd = 'hkiworexcmmeqmzt';

select_serial_terminal;
assert_script_run('curl -v -o /home/bernhard/evolution-backup.tar.gz ' . data_url('evolution/evolution-backup.tar.gz'), 180);

select_console 'x11';

mouse_hide(1);
x11_start_program('xterm -e "gsettings set org.gnome.desktop.session idle-delay 0"', valid => 0);
$self->start_evolution($mail_box);

if (check_screen "evolution_mail-auth", 5) {
send_key "alt-a"; #disable keyring option, in SP2 or tumbleweed
send_key "alt-p";
type_string "$mail_passwd";
send_key "ret";
}
send_key "super-up" if (check_screen "evolution_mail-init-window", 2);
assert_screen ['evolution_mail-auth', 'evolution_mail-max-window'];
assert_screen "generic-desktop";

$self->start_evolution_from_backupfile($mail_box);
assert_screen('evolution_mail-auth', 200);
if (match_has_tag "evolution_mail-auth") {
send_key "alt-a"; #disable keyring option
send_key "alt-p";
type_password $mail_passwd;
type_string "$mail_passwd";
send_key "ret";
assert_screen "evolution_mail-max-window";
}

# Help
hold_key "alt-h";
wait_still_screen(2);
release_key "alt-h";
send_key "a";
assert_screen "evolution_about";
send_key "esc";
wait_still_screen(2);

assert_screen('evolution_mail-init-window', 120);
send_key "super-up" if (match_has_tag "evolution_mail-init-window");
wait_still_screen(2, 2);
assert_and_click("evolution_click_inbox");
wait_still_screen(2, 2);
assert_and_click 'evolution-select-email', dclick => 1;
wait_still_screen(2, 2);
assert_screen("evolution_inbox_email");
wait_still_screen(2, 2);
assert_and_click("evolution_open_inbox_mail");
wait_still_screen(2, 2);
send_key "ret";
wait_still_screen(2, 2);
assert_and_click("evolution_read_test_message");
# Exit
send_key "ctrl-w";
send_key "ctrl-q";
assert_screen "generic-desktop";
}

1;

0 comments on commit 7227095

Please sign in to comment.