From 4ce645a17063baa9a50b3281d5cb5ea807cb9ddf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 7 Jul 2025 13:32:11 +0200 Subject: [PATCH] Bug 40316: Remove warnings from selenium/regressions.t Wide character in print at /usr/share/perl/5.36/Test2/Formatter/TAP.pm line 156. Test plan: Confirm that % prove t/db_dependent/selenium/regressions.t still passes and does not generate warnings Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass (cherry picked from commit 5f44a5ef5a9471aa4387f50e394ca0786e4aa779) Signed-off-by: Paul Derscheid (cherry picked from commit fc9647c5ac19c8c702a899548b443b3d9f81b541) Signed-off-by: Fridolin Somers --- t/db_dependent/selenium/regressions.t | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index 6c7fed8b0e..0dabd96dbf 100755 --- a/t/db_dependent/selenium/regressions.t +++ b/t/db_dependent/selenium/regressions.t @@ -17,11 +17,13 @@ use Modern::Perl; use utf8; +use Encode qw(encode_utf8); use C4::Context; use Test::More; use Test::MockModule; +use Test::NoWarnings; use C4::Context; use C4::Biblio qw( AddBiblio ); @@ -36,7 +38,7 @@ eval { require Selenium::Remote::Driver; }; if ( $@ ) { plan skip_all => "Selenium::Remote::Driver is needed for selenium tests."; } else { - plan tests => 9; + plan tests => 10; } my $s = t::lib::Selenium->new; @@ -345,7 +347,9 @@ subtest 'Encoding in session variables' => sub { is( $driver->find_element( '//span[@class="logged-in-branch-name"]')->get_text(), $branchname, - sprintf( "logged-in-branch-name set - SessionStorage=%s, branchname=%s", $SessionStorage, $branchname + sprintf( + "logged-in-branch-name set - SessionStorage=%s, branchname=%s", $SessionStorage, + encode_utf8($branchname) ) ); @@ -364,7 +368,10 @@ subtest 'Encoding in session variables' => sub { is( $td_checked_out_from->get_text(), $branchname, - sprintf( "'Checked out from' column should contain the branchname - SessionStorage=%s, branchname=%s", $SessionStorage, $branchname ) + sprintf( + "'Checked out from' column should contain the branchname - SessionStorage=%s, branchname=%s", + $SessionStorage, encode_utf8($branchname) + ) ); # Remove the check in