MT#5751 test stability: dataTables filter

always search for a non-existing row before searching
for the real entry, to get a fresh row, and a deterministic
dom change. (see 5751#c37775)
agranig/selfsignup
Gerhard Jungwirth 12 years ago
parent 20a73ec489
commit cc3a7eaa2a

@ -92,6 +92,8 @@ $d->findclick_ok(link_text => "Edit Zones");
$d->find_ok(xpath => '//*[@id="masthead"]//h2[contains(text(),"Billing Zones")]');
diag("Delete testingzone");
$d->fill_element_ok([xpath => '//div[contains(@class, "dataTables_filter")]//input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->fill_element_ok([xpath => '//div[contains(@class, "dataTables_filter")]//input', 'testingdetail']);
$row = $d->find(xpath => '//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingzone")]/..');
ok($row);

@ -32,8 +32,12 @@ $d->findclick_ok(link_text => "Customers");
diag("Create a Customer");
$d->find_ok(xpath => '//*[@id="masthead"]//h2[contains(text(),"Customers")]');
$d->findclick_ok(link_text => 'Create Customer');
$d->fill_element_ok([css => '#contactidtable_filter input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->fill_element_ok([css => '#contactidtable_filter input', 'default-customer']);
$d->select_if_unselected_ok(xpath => '//table[@id="contactidtable"]/tbody/tr[1]/td[contains(text(),"default-customer")]/..//input[@type="checkbox"]');
$d->fill_element_ok([css => '#billing_profileidtable_filter input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->fill_element_ok([css => '#billing_profileidtable_filter input', 'Default Billing Profile']);
$d->select_if_unselected_ok(xpath => '//table[@id="billing_profileidtable"]/tbody/tr[1]/td[contains(text(),"Default Billing Profile")]/..//input[@type="checkbox"]');
eval { #lets only try this
@ -44,6 +48,8 @@ $d->findclick_ok(id => 'save');
diag("Open Details for our just created Customer");
sleep 2; #Else we might search on the previous page
$d->fill_element_ok([css => '#Customer_table_filter input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->fill_element_ok([css => '#Customer_table_filter input', $rnd_id]);
my $row = $d->find(xpath => '(//table/tbody/tr/td[contains(text(), "'.$rnd_id.'")]/..)[1]');
ok($row);
@ -80,6 +86,8 @@ $d->find_ok(xpath => '//div[contains(@class,"accordion-body")]//table//td[contai
diag("Terminate our customer");
$d->findclick_ok(xpath => '//a[contains(@class,"btn-primary") and text()[contains(.,"Back")]]');
$d->fill_element_ok([css => '#Customer_table_filter input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->fill_element_ok([css => '#Customer_table_filter input', $rnd_id]);
$row = $d->find(xpath => '(//table/tbody/tr/td[contains(text(), "'.$rnd_id.'")]/..)[1]');
ok($row);

@ -71,9 +71,12 @@ my $server_rules_uri = $d->get_location;
diag('Edit Preferences for "mytestserver".');
sleep 1; #make sure, we are on the right page
$row = $d->find(xpath => '(//table/tbody/tr/td[contains(text(), "mytestserver")]/..)[1]');
$d->fill_element_ok([css => '#peering_servers_table_filter input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->fill_element_ok([css => '#peering_servers_table_filter input', 'mytestserver']);
$edit_link = $d->find(xpath => '//table/tbody/tr/td[contains(text(), "mytestserver")]/../td//a[contains(text(),"Preferences")]');
$row = $d->find(xpath => '//table/tbody/tr/td[contains(text(), "mytestserver")]/..');
ok($row);
$edit_link = $d->find_child_element($row, '(./td//a)[contains(text(),"Preferences")]');
ok($edit_link);
$d->move_to(element => $row);
$edit_link->click;
@ -101,6 +104,9 @@ my $delete_link;
diag('skip was here');
diag("Delete mytestserver");
sleep 1; #make sure, we are on the right page
$d->fill_element_ok([css => '#peering_servers_table_filter input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->fill_element_ok([css => '#peering_servers_table_filter input', 'mytestserver']);
$row = $d->find(xpath => '(//table/tbody/tr/td[contains(text(), "mytestserver")]/..)[1]');
ok($row);
$delete_link = $d->find_child_element($row, '(./td//a)[contains(text(),"Delete")]');

@ -30,7 +30,6 @@ ok($searchfield);
$searchfield->send_keys('donotfindme');
diag("Verify that nothing is shown");
sleep 2; # wait for ajax
my $elem = $d->find(css => '#Resellers_table td.dataTables_empty');
ok($elem);
is($elem->get_text,'No matching records found');

Loading…
Cancel
Save