Bugzilla – Attachment 80305 Details for
Bug 21479
Removing from cart removes 2 items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21479: Add regression tests
Bug-21479-Add-regression-tests.patch (text/plain), 2.67 KB, created by
Martin Renvoize (ashimema)
on 2018-10-09 18:20:45 UTC
(
hide
)
Description:
Bug 21479: Add regression tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-09 18:20:45 UTC
Size:
2.67 KB
patch
obsolete
>From 767e1303df4b6eadffe18aa1fd88fe60eab519e4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 9 Oct 2018 13:30:54 -0300 >Subject: [PATCH] Bug 21479: Add regression tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/selenium/regressions.t | 35 +++++++++++++++++++++++++-- > 1 file changed, 33 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t >index 5ea6d22bc3..fcef28b609 100644 >--- a/t/db_dependent/selenium/regressions.t >+++ b/t/db_dependent/selenium/regressions.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use C4::Context; > >-use Test::More tests => 1; >+use Test::More tests => 2; > > use Koha::AuthUtils; > use t::lib::Selenium; >@@ -31,7 +31,7 @@ skip "Selenium::Remote::Driver is needed for selenium tests.", 1 if $@; > my $s = t::lib::Selenium->new; > > my $driver = $s->driver; >-my $base_url = $s->base_url; >+my $opac_base_url = $s->opac_base_url; > my $builder = t::lib::TestBuilder->new; > > our @cleanup; >@@ -55,6 +55,37 @@ subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { > push @cleanup, $patron->library; > }; > >+subtest 'OPAC - Remove from cart' => sub { >+ plan tests => 4; >+ >+ $driver->get( $opac_base_url . "opac-search.pl?q=d" ); >+ >+ my $basket_count_elt; >+ eval { >+ # FIXME This will produce a STRACE >+ # A better way to do that would be to modify the way we display the basket count >+ # We should show/hide the count instead or recreate the node >+ $basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span') >+ }; >+ like($@, qr{An element could not be located on the page}, 'Basket should be empty'); >+ >+ $driver->find_element('//a[@class="addtocart cart1"]')->click; >+ $basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span'); >+ is( $basket_count_elt->get_text(), >+ 1, 'One element should have been added to the cart' ); >+ >+ $driver->find_element('//a[@class="addtocart cart3"]')->click; >+ $driver->find_element('//a[@class="addtocart cart5"]')->click; >+ $basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span'); >+ is( $basket_count_elt->get_text(), >+ 3, '3 elements should have been added to the cart' ); >+ >+ $driver->find_element('//a[@class="cartRemove cartR3"]')->click; >+ $basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span'); >+ is( $basket_count_elt->get_text(), >+ 2, '1 element should have been removed from the cart' ); >+}; >+ > END { > $_->delete for @cleanup; > }; >-- >2.19.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 21479
:
79852
|
79857
|
79893
|
79903
|
79950
|
80219
|
80291
|
80292
|
80304
| 80305 |
80557
|
80605
|
80625
|
80643