From 97f88eab644628244205ac3bf493f4fafb7f8e9e Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 5 Oct 2026 14:27:46 -0400 Subject: [PATCH 1/4] Bug 2078352 - Selenium test 4_test_votes.t fails with Firefox ESR 153 because go_to_bug doesn't wait for the module expand animation --- qa/t/lib/QA/Util.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qa/t/lib/QA/Util.pm b/qa/t/lib/QA/Util.pm index 23a3f158df..6163d961e7 100644 --- a/qa/t/lib/QA/Util.pm +++ b/qa/t/lib/QA/Util.pm @@ -299,6 +299,16 @@ sub go_to_bug { $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. + for (1 .. 50) { + last + unless $sel->driver->execute_script( + 'return window.jQuery ? jQuery(":animated").length : 0'); + select(undef, undef, undef, 0.1); + } + # 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();'); From 48e541df9858d40e7e4820e5769d5f349334ce88 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 6 Oct 2026 15:16:40 -0400 Subject: [PATCH 2/4] Review fixes --- qa/t/lib/QA/Util.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qa/t/lib/QA/Util.pm b/qa/t/lib/QA/Util.pm index 6163d961e7..1e871144a5 100644 --- a/qa/t/lib/QA/Util.pm +++ b/qa/t/lib/QA/Util.pm @@ -302,12 +302,17 @@ sub go_to_bug { # 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 (1 .. 50) { - last - unless $sel->driver->execute_script( + $animating = $sel->driver->execute_script( 'return window.jQuery ? jQuery(":animated").length : 0'); + last unless $animating; select(undef, undef, undef, 0.1); } + if ($animating) { + ok(0, 'Module expand animation finished within 5s'); + diag("$animating element(s) still animating; later get_text calls may return ''"); + } # 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 From 313731718069918a334f1119abbde185602d240a Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 6 Oct 2026 16:13:38 -0400 Subject: [PATCH 3/4] Add expand_all_modules to more places --- qa/t/2_test_flags.t | 3 +-- qa/t/4_test_user_privs.t | 3 +-- qa/t/lib/QA/Util.pm | 19 ++++++++++++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/qa/t/2_test_flags.t b/qa/t/2_test_flags.t index 8938ddbb2a..bce5c40195 100644 --- a/qa/t/2_test_flags.t +++ b/qa/t/2_test_flags.t @@ -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}); diff --git a/qa/t/4_test_user_privs.t b/qa/t/4_test_user_privs.t index 646e60bbc8..28c2dd1095 100644 --- a/qa/t/4_test_user_privs.t +++ b/qa/t/4_test_user_privs.t @@ -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. diff --git a/qa/t/lib/QA/Util.pm b/qa/t/lib/QA/Util.pm index 1e871144a5..16cbe9d990 100644 --- a/qa/t/lib/QA/Util.pm +++ b/qa/t/lib/QA/Util.pm @@ -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 @@ -296,7 +297,19 @@ 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'); + 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 @@ -313,10 +326,6 @@ sub go_to_bug { ok(0, 'Module expand animation finished within 5s'); diag("$animating element(s) still animating; later get_text calls may return ''"); } - - # 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();'); } # Go to admin.cgi. From 5a15e5dcac6d575a4cfb479c296bd7a7d2bf0055 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 6 Oct 2026 16:15:50 -0400 Subject: [PATCH 4/4] Potential fix for pull request finding 'Final animation poll can report a false timeout' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- qa/t/lib/QA/Util.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/t/lib/QA/Util.pm b/qa/t/lib/QA/Util.pm index 16cbe9d990..19355c3b34 100644 --- a/qa/t/lib/QA/Util.pm +++ b/qa/t/lib/QA/Util.pm @@ -316,11 +316,11 @@ sub expand_all_modules { # 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 (1 .. 50) { + for (0 .. 50) { $animating = $sel->driver->execute_script( 'return window.jQuery ? jQuery(":animated").length : 0'); last unless $animating; - select(undef, undef, undef, 0.1); + select(undef, undef, undef, 0.1) if $_ < 50; } if ($animating) { ok(0, 'Module expand animation finished within 5s');