From 02af0fb944d4800e99374256d088e7a2185cd5d6 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 --- t/db_dependent/selenium/regressions.t | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index a55d9b2876b..790cda23831 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; @@ -354,7 +356,10 @@ 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) + ) ); $driver->find_element('//input[@id="barcode"]')->send_keys( $item->barcode ); @@ -372,7 +377,7 @@ subtest 'Encoding in session variables' => sub { $branchname, sprintf( "'Checked out from' column should contain the branchname - SessionStorage=%s, branchname=%s", - $SessionStorage, $branchname + $SessionStorage, encode_utf8($branchname) ) ); -- 2.34.1