Bugzilla – Attachment 143998 Details for
Bug 32242
The job has not been sent to the message broker: (Wide character in syswrite ... )
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32242: Add selenium tests
Bug-32242-Add-selenium-tests.patch (text/plain), 3.45 KB, created by
Jonathan Druart
on 2022-11-17 13:34:09 UTC
(
hide
)
Description:
Bug 32242: Add selenium tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-11-17 13:34:09 UTC
Size:
3.45 KB
patch
obsolete
>From 628c5207ba59c582cb47cba39a680802ac27eeb7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 17 Nov 2022 14:32:49 +0100 >Subject: [PATCH] Bug 32242: Add selenium tests > >This is not testing the thing at the correct level, but at least we test >the whole workflow. >--- > .../selenium/batch_item_modification.t | 87 +++++++++++++++++++ > 1 file changed, 87 insertions(+) > create mode 100755 t/db_dependent/selenium/batch_item_modification.t > >diff --git a/t/db_dependent/selenium/batch_item_modification.t b/t/db_dependent/selenium/batch_item_modification.t >new file mode 100755 >index 00000000000..acb5cac3eb9 >--- /dev/null >+++ b/t/db_dependent/selenium/batch_item_modification.t >@@ -0,0 +1,87 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use C4::Context; >+use Koha::BackgroundJobs; >+ >+use Test::More tests => 2; >+ >+use t::lib::Selenium; >+use t::lib::TestBuilder; >+use utf8; >+ >+my $builder = t::lib::TestBuilder->new; >+ >+my $login = $ENV{KOHA_USER} || 'koha'; >+ >+my @cleanup; >+ >+SKIP: { >+ eval { require Selenium::Remote::Driver; }; >+ skip "Selenium::Remote::Driver is needed for selenium tests.", 2 if $@; >+ >+ my $s = t::lib::Selenium->new; >+ my $driver = $s->driver; >+ $driver->set_window_size(3840,1080); >+ my $mainpage = $s->base_url . q|mainpage.pl|; >+ $driver->get($mainpage); >+ like( $driver->get_title(), qr(Log in to Koha), ); >+ $s->auth; >+ >+ subtest 'test encoding sent to the broker' => sub { >+ my $item = $builder->build_sample_item; >+ >+ # Navigate to the batch item mod tool >+ $s->click( >+ { href => '/cataloguing/cataloging-home.pl', main => 'container-main' } >+ ); >+ $s->click( >+ { href => 'tools/batchMod.pl', main_class => 'main container-fluid' } ); >+ $driver->find_element('//textarea[@id="barcodelist"]')->send_keys($item->barcode); >+ $s->submit_form; >+ my $itemnotes = q{â ⤠â}; >+ $driver->find_element('//input[@name="items.itemnotes"]') >+ ->send_keys($itemnotes); >+ $s->submit_form; >+ >+ my $view_detail_link = $driver->find_element('//a[contains(@href, "/cgi-bin/koha/admin/background_jobs.pl?op=view&id=")]'); >+ my $href = $view_detail_link->get_attribute('href'); >+ my $job_id; >+ if ( $href =~ m{id=(\d+)} ) { >+ $job_id = $1; >+ } >+ my $job = Koha::BackgroundJobs->find($job_id); >+ my $i; >+ while ( $job->discard_changes->status ne 'finished' ) { >+ sleep(1); >+ last if ++$i > 10; >+ } >+ is ( $job->status, 'finished', 'job is finished' ); >+ >+ is( Koha::Items->find($item->itemnumber)->itemnotes, $itemnotes ); >+ >+ push @cleanup, $item, $item->biblio; >+ }; >+ >+ $driver->quit(); >+} >+ >+END { >+ $_->delete for @cleanup; >+}; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32242
:
143986
|
143987
|
143994
|
143998
|
144016
|
144017
|
144772