From 366ac0a7f3fd269709cfddfafd41981b16742209 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Thu, 23 Feb 2023 10:05:38 +0100
Subject: [PATCH] Bug 32926: Fix selenium tests

We should not rely on existing data, and we should remove data at the end.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
---
 t/db_dependent/selenium/system_preferences_search.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/db_dependent/selenium/system_preferences_search.t b/t/db_dependent/selenium/system_preferences_search.t
index 0bbff175304..70b8960fe80 100755
--- a/t/db_dependent/selenium/system_preferences_search.t
+++ b/t/db_dependent/selenium/system_preferences_search.t
@@ -40,12 +40,12 @@ my $base_url = $s->base_url;
 # Adjust the height and width of the generated screenshots
 #$driver->set_window_size( 2160, 991 ); # Height, then Width
 
-my $patron = $builder->build_object( { class => 'Koha::Patrons', value => { flags => 1, branchcode => 'CPL' } } );
+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 } );
 
-push @cleanup, $patron;
+push @cleanup, $patron, $patron->category, $patron->library;
 
 $s->auth( $patron->userid, $password );
 
-- 
2.25.1