From 65edbe5af21b9bba154cf5d5120d83da43eee0c8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 24 Nov 2021 09:12:16 +0100 Subject: [PATCH] Bug 29485: (follow-up) Trying to prevent administration_tasks.t to fail randomly Recreated the problem after run #47 Error while executing command: no such element: Unable to locate element: //*[@id="userid"] at /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm line 411. With this patch I do not longer recreate the failure. It's ugly but, well, I don't have any other solutions. It seems that the accept_alert is taking too long and is async (??) Signed-off-by: Jonathan Druart --- t/db_dependent/selenium/administration_tasks.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/selenium/administration_tasks.t b/t/db_dependent/selenium/administration_tasks.t index f46bbad412..080400d2a3 100755 --- a/t/db_dependent/selenium/administration_tasks.t +++ b/t/db_dependent/selenium/administration_tasks.t @@ -181,14 +181,14 @@ SKIP: { } ); $s->driver->accept_alert; # Accept the modal "Are you sure you want to delete this authorized value?" + + # For an unknown reason the click on the next admin-home link does not work + # We were still on the authorised value list view. + # A workaround (and dirty fix) is to wait for 1 second and see if it fixes the problem + sleep 1; }; { # Patron categories - # For an unknown reason the click on the admin-home link does not work - # At this point we were still on the authorised value list view. - # A workaround (and dirty fix) is to logout/login and see if it fixes the problem - $driver->get( $mainpage . q|?logout.x=1| ); - $s->auth; $driver->get($mainpage); $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ); # Koha administration $s->click( { href => '/admin/categories.pl', main_class => 'main container-fluid' } ); # Patron categories -- 2.39.5