Lines 60-76
subtest 'OPAC - Remove from cart' => sub {
Link Here
|
60 |
|
60 |
|
61 |
$driver->get( $opac_base_url . "opac-search.pl?q=d" ); |
61 |
$driver->get( $opac_base_url . "opac-search.pl?q=d" ); |
62 |
|
62 |
|
63 |
my $basket_count_elt; |
63 |
# A better way to do that would be to modify the way we display the basket count |
64 |
eval { |
64 |
# We should show/hide the count instead or recreate the node |
65 |
# FIXME This will produce a STRACE |
65 |
my @basket_count_elts = $driver->find_elements('//span[@id="basketcount"]/span'); |
66 |
# A better way to do that would be to modify the way we display the basket count |
66 |
is( scalar(@basket_count_elts), 0, 'Basket should be empty'); |
67 |
# We should show/hide the count instead or recreate the node |
|
|
68 |
$basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span') |
69 |
}; |
70 |
like($@, qr{An element could not be located on the page}, 'Basket should be empty'); |
71 |
|
67 |
|
72 |
$driver->find_element('//a[@class="addtocart cart1"]')->click; |
68 |
$driver->find_element('//a[@class="addtocart cart1"]')->click; |
73 |
$basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span'); |
69 |
my $basket_count_elt = $driver->find_element('//span[@id="basketcount"]/span'); |
74 |
is( $basket_count_elt->get_text(), |
70 |
is( $basket_count_elt->get_text(), |
75 |
1, 'One element should have been added to the cart' ); |
71 |
1, 'One element should have been added to the cart' ); |
76 |
|
72 |
|
77 |
- |
|
|