From d806b5608ecc4537c0dc8f65569c802bd9dbd89a Mon Sep 17 00:00:00 2001 From: Victor Grousset/tuxayo Date: Tue, 6 Jul 2021 16:07:05 +0200 Subject: [PATCH] Bug 28647: Selenium lib: make error handler fail gracefully Quitting the driver makes all the next use of Selenium in the file fail. And go to te error handler where it fails again and goes to the error handler. Now it just fails the current test and continues. I don't know how this wasn't an issue in the previous work on the test suite. --- t/lib/Selenium.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm index 35d2c04fc3..fc63994359 100644 --- a/t/lib/Selenium.pm +++ b/t/lib/Selenium.pm @@ -20,6 +20,7 @@ use Modern::Perl; use Carp qw( croak ); use JSON qw( from_json ); use File::Slurp qw( write_file ); +use Test::More; use C4::Context; @@ -65,8 +66,8 @@ sub add_error_handler { } print STDERR "\n"; $self->capture( $driver ); - $driver->quit(); - croak $selenium_error; + fail(); + croak $selenium_error; # tells which element wasn't found for example } ); } -- 2.32.0