Skip to content
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
3 changes: 1 addition & 2 deletions qa/t/2_test_flags.t
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@ $sel->title_like(qr/^$bug1_id /);
# 1. going back does not keep panels expanded
# 2. to get the requestee field to display for the addl flags,
# we have to set to X and then back to ? for each one.
$sel->click_ok('action-menu-btn', 'Expand action menu');
$sel->click_ok('action-expand-all', 'Expand all modal panels');
expand_all_modules($sel);
$sel->select_ok("flag_type-$flagtype1_id", "value=X");
$sel->select_ok("flag_type-$flagtype1_id", "label=?");
$sel->type_ok("requestee_type-$flagtype1_id", $config->{admin_user_login});
Expand Down
3 changes: 1 addition & 2 deletions qa/t/4_test_user_privs.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ $sel->click_ok("log_in", undef, "Submit credentials");
$sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_like(qr/^$bug1_id/, "Display bug $bug1_id");
$sel->click_ok('mode-btn-readonly', 'Click Edit Bug');
$sel->click_ok('action-menu-btn', 'Expand action menu');
$sel->click_ok('action-expand-all', 'Expand all modal panels');
expand_all_modules($sel);

# The assigned_to field must not exist.
# But the 'Commit' button does exist.
Expand Down
28 changes: 26 additions & 2 deletions qa/t/lib/QA/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ use base qw(Exporter);
edit_bug_and_return
get_config
go_to_bug
expand_all_modules
go_to_home
go_to_admin
edit_product
Expand Down Expand Up @@ -296,14 +297,37 @@ sub go_to_bug {
$sel->title_like(qr/^$bug_id /, $bug_title);
sleep(1); # FIXME: Sometimes we try to click edit bug before it is ready so wait a second
$sel->click_ok('mode-btn-readonly', 'Click Edit Bug') if !$no_edit;
$sel->click_ok('action-menu-btn', 'Expand action menu');
$sel->click_ok('action-expand-all', 'Expand all modal panels');
expand_all_modules($sel);

# Remove the blue New Changes link because the sticky banner causes a click interception issue in
# Selenium that cannot be reproduced in real browser environments
$sel->driver->execute_script('document.querySelector(\'.new-changes-link\')?.remove();');
}

# Expand all bug modal panels via the action menu and wait for the slide
# animation to finish.
sub expand_all_modules {
my ($sel) = @_;

$sel->click_ok('action-menu-btn', 'Expand action menu');
$sel->click_ok('action-expand-all', 'Expand all modal panels');

# Expanding uses a jQuery slide animation that sets overflow:hidden on the
# module content until it finishes. WebDriver treats the clipped fields as
# not displayed (get_text returns ''), so wait for the animation to end.
my $animating;
for (0 .. 50) {
$animating = $sel->driver->execute_script(
'return window.jQuery ? jQuery(":animated").length : 0');
last unless $animating;
select(undef, undef, undef, 0.1) if $_ < 50;
}
if ($animating) {
ok(0, 'Module expand animation finished within 5s');
diag("$animating element(s) still animating; later get_text calls may return ''");
}
}

# Go to admin.cgi.
sub go_to_admin {
my $sel = shift;
Expand Down
Loading