Bugzilla – Attachment 90241 Details for
Bug 22898
Selenium tests for placing holds from the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22898: [v18.11.05] Add selenium tests placing holds (staff)
Bug-22898-v181105-Add-selenium-tests-placing-holds.patch (text/plain), 4.30 KB, created by
Jonathan Druart
on 2019-05-31 17:23:44 UTC
(
hide
)
Description:
Bug 22898: [v18.11.05] Add selenium tests placing holds (staff)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-05-31 17:23:44 UTC
Size:
4.30 KB
patch
obsolete
>From b224bd2491e4f4cac31d4abeae42e9f52999d0f7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 13 May 2019 11:31:14 -0500 >Subject: [PATCH] Bug 22898: [v18.11.05] Add selenium tests placing holds > (staff) > >Quick selenium tests to prevent regressions like bug 22895. > >Test plan: >Make sure the selenium tests return green > >You can also test the buggy branch: >% git checkout v18.11.05 >% prove t/db_dependent/selenium/basic_workflow.t >=> Failure >% git bz apply 22895. >% prove t/db_dependent/selenium/basic_workflow.t >=> Success >--- > t/db_dependent/selenium/basic_workflow.t | 46 +++++++++++++++++++++++++++++--- > 1 file changed, 43 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t >index 9e9341f103..de5c8b26cd 100644 >--- a/t/db_dependent/selenium/basic_workflow.t >+++ b/t/db_dependent/selenium/basic_workflow.t >@@ -38,7 +38,9 @@ use Time::HiRes qw(gettimeofday); > use C4::Context; > use C4::Biblio qw( AddBiblio ); # We shouldn't use it > >-use Test::More tests => 20; >+use Koha::CirculationRules; >+ >+use Test::More tests => 22; > use MARC::Record; > use MARC::Field; > >@@ -75,13 +77,16 @@ our $sample_data = { > issuelength => '5', > lengthunit => 'days', > renewalperiod => '5', >+ reservesallowed => '5', >+ onshelfholds => '1', >+ opacitemholds => 'Y', > }, > }; > our ( $borrowernumber, $start, $prev_time, $cleanup_needed ); > > SKIP: { > eval { require Selenium::Remote::Driver; }; >- skip "Selenium::Remote::Driver is needed for selenium tests.", 20 if $@; >+ skip "Selenium::Remote::Driver is needed for selenium tests.", 22 if $@; > > $cleanup_needed = 1; > >@@ -147,7 +152,29 @@ SKIP: { > $dbh->do(q|INSERT INTO itemtypes (itemtype, description, rentalcharge, notforloan) VALUES (?, ?, ?, ?)|, undef, $itemtype->{itemtype}, $itemtype->{description}, $itemtype->{rentalcharge}, $itemtype->{notforloan}); > > my $issuing_rules = $sample_data->{issuingrule}; >- $dbh->do(q|INSERT INTO issuingrules (categorycode, itemtype, branchcode, maxissueqty, issuelength, lengthunit, renewalperiod) VALUES (?, ?, ?, ?, ?, ?, ?)|, undef, $issuing_rules->{categorycode}, $issuing_rules->{itemtype}, $issuing_rules->{branchcode}, $issuing_rules->{maxissueqty}, $issuing_rules->{issuelength}, $issuing_rules->{lengthunit}, $issuing_rules->{renewalperiod}); >+ $dbh->do( >+ q|INSERT INTO issuingrules (categorycode, itemtype, branchcode, issuelength, lengthunit, renewalperiod, reservesallowed, onshelfholds, opacitemholds) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)|, >+ undef, >+ $issuing_rules->{categorycode}, >+ $issuing_rules->{itemtype}, >+ $issuing_rules->{branchcode}, >+ $issuing_rules->{issuelength}, >+ $issuing_rules->{lengthunit}, >+ $issuing_rules->{renewalperiod}, >+ $issuing_rules->{reservesallowed}, >+ $issuing_rules->{onshelfholds}, >+ $issuing_rules->{opacitemholds}, >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $issuing_rules->{categorycode}, >+ itemtype => $issuing_rules->{itemtype}, >+ branchcode => $issuing_rules->{branchcode}, >+ rules => { >+ maxissueqty => $issuing_rules->{maxissueqty} >+ } >+ } >+ ); > > for my $biblionumber ( @biblionumbers ) { > $driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber"); >@@ -211,6 +238,19 @@ SKIP: { > > time_diff("checkin"); > >+ #Place holds >+ $driver->get($base_url."/reserve/request.pl?borrowernumber=$borrowernumber&biblionumber=".$biblionumbers[0]); >+ $driver->find_element('//form[@id="hold-request-form"]//input[@type="submit"]')->click; # Biblio level >+ my $patron = Koha::Patrons->find($borrowernumber); >+ is( $patron->holds->count, 1, ); >+ >+ $driver->get($base_url."/reserve/request.pl?borrowernumber=$borrowernumber&biblionumber=".$biblionumbers[1]); >+ $driver->find_element('//form[@id="hold-request-form"]//input[@type="radio"]')->click; # Item level, there is only 1 item per bib so we are safe >+ $driver->find_element('//form[@id="hold-request-form"]//input[@type="submit"]')->click; >+ is( $patron->holds->count, 2, ); >+ >+ time_diff("holds"); >+ > close $fh; > $driver->quit(); > }; >-- >2.11.0
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 22898
:
89673
|
90208
|
90241
|
97655
|
97656
|
98877
|
98878
|
98879
|
98880
|
98881
|
98882