From 4405083a42fce37aad6de51e24c9ef65513d4001 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 10 Sep 2020 10:07:05 +0200 Subject: [PATCH] Bug 23816: Fix selenium tests --- t/db_dependent/selenium/authentication.t | 4 ++-- t/db_dependent/selenium/regressions.t | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/selenium/authentication.t b/t/db_dependent/selenium/authentication.t index 9ea90e3d8c..591fb09d07 100644 --- a/t/db_dependent/selenium/authentication.t +++ b/t/db_dependent/selenium/authentication.t @@ -47,8 +47,8 @@ SKIP: { $driver->get($mainpage); like( $driver->get_title, qr(Log in to Koha), 'Hitting the main page should redirect to the login form'); - my $password = Koha::AuthUtils::generate_password(); my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }}); + my $password = Koha::AuthUtils::generate_password($patron->category); t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); $patron->set_password({ password => $password }); @@ -81,8 +81,8 @@ SKIP: { $driver->get($mainpage); like( $driver->get_title, qr(Koha online catalog), 'Hitting the main page should not redirect to the login form'); - my $password = Koha::AuthUtils::generate_password(); my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }}); + my $password = Koha::AuthUtils::generate_password($patron->category); t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); $patron->set_password({ password => $password }); diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index 45517a5a45..98fcf091e5 100644 --- a/t/db_dependent/selenium/regressions.t +++ b/t/db_dependent/selenium/regressions.t @@ -54,7 +54,7 @@ subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 1 } } ); - my $password = Koha::AuthUtils::generate_password(); + my $password = Koha::AuthUtils::generate_password($patron->category); t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); $patron->set_password({ password => $password }); $s->opac_auth( $patron->userid, $password ); @@ -205,7 +205,7 @@ subtest 'XSS vulnerabilities in pagination' => sub { ); } - my $password = Koha::AuthUtils::generate_password(); + my $password = Koha::AuthUtils::generate_password($patron->category); t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); $patron->set_password({ password => $password }); $s->opac_auth( $patron->userid, $password ); -- 2.20.1