From 5eaf5b69d15a9469206b6cc1da64504be653631c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 12 Oct 2018 15:37:44 -0300 Subject: [PATCH] Bug 21479: Remove the trace if the node does not exist Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit be4f22f5a0745ef64c6bf20b89bd9f4fcbe40403) Signed-off-by: Martin Renvoize (cherry picked from commit ccb364a667745eadf52e76f894ec9dff2a15a060) Signed-off-by: Fridolin Somers --- t/db_dependent/selenium/regressions.t | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t index bffddc3713..8b085039e2 100644 --- a/t/db_dependent/selenium/regressions.t +++ b/t/db_dependent/selenium/regressions.t @@ -36,17 +36,13 @@ subtest 'OPAC - Remove from cart' => sub { $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'); + # 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 + my @basket_count_elts = $driver->find_elements('//span[@id="basketcount"]/span'); + is( scalar(@basket_count_elts), 0, 'Basket should be empty'); $driver->find_element('//a[@class="addtocart cart1"]')->click; - $basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span'); + my $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' ); -- 2.39.5