Skip to content

Commit

Permalink
Merge pull request #6040 from perlpunk/test-details-ajax
Browse files Browse the repository at this point in the history
t: Fix sporadic stale element failures in t/ui/18-tests-details.t
  • Loading branch information
mergify[bot] authored Oct 30, 2024
2 parents 5438d53 + c53c994 commit 26048c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/ui/18-tests-details.t
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ sub current_tab { $driver->find_element('.nav.nav-tabs .active')->get_text }
sub find_candidate_needles {
# ensure the candidates menu is visible
my $candidates_menu = wait_for_element(selector => '#candidatesMenu', is_displayed => 1) or return {};
return {} unless $candidates_menu->is_enabled;

# save implicit waiting time as long as we are only looking for elements
# that should be visible already
disable_timeout;
return {} unless $candidates_menu->is_enabled;
$candidates_menu->click;

# read the tags/needles from the HTML structure
Expand Down Expand Up @@ -609,6 +610,7 @@ sub test_with_error {
# check whether candidates are displayed as expected
my $random_number = int(rand(100000));
$driver->get("/tests/99946?prevent_caching=$random_number#step/yast2_lan/1");
wait_for_ajax(msg => 'step of yast2_lan test module loaded');
is_deeply(find_candidate_needles, $expect, $test_name // 'candidates displayed as expected');
}

Expand Down Expand Up @@ -643,6 +645,7 @@ subtest 'test candidate list' => sub {
\%expected_candidates, 'needles appear twice, each time under different tag');

$driver->get('/tests/99946#step/installer_timezone/1');
wait_for_ajax(msg => 'step of installer_timezone test module loaded');
my $clicks = 0;
wait_for_element(
selector => '#needlediff_selector .show-needle-info',
Expand Down

0 comments on commit 26048c5

Please sign in to comment.