From 74792b35a83a863fa5e68c37f0c0f552f0c21a7b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 22 Apr 2022 10:54:42 +0200 Subject: [PATCH] Bug 28786: Fix 2FA selenium tests Looks like there was a bad rebase at some point. Signed-off-by: Martin Renvoize --- t/db_dependent/selenium/authentication_2fa.t | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/selenium/authentication_2fa.t b/t/db_dependent/selenium/authentication_2fa.t index ebc0c7f991..8e14a185f8 100755 --- a/t/db_dependent/selenium/authentication_2fa.t +++ b/t/db_dependent/selenium/authentication_2fa.t @@ -85,7 +85,7 @@ SKIP: { }; subtest 'Login' => sub { - plan tests => 19; + plan tests => 18; my $mainpage = $s->base_url . q|mainpage.pl|; @@ -115,8 +115,7 @@ SKIP: { is( login_error($s), undef ); $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys('wrong_code'); $driver->find_element('//input[@type="submit"]')->click; - ok($driver->find_element('//div[@class="dialog error"][contains(text(), "Invalid two-factor code")]')); - is( login_error($s), undef ); + is( login_error($s), "Invalid two-factor code" ); $driver->get($mainpage); like( $driver->get_title, qr(Two-factor authentication), 'Must still be on the second auth screen' ); @@ -137,7 +136,7 @@ SKIP: { is( login_error($s), undef ); $driver->find_element('//form[@id="loginform"]//input[@id="otp_token"]')->send_keys('wrong_code'); $driver->find_element('//input[@type="submit"]')->click; - ok($driver->find_element('//div[@class="dialog error"][contains(text(), "Invalid two-factor code")]')); + is( login_error($s), "Invalid two-factor code" ); my $auth = Koha::Auth::TwoFactorAuth->new({patron => $patron}); my $code = $auth->code(); -- 2.20.1