MT#12897 Improve selenium test stability, check "thisshouldnotexist" with table reference

Change-Id: I485c69ad49e85237f0c0416d8d667b4c90c239cd
changes/15/1815/1
Alexander Lutay 11 years ago
parent caac2cefd8
commit 0dcf76102b

@ -107,7 +107,7 @@ $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->find_ok(css => '#billing_zone_table 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,11 +32,11 @@ 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->find_ok(css => '#contactidtable 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->find_ok(css => '#billing_profileidtable 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
@ -48,7 +48,7 @@ $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->find_ok(css => '#Customer_table 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);
@ -64,7 +64,7 @@ $d->fill_element_ok([css => 'div.modal #firstname', "Alice"]);
$d->fill_element_ok([id => 'company', 'Sipwise']);
# Choosing Country:
$d->fill_element_ok([css => '#countryidtable_filter input', 'thisshouldnotexist']);
$d->find_ok(css => 'tr > td.dataTables_empty');
$d->find_ok(css => '#countryidtable tr > td.dataTables_empty');
$d->fill_element_ok([css => '#countryidtable_filter input', 'Ukraine']);
$d->select_if_unselected_ok(xpath => '//table[@id="countryidtable"]/tbody/tr[1]/td[contains(text(),"Ukraine")]/..//input[@type="checkbox"]');
# Save
@ -92,7 +92,7 @@ $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->find_ok(css => '#Customer_table 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,7 +71,7 @@ my $server_rules_uri = $d->get_location;
diag('Edit Preferences for "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->find_ok(css => '#peering_servers_table 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")]/..');
@ -104,7 +104,7 @@ 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->find_ok(css => '#peering_servers_table 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);

Loading…
Cancel
Save