From 8de1bd5e91cefb6abc6d8cebde0e2bd0624e79f5 Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Fri, 20 Mar 2020 13:25:31 +0100 Subject: [PATCH] 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 --- t/selenium/controller_admin.t | 6 ------ t/selenium/controller_emergency.t | 7 +------ t/selenium/controller_invoice.t | 4 ---- t/selenium/controller_other.t | 7 +------ t/selenium/controller_peering.t | 3 --- t/selenium/controller_reseller.t | 3 --- t/selenium/controller_terminate.t | 6 ------ 7 files changed, 2 insertions(+), 34 deletions(-) diff --git a/t/selenium/controller_admin.t b/t/selenium/controller_admin.t index 249dd4ee92..44139ef6ba 100644 --- a/t/selenium/controller_admin.t +++ b/t/selenium/controller_admin.t @@ -134,9 +134,6 @@ $d->find_element('//*[@id="save"]')->click(); diag("Check Administrator details"); 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(), "' . $resellername . '")]'), 'Reseller 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"); 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(), "' . $resellername . '")]'), 'Reseller is correct'); ok($d->find_element_by_xpath('//*[@id="administrator_table"]//tr[1]/td[4][contains(text(), "1")]'), 'Master value is correct'); diff --git a/t/selenium/controller_emergency.t b/t/selenium/controller_emergency.t index 2469b894c7..e978a26cf2 100644 --- a/t/selenium/controller_emergency.t +++ b/t/selenium/controller_emergency.t @@ -112,13 +112,8 @@ $d->fill_element('//*[@id="code"]', 'xpath', "144"); $d->fill_element('//*[@id="prefix"]', 'xpath', "E2_144_"); $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"); +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(), ' . $resellername . ')]'), 'Reseller is correct'); ok($d->find_element_by_xpath('//*[@id="emergency_mappings_table"]//tr[1]/td[contains(text(), "144")]'), 'Emergency Number is correct'); diff --git a/t/selenium/controller_invoice.t b/t/selenium/controller_invoice.t index 8d3309f438..a8d36d7be9 100644 --- a/t/selenium/controller_invoice.t +++ b/t/selenium/controller_invoice.t @@ -105,10 +105,6 @@ $d->find_element('//*[@id="save"]')->click(); diag("Check if Invoice Template was applied"); $compstring = "Customer #" . $custnum . " successfully updated"; 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->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'); diff --git a/t/selenium/controller_other.t b/t/selenium/controller_other.t index 4b08a4123f..4f64575c8c 100644 --- a/t/selenium/controller_other.t +++ b/t/selenium/controller_other.t @@ -70,13 +70,8 @@ $d->find_element('//*[@id="mode"]/option[@value="obfuscate"]')->click(); $d->fill_element('//*[@id="label"]', 'xpath', 'text'); $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"); +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(), "incoming")]'), 'Direction is correct'); ok($d->find_element_by_xpath('//*[@id="call_list_suppression_table"]//tr[1]/td[contains(text(), "testing")]'), 'Pattern is correct'); diff --git a/t/selenium/controller_peering.t b/t/selenium/controller_peering.t index f23d07aae9..2c9932a3d0 100644 --- a/t/selenium/controller_peering.t +++ b/t/selenium/controller_peering.t @@ -302,9 +302,6 @@ $d->fill_element('#description', 'css', 'see if stuff changes'); $d->find_element('#save', 'css')->click(); 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(), "see if stuff changes")]'), 'Description is correct'); diff --git a/t/selenium/controller_reseller.t b/t/selenium/controller_reseller.t index b4337179c7..88807af33b 100644 --- a/t/selenium/controller_reseller.t +++ b/t/selenium/controller_reseller.t @@ -79,9 +79,6 @@ $d->find_element('#save', 'css')->click(); diag("Check Reseller details"); 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(), "active")]'), 'Status is correct'); diff --git a/t/selenium/controller_terminate.t b/t/selenium/controller_terminate.t index 1dc81016d3..76b4287cac 100644 --- a/t/selenium/controller_terminate.t +++ b/t/selenium/controller_terminate.t @@ -91,9 +91,6 @@ $d->find_element('//*[@id="status"]/option[@value="locked"]')->click(); $d->find_element('//*[@id="save"]')->click(); 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(), "locked")]'), 'Status was changed'); $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"); 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(), "TestFistName")]'), 'First Name was edited'); ok($d->find_element_by_xpath('//*[@id="contact_table"]//tr[1]/td[contains(text(), "TestLastName")]'), 'Last Name was edited');