From ffcfcd5ea96683d687effd23ee8a16cf3555c2df Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 15 Mar 2019 21:11:57 -0300 Subject: [PATCH] Bug 22077: Make sure there were not JS errors on running selenium tests We could move that code to t::lib::Selenium and add the subtest to all our selenium/*.t files --- t/db_dependent/selenium/authentication.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/selenium/authentication.t b/t/db_dependent/selenium/authentication.t index b3738a561d..64f4ac3fb5 100644 --- a/t/db_dependent/selenium/authentication.t +++ b/t/db_dependent/selenium/authentication.t @@ -23,7 +23,7 @@ #Note: If you are testing this on kohadevbox with selenium installed in kohadevbox then you need to set the staffClientBaseURL to localhost:8080 and the OPACBaseURL to localhost:80 use Modern::Perl; -use Test::More tests => 2; +use Test::More tests => 3; use C4::Context; use Koha::AuthUtils; @@ -126,6 +126,14 @@ SKIP: { push @data_to_cleanup, $patron, $patron->category, $patron->library; }; + subtest 'No JS errors' => sub { + plan tests => 1; + my @logs = + grep { $_->{level} !~ m{^DEBUG|INFO|WARNING$} } + @{$driver->get_log('browser')}; + is( scalar(@logs), 0, ) or diag( Data::Dumper::Dumper \@logs); + }; + $driver->quit(); }; -- 2.11.0