From d98c018b6a1063f4d027795cafc20422336484eb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 27 Oct 2021 14:31:12 +0200 Subject: [PATCH] Bug 19185: Make sure user is logged in before adding records to the cart --- t/db_dependent/selenium/remove_from_cart.t | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/db_dependent/selenium/remove_from_cart.t b/t/db_dependent/selenium/remove_from_cart.t index 02ce186b399..71c8f936769 100755 --- a/t/db_dependent/selenium/remove_from_cart.t +++ b/t/db_dependent/selenium/remove_from_cart.t @@ -71,6 +71,14 @@ subtest 'OPAC - Remove from cart' => sub { my $batch_id = $mock_zebra->load_records($file); + my $patron = $builder->build_object( + { class => 'Koha::Patrons', value => { flags => 1 } } ); + 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 ); + # We need to prevent scrolling to prevent the floating toolbar from overlapping buttons we are testing my $window_size = $driver->get_window_size(); $driver->set_window_size(1920,10800); -- 2.25.1