TT#78161 selenium: remove unnecessary search calls for cached search fields

- removed calls that were redundant, because cached search fields would
fill out the search field anyways

Change-Id: Idde3e799ef4350e0f6b903d1662ecbe0d1965ac4
changes/82/38682/4
Nico Schedel 5 years ago
parent f9690f08f6
commit 8de1bd5e91

@ -134,9 +134,6 @@ $d->find_element('//*[@id="save"]')->click();
diag("Check Administrator details"); diag("Check Administrator details");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Administrator successfully updated', 'Correct Alert was shown'); is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Administrator successfully updated', 'Correct Alert was shown');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#administrator_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', $adminname);
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $adminname . '")]'), 'Name is correct'); ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $adminname . '")]'), 'Name is correct');
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $resellername . '")]'), 'Reseller is correct'); ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $resellername . '")]'), 'Reseller is correct');
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[6][contains(text(), "0")]'), 'Active value is correct'); ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[6][contains(text(), "0")]'), 'Active value is correct');
@ -174,9 +171,6 @@ $d->find_element('//*[@id="save"]')->click();
diag("Check Administrator details"); diag("Check Administrator details");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Administrator successfully updated', 'Correct Alert was shown'); is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Administrator successfully updated', 'Correct Alert was shown');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#administrator_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="administrator_table_filter"]/label/input', 'xpath', $adminname);
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $adminname . '")]'), 'Name is correct'); ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $adminname . '")]'), 'Name is correct');
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $resellername . '")]'), 'Reseller is correct'); ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[contains(text(), "' . $resellername . '")]'), 'Reseller is correct');
ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[4][contains(text(), "1")]'), 'Master value is correct'); ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[4][contains(text(), "1")]'), 'Master value is correct');

@ -112,13 +112,8 @@ $d->fill_element('//*[@id="code"]', 'xpath', "144");
$d->fill_element('//*[@id="prefix"]', 'xpath', "E2_144_"); $d->fill_element('//*[@id="prefix"]', 'xpath', "E2_144_");
$d->find_element('//*[@id="save"]')->click(); $d->find_element('//*[@id="save"]')->click();
diag("Search Emergency Mapping");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Emergency mapping successfully updated', 'Correct Alert was shown');
$d->fill_element('//*[@id="emergency_mappings_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#emergency_mappings_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="emergency_mappings_table_filter"]/label/input', 'xpath', $containername);
diag("Check Emergency Mapping details"); diag("Check Emergency Mapping details");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Emergency mapping successfully updated', 'Correct Alert was shown');
ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[contains(text(), ' . $containername . ')]'), 'Container name is correct'); ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[contains(text(), ' . $containername . ')]'), 'Container name is correct');
ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[contains(text(), ' . $resellername . ')]'), 'Reseller is correct'); ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[contains(text(), ' . $resellername . ')]'), 'Reseller is correct');
ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[contains(text(), "144")]'), 'Emergency Number is correct'); ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[contains(text(), "144")]'), 'Emergency Number is correct');

@ -105,10 +105,6 @@ $d->find_element('//*[@id="save"]')->click();
diag("Check if Invoice Template was applied"); diag("Check if Invoice Template was applied");
$compstring = "Customer #" . $custnum . " successfully updated"; $compstring = "Customer #" . $custnum . " successfully updated";
is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(), $compstring, 'Correct Alert was shown'); is($d->find_element_by_xpath('//*[@id="content"]//div[contains(@class, "alert")]')->get_text(), $compstring, 'Correct Alert was shown');
$d->fill_element('#Customer_table_filter input', 'css', 'thisshouldnotexist');
ok($d->find_element_by_css('#Customer_table tr > td.dataTables_empty', 'css'), 'Garbage test not found');
$d->fill_element('#Customer_table_filter input', 'css', $customerid);
ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(), "' . $customerid . '")]'), 'Customer found');
$d->move_and_click('//*[@id="Customer_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="Customer_table_filter"]/label/input'); $d->move_and_click('//*[@id="Customer_table"]//tr[1]//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="Customer_table_filter"]/label/input');
$d->scroll_to_element($d->find_element('//*[@id="Customer_table_filter"]/label/input')); $d->scroll_to_element($d->find_element('//*[@id="Customer_table_filter"]/label/input'));
ok($d->find_element_by_xpath('//*[@id="invoice_templateidtable"]//tr[1]/td[contains(text(), "'. $templatename .'")]/../td[4]/input[@checked="checked"]'), 'Invoice Template was selected'); ok($d->find_element_by_xpath('//*[@id="invoice_templateidtable"]//tr[1]/td[contains(text(), "'. $templatename .'")]/../td[4]/input[@checked="checked"]'), 'Invoice Template was selected');

@ -70,13 +70,8 @@ $d->find_element('//*[@id="mode"]/option[@value="obfuscate"]')->click();
$d->fill_element('//*[@id="label"]', 'xpath', 'text'); $d->fill_element('//*[@id="label"]', 'xpath', 'text');
$d->find_element('//*[@id="save"]')->click(); $d->find_element('//*[@id="save"]')->click();
diag("Search Call List Suppression");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Call list suppression successfully updated', 'Correct Alert was shown');
$d->fill_element('//*[@id="call_list_suppression_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#call_list_suppression_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('//*[@id="call_list_suppression_table_filter"]/label/input', 'xpath', $domainstring);
diag("Check details"); diag("Check details");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Call list suppression successfully updated', 'Correct Alert was shown');
ok($d->find_element_by_xpath('//*[@id="call_list_suppression_table"]//tr[1]/td[contains(text(), "' . $domainstring . '")]'), "Domain is correct"); ok($d->find_element_by_xpath('//*[@id="call_list_suppression_table"]//tr[1]/td[contains(text(), "' . $domainstring . '")]'), "Domain is correct");
ok($d->find_element_by_xpath('//*[@id="call_list_suppression_table"]//tr[1]/td[contains(text(), "incoming")]'), 'Direction is correct'); ok($d->find_element_by_xpath('//*[@id="call_list_suppression_table"]//tr[1]/td[contains(text(), "incoming")]'), 'Direction is correct');
ok($d->find_element_by_xpath('//*[@id="call_list_suppression_table"]//tr[1]/td[contains(text(), "testing")]'), 'Pattern is correct'); ok($d->find_element_by_xpath('//*[@id="call_list_suppression_table"]//tr[1]/td[contains(text(), "testing")]'), 'Pattern is correct');

@ -302,9 +302,6 @@ $d->fill_element('#description', 'css', 'see if stuff changes');
$d->find_element('#save', 'css')->click(); $d->find_element('#save', 'css')->click();
diag("Check if Peering rule was edited"); diag("Check if Peering rule was edited");
$d->fill_element('//*[@id="PeeringOverview_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#PeeringOverview_table tr > td.dataTables_empty', 'css'), 'Inbound Peering Rule was not created');
$d->fill_element('//*[@id="PeeringOverview_table_filter"]/label/input', 'xpath', $groupname);
ok($d->find_element_by_xpath('//*[@id="PeeringOverview_table"]//tr[1]/td[contains(text(), "' . $groupname . '")]'), 'Peering Rule was found'); ok($d->find_element_by_xpath('//*[@id="PeeringOverview_table"]//tr[1]/td[contains(text(), "' . $groupname . '")]'), 'Peering Rule was found');
ok($d->find_element_by_xpath('//*[@id="PeeringOverview_table"]//tr[1]/td[contains(text(), "see if stuff changes")]'), 'Description is correct'); ok($d->find_element_by_xpath('//*[@id="PeeringOverview_table"]//tr[1]/td[contains(text(), "see if stuff changes")]'), 'Description is correct');

@ -79,9 +79,6 @@ $d->find_element('#save', 'css')->click();
diag("Check Reseller details"); diag("Check Reseller details");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Reseller successfully updated', 'Correct Alert was shown'); is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Reseller successfully updated', 'Correct Alert was shown');
$d->fill_element('#Resellers_table_filter label input', 'css', 'thisshouldnotexist');
ok($d->find_element_by_css('#Resellers_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found');
$d->fill_element('#Resellers_table_filter label input', 'css', $resellername);
ok($d->find_element_by_xpath('//*[@id="Resellers_table"]//tr[1]/td[contains(text(), "' . $resellername . '")]'), 'Reseller name is correct'); ok($d->find_element_by_xpath('//*[@id="Resellers_table"]//tr[1]/td[contains(text(), "' . $resellername . '")]'), 'Reseller name is correct');
ok($d->find_element_by_xpath('//*[@id="Resellers_table"]//tr[1]/td[contains(text(), "active")]'), 'Status is correct'); ok($d->find_element_by_xpath('//*[@id="Resellers_table"]//tr[1]/td[contains(text(), "active")]'), 'Status is correct');

@ -91,9 +91,6 @@ $d->find_element('//*[@id="status"]/option[@value="locked"]')->click();
$d->find_element('//*[@id="save"]')->click(); $d->find_element('//*[@id="save"]')->click();
diag("Check if Customer was edited"); diag("Check if Customer was edited");
$d->fill_element('#Customer_table_filter input', 'css', 'thisshouldnotexist');
ok($d->find_element_by_css('#Customer_table tr > td.dataTables_empty'), 'Garbage text was not found');
$d->fill_element('#Customer_table_filter input', 'css', $customerid);
ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(), "' . $customerid . '")]'), 'Found customer'); ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(), "' . $customerid . '")]'), 'Found customer');
ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(), "locked")]'), 'Status was changed'); ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(), "locked")]'), 'Status was changed');
$custnum = $d->get_text('//*[@id="Customer_table"]//tr[1]//td[1]'); $custnum = $d->get_text('//*[@id="Customer_table"]//tr[1]//td[1]');
@ -133,9 +130,6 @@ $d->find_element('//*[@id="save"]')->click();
diag("Check if Contact was edited"); diag("Check if Contact was edited");
is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Contact successfully changed', 'Correct Alert was shown'); is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Contact successfully changed', 'Correct Alert was shown');
$d->fill_element('//*[@id="contact_table_filter"]/label/input', 'xpath', 'thisshouldnotexist');
ok($d->find_element_by_css('#contact_table tr > td.dataTables_empty', 'css'), 'Garbage test not found');
$d->fill_element('//*[@id="contact_table_filter"]/label/input', 'xpath', $contactmail);
ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text(), "' . $contactmail . '")]'), 'Contact found'); ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text(), "' . $contactmail . '")]'), 'Contact found');
ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text(), "TestFistName")]'), 'First Name was edited'); ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text(), "TestFistName")]'), 'First Name was edited');
ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text(), "TestLastName")]'), 'Last Name was edited'); ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text(), "TestLastName")]'), 'Last Name was edited');

Loading…
Cancel
Save