Bug 34227: (follow-up) Adjust selenium tests

This patch adjusts the selenium tests to address the renamed ID for the
elements.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2023-10-30 09:38:46 -03:00
parent 5a188651e4
commit af8a332b9c
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -297,17 +297,17 @@ subtest 'Search patrons' => sub {
$s->fill_form( { search_patron_filter => 'test_patron' } );
$s->submit_form;
$s->wait_for_ajax;
my $patron_selected_text = $driver->find_element('//div[@id="patron_search_selected"]/span')->get_text;
my $patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text;
is( $patron_selected_text, "", "Patrons selected is not displayed" );
my @checkboxes = $driver->find_elements(
'//input[@type="checkbox"][@name="borrowernumber"]');
$checkboxes[2]->click;
$patron_selected_text = $driver->find_element('//div[@id="patron_search_selected"]/span')->get_text;
$patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text;
is( $patron_selected_text, "Patrons selected: 1", "One patron selected" );
$checkboxes[4]->click;
$patron_selected_text = $driver->find_element('//div[@id="patron_search_selected"]/span')->get_text;
$patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text;
is( $patron_selected_text, "Patrons selected: 2", "Two patrons are selected" );
$driver->find_element('//*[@id="memberresultst_next"]')->click;
@ -315,7 +315,7 @@ subtest 'Search patrons' => sub {
@checkboxes = $driver->find_elements(
'//input[@type="checkbox"][@name="borrowernumber"]');
$checkboxes[0]->click;
$patron_selected_text = $driver->find_element('//div[@id="patron_search_selected"]/span')->get_text;
$patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text;
is( $patron_selected_text, "Patrons selected: 3", "Three patrons are selected" );
# Perform another search
@ -323,7 +323,7 @@ subtest 'Search patrons' => sub {
$s->fill_form( { search_patron_filter => 'test_patron' } );
$s->submit_form;
$s->wait_for_ajax;
$patron_selected_text = $driver->find_element('//div[@id="patron_search_selected"]/span')->get_text;
$patron_selected_text = $driver->find_element('//div[@id="table_search_selections"]/span')->get_text;
is( $patron_selected_text, "Patrons selected: 3", "Three patrons still selected" );
$driver->find_element('//*[@id="patronlist-menu"]')->click;