Skip to content

Commit

Permalink
Merge pull request #10403 from dzedro/evolution
Browse files Browse the repository at this point in the history
Evolution fix and speedup
  • Loading branch information
dzedro committed May 31, 2020
2 parents 5d7a916 + ccb060a commit 131f3de
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 192 deletions.
214 changes: 94 additions & 120 deletions lib/x11test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,11 @@ sub check_new_mail_evolution {
my $config = $self->getconfig_emailaccount;
my $mail_passwd = $config->{$i}->{passwd};
assert_screen "evolution_mail-online", 240;
assert_and_click "evolution-send-receive";
if (check_screen "evolution_mail-auth", 30) {
send_key 'f12';
wait_still_screen(2);
assert_and_click('evolution_mail-auth-unfocused') if check_screen('evolution_mail-auth-unfocused', 2);
assert_screen ['evolution_mail-auth', 'evolution_mail-max-window'];
if (match_has_tag "evolution_mail-auth") {
send_key "alt-a"; #disable keyring option
send_key "alt-p";
type_password $mail_passwd;
Expand All @@ -259,30 +262,23 @@ sub check_new_mail_evolution {
}
send_key "alt-w";
send_key "ret";
wait_still_screen 3;
send_key_until_needlematch "evolution_mail_show-all", "down", 5, 3;
wait_still_screen 2;
send_key_until_needlematch "evolution_mail_show-all", "down", 5, 1;
send_key "ret";
wait_still_screen(2);
send_key "alt-n";
send_key "ret";
send_key_until_needlematch "evolution_mail_show-allcount", "down", 5, 3;
send_key_until_needlematch "evolution_mail_show-allcount", "down", 5, 1;
send_key "ret";
send_key "alt-c";
type_string "$mail_search";
wait_still_screen(2);
send_key "ret";
assert_and_click "evolution_meeting-view-new";
send_key "ret";
assert_screen "evolution_mail_open_mail";
send_key "ctrl-w"; # close the mail
save_screenshot();

# Delete the message and expunge the deleted item if not used POP3
if ($protocol != "POP") {
send_key "ctrl-e";
if (check_screen "evolution_mail-expunge", 30) {
send_key "alt-e";
}
assert_screen "evolution_mail-ready";
}
}

# get a random string with followed by date, it used in evolution case to get a unique email title.
Expand Down Expand Up @@ -314,15 +310,26 @@ sub send_meeting_request {
send_key "ctrl-s";
assert_screen "evolution_mail-sendinvite_meeting", 60;
send_key "ret";
if (check_screen "evolution_mail-auth", 30) {
wait_still_screen(2, 2);
assert_screen 'evolution_mail-auth';
send_key "alt-a"; #disable keyring option
send_key "alt-p";
type_password $mail_passwd;
wait_still_screen(2, 2);
send_key "ret";
if (check_screen "evolution_mail-compse_meeting", 5) {
send_key "ctrl-w";
}
wait_still_screen(2);
send_key 'f12';
if (check_screen 'evolution_mail-auth', 3) {
assert_and_click('evolution_mail-auth-unfocused') if check_screen('evolution_mail-auth-unfocused', 5);
send_key "alt-a"; #disable keyring option
send_key "alt-p";
type_password $mail_passwd;
wait_still_screen(2, 2);
send_key "ret";
}
if (check_screen "evolution_mail-compse_meeting", 30) {
send_key "ctrl-w";
}
assert_screen [qw(evolution_mail-save_meeting_dialog evolution_mail-send_meeting_dialog evolution_mail-meeting_error_handle evolution_mail-max-window)];
if (match_has_tag "evolution_mail-save_meeting_dialog") {
send_key "ret";
Expand Down Expand Up @@ -373,17 +380,32 @@ sub start_evolution {
send_key "alt-e";
wait_still_screen(2);
type_string "SUSE Test";
wait_still_screen(2, 2);
# Move to "Email Address" field and fill it.
assert_screen_change {
send_key "alt-a";
};
assert_screen_change {
type_string "$mail_box";
};
send_key "alt-a";
type_string_slow "$mail_box";
wait_still_screen(2, 2);
save_screenshot();

# Finish wizard.
assert_and_click('evolution_wizard-identity-next');
send_key 'alt-n';
if ($mail_box eq 'nooops_test3@aim.com') {
assert_screen [qw(evolution_wizard-account-summary evolution_wizard-receiving)];
if (match_has_tag 'evolution_wizard-account-summary') {
record_info 'found', "$mail_box details resolved";
assert_and_click "evolution-option-next";
assert_screen 'evolution_wizard-done';
send_key 'alt-a';
wait_still_screen(1);
send_key 'alt-n';
}
else {
record_soft_failure 'poo#67408';
send_key 'alt-c';
}
}
else {
assert_screen 'evolution_wizard-receiving';
}
wait_still_screen(2);
}

sub evolution_add_self_signed_ca {
Expand All @@ -394,11 +416,12 @@ sub evolution_add_self_signed_ca {
assert_screen 'evolution_mail_meeting_trust_ca';
send_key 'alt-a';
assert_and_click 'evolution_wizard-receiving';
wait_screen_change { send_key $self->{next} }; # select "Next" key
send_key 'ret'; # Go to next page (previous key just selected the key)
send_key $cmd{next}; # select "Next" key
wait_still_screen(2);
send_key 'ret'; # Go to next page (previous key just selected the key)
}
else {
send_key $self->{next};
send_key $cmd{next};
}
}

Expand All @@ -416,47 +439,30 @@ sub setup_mail_account {
my $mail_recvport = $config->{$account}->{$port_key};

$self->start_evolution($mail_box);
if (check_screen "evolution_wizard-skip-lookup", 30) {
send_key "alt-s";
}

# Reach "Receiving Email" step.
assert_screen "evolution_wizard-receiving";
# Open Server Type screen.
wait_screen_change {
send_key "alt-t";
};
send_key "ret";
send_key_until_needlematch "evolution_wizard-receiving-$proto", "down", 10, 3;
assert_and_click("evolution_wizard-receiving-$proto");
wait_screen_change {
send_key "alt-s";
};
send_key "alt-t";
wait_still_screen(1);
send_key_until_needlematch "evolution_wizard-receiving-$proto", "down", 10, 1;
send_key "alt-s";
wait_still_screen(1);
type_string "$mail_recvServer";
if ($proto eq 'pop') {
#No need set receive port with POP
}
elsif ($proto eq 'imap') {
wait_screen_change {
send_key "alt-p";
};
send_key "alt-p";
wait_still_screen(2, 2);
type_string "$mail_recvport";
}
else {
die "Unsupported protocol: $proto";
}
wait_screen_change {
send_key "alt-n";
};
send_key "alt-n";
wait_still_screen(1);
type_string "$mail_user";
wait_screen_change {
send_key "alt-m";
};
send_key "ret";
send_key_until_needlematch "evolution_wizard-receiving-ssl", "down", 5, 3;
wait_screen_change {
send_key "ret";
};
send_key "alt-m";
wait_still_screen(1);
send_key_until_needlematch "evolution_wizard-receiving-ssl", "down", 5, 1;
$self->evolution_add_self_signed_ca($account);
assert_screen [qw(evolution_wizard-receiving-opts evolution_wizard-receiving-not-focused)];
if (match_has_tag 'evolution_wizard-receiving-not-focused') {
Expand All @@ -476,65 +482,35 @@ sub setup_mail_account {
assert_screen "evolution_wizard-sending";
send_key "alt-t";
wait_still_screen(2);
send_key "ret";
save_screenshot;
send_key_until_needlematch "evolution_wizard-sending-smtp", "down", 5, 3;
wait_screen_change {
send_key "ret";
};
wait_screen_change {
send_key "alt-s";
};
send_key "home";
wait_still_screen(2);
send_key_until_needlematch "evolution_wizard-sending-smtp", "down", 5, 1;
send_key "alt-s";
type_string "$mail_sendServer";
wait_screen_change {
send_key "alt-p";
};
wait_still_screen(2, 2);
send_key "alt-p";
type_string "$mail_sendport";
wait_screen_change {
send_key "alt-v";
};
wait_screen_change {
send_key "alt-m";
};
send_key "ret";

wait_still_screen(2);
send_key "alt-v";
wait_still_screen(2);
send_key "alt-m";
wait_still_screen(2);
send_key "home";
#change to use mail-server and SSL
assert_and_click "evolution_SSL_wizard-sending-starttls";

#On TW, need change port manually:
if (is_tumbleweed) {
wait_screen_change {
send_key "alt-p";
};
type_string "465";
}

send_key_until_needlematch "evolution_SSL_wizard-sending-starttls", "down", 5, 1;
assert_and_click "evolution_wizard-sending-setauthtype";
assert_and_click "evolution_wizard-sending-setauthtype_login";
wait_screen_change { send_key 'alt-n' };
type_string "$mail_user";
assert_and_click("evolution_wizard-sending_username_filled");
assert_screen "evolution_wizard-account-summary";
send_key $self->{next};
send_key $cmd{next};
send_key "alt-n";
send_key "ret";
assert_screen "evolution_wizard-done";
send_key "alt-a";
if (check_screen "evolution_mail-auth", 30) {
if (is_sle('15+')) {
send_key "alt-a"; #disable keyring option
}
else {
assert_and_click("disable_keyring_option");
}
send_key "alt-p";
type_password $mail_passwd;
send_key "ret";
}
if (check_screen "evolution_mail-init-window", 30) {
send_key "super-up";
}
if (check_screen "evolution_mail-auth", 30) {
wait_still_screen(2);
if (check_screen "evolution_mail-auth", 5) {
if (is_sle('15+')) {
send_key "alt-a"; #disable keyring option
}
Expand All @@ -545,7 +521,8 @@ sub setup_mail_account {
type_password $mail_passwd;
send_key "ret";
}
assert_screen "evolution_mail-max-window";
# Μake sure the welcome window is maximized
send_key_until_needlematch 'evolution_mail-max-window', 'super-up', 3, 3;
}

# start clean firefox with one suse.com tab, visit pages which trigger pop-up so they will not pop again
Expand Down Expand Up @@ -805,6 +782,7 @@ sub setup_evolution_for_ews {
send_key "alt-a";
};
type_string "$mailbox";
wait_still_screen(2, 2);
save_screenshot();

send_key "alt-o";
Expand All @@ -814,9 +792,8 @@ sub setup_evolution_for_ews {
assert_screen 'evolution_wizard-receiving';
}

wait_screen_change {
send_key "alt-t";
};
send_key "alt-t";
wait_still_screen(1);
send_key "ret";
send_key_until_needlematch "evolution_wizard-receiving-ews", "up", 10, 3;
send_key "ret";
Expand Down Expand Up @@ -844,10 +821,6 @@ sub setup_evolution_for_ews {
assert_screen "evolution_mail-auth";
type_string "$mail_passwd";
send_key "ret";
if (check_screen "evolution_mail-init-window") {
send_key "super-up";
}
assert_screen "evolution_mail-max-window";

# Make all existing mails as read
assert_screen "evolution_mail-online", 60;
Expand All @@ -869,30 +842,31 @@ sub evolution_send_message {
my $mail_subject = $self->get_dated_random_string(4);

send_key "shift-ctrl-m";
if (check_screen "evolution_mail-auth", 30) {
if (check_screen "evolution_mail-auth", 5) {
send_key "alt-a"; #disable keyring option
send_key "alt-p";
type_string "$mail_passwd";
wait_still_screen(2, 2);
send_key "ret";
}
assert_screen "evolution_mail-compose-message";
assert_and_click "evolution_mail-message-to";
type_string "$mailbox";
wait_screen_change {
send_key "alt-u";
};
wait_still_screen;
wait_still_screen(2, 2);
send_key "alt-u";
wait_still_screen(1);
type_string "$mail_subject this is a test mail";
assert_and_click "evolution_mail-message-body";
type_string "Test email send and receive.";
send_key "ctrl-ret";
if (check_screen "evolution_mail_send_mail_dialog", 30) {
if (check_screen "evolution_mail_send_mail_dialog", 5) {
send_key "ret";
}
if (check_screen "evolution_mail-auth", 30) {
if (check_screen "evolution_mail-auth", 5) {
send_key "alt-a"; #disable keyring option
send_key "alt-p";
type_string "$mail_passwd";
wait_still_screen(2, 2);
send_key "ret";
}

Expand Down
4 changes: 2 additions & 2 deletions tests/x11/evolution/evolution_prepare_servers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ sub run() {
zypper_call("--gpg-auto-import-keys ref");
zypper_call("in dovecot", exitcode => [0, 102, 103]);
zypper_call("rr dovecot_repo");
save_screenshot;
} else {
if (is_opensuse) {
# exim is installed by default in openSUSE, but we need postfix
Expand Down Expand Up @@ -96,7 +95,8 @@ sub run() {
# create test users
assert_script_run "useradd -m admin";
assert_script_run "useradd -m nimda";
assert_script_run "echo -e 'admin:password123\nnimda:password123' | chpasswd";
assert_script_run "echo 'admin:password123' | chpasswd";
assert_script_run "echo 'nimda:password123' | chpasswd";

systemctl 'status dovecot';
systemctl 'status postfix';
Expand Down

0 comments on commit 131f3de

Please sign in to comment.