From d6ac16de617683cbe7aa6430495f6a73fc5c9caf Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Thu, 6 Jun 2019 10:52:03 +0200 Subject: [PATCH] TT#56376 selenium: replace move_action with move_and_click() replaced every occurance of move_action + click with move_and_click. all also have a fallback element if the click doesnt work first try. Change-Id: I0489dacbda264d509c52016f259368666f3d5c15 --- t/selenium/controller_admin.t | 3 +-- t/selenium/controller_billing.t | 23 +++++++---------------- t/selenium/controller_customer.t | 3 +-- t/selenium/controller_domain.t | 3 +-- t/selenium/controller_peering.t | 27 +++++++++------------------ t/selenium/controller_reseller.t | 6 ++---- t/selenium/controller_rw_ruleset.t | 11 ++++------- t/selenium/controller_subscriber.t | 9 +++------ 8 files changed, 28 insertions(+), 57 deletions(-) diff --git a/t/selenium/controller_admin.t b/t/selenium/controller_admin.t index a0fc3d5bd1..50e1159b21 100644 --- a/t/selenium/controller_admin.t +++ b/t/selenium/controller_admin.t @@ -68,8 +68,7 @@ sub ctr_admin() { 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->wait_for_text('//*[@id="administrator_table"]/tbody/tr[1]/td[3]', $adminname), "Admin found"); - $d->move_action(element => $d->find_element('//*[@id="administrator_table"]/tbody/tr[1]/td//a[contains(text(), "Delete")]')); - $d->find_element('//*[@id="administrator_table"]/tbody/tr[1]/td//a[contains(text(), "Delete")]')->click(); + $d->move_and_click('//*[@id="administrator_table"]/tbody/tr[1]/td//a[contains(text(), "Delete")]', 'xpath', '//*[@id="administrator_table_filter"]/label/input'); $d->find_element('//*[@id="dataConfirmOK"]')->click(); diag('Check if admin is deleted'); diff --git a/t/selenium/controller_billing.t b/t/selenium/controller_billing.t index 0fa3124558..86c24b07af 100644 --- a/t/selenium/controller_billing.t +++ b/t/selenium/controller_billing.t @@ -42,8 +42,7 @@ sub ctr_billing { ok($d->wait_for_text('//*[@id="billing_profile_table"]/tbody/tr/td[3]', 'default'), 'Correct reseller was found'); diag("Open edit dialog for Test Profile"); - $d->move_action(element => $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Edit")]')); - $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Edit")]')->click(); + $d->move_and_click('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="billing_profile_table_filter"]//input'); diag("Edit Test Profile"); my $elem = $d->find_element('#name', 'css'); @@ -57,8 +56,7 @@ sub ctr_billing { ok($d->find_element_by_css('#billing_profile_table tr > td.dataTables_empty'), 'Garbage text was not found'); $d->fill_element('//*[@id="billing_profile_table_filter"]//input', 'xpath', $billingname); ok($d->wait_for_text('//*[@id="billing_profile_table"]/tbody/tr/td[2]', $billingname), 'Billing profile was found'); - $d->move_action(element => $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Fees")]')); - $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Fees")]')->click(); + $d->move_and_click('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Fees")]', 'xpath', '//*[@id="billing_profile_table_filter"]//input'); diag("Create a billing fee"); $d->find_element('Create Fee Entry', 'link_text')->click(); @@ -84,8 +82,7 @@ sub ctr_billing { ok($d->wait_for_text('//*[@id="billing_fee_table"]/tbody/tr/td[6]', 'testingdetail'), 'Billing zone is correct'); diag("Delete billing fee"); - $d->move_action(element => $d->find_element('//*[@id="billing_fee_table"]/tbody/tr[1]/td//div//a[contains(text(), "Delete")]')); - $d->find_element('//*[@id="billing_fee_table"]/tbody/tr[1]/td//div//a[contains(text(), "Delete")]')->click(); + $d->move_and_click('//*[@id="billing_fee_table"]/tbody/tr[1]/td//div//a[contains(text(), "Delete")]', 'xpath', '//*[@id="billing_fee_table_filter"]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); ok($d->find_text("successfully deleted"), 'Text "successfully deleted" appears'); @@ -107,10 +104,7 @@ sub ctr_billing { $d->fill_element('//*[@id="billing_zone_table_filter"]//input', 'xpath', 'thisshouldnotexist'); ok($d->find_element_by_css('#billing_zone_table tr > td.dataTables_empty'), 'Garbage text was not found'); $d->fill_element('//*[@id="billing_zone_table_filter"]//input', 'xpath', 'testingdetail'); - my $row = $d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingzone")]/..'); - ok($row); - $d->move_action(element => $row); - $d->find_element('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingzone")]/..//a[contains(text(),"Delete")]')->click(); + $d->move_and_click('//div[contains(@class,"dataTables_wrapper")]//td[contains(text(),"testingzone")]/..//a[contains(text(),"Delete")]', 'xpath', '//*[@id="billing_zone_table_filter"]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); @@ -129,8 +123,7 @@ sub ctr_billing { ok($d->find_element_by_css('#billing_profile_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('#billing_profile_table_filter label input', 'css', $billingname); ok($d->wait_for_text('//*[@id="billing_profile_table"]/tbody/tr/td[2]', $billingname), 'Billing profile was found'); - $d->move_action(element => $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Off-Peaktimes")]')); - $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Off-Peaktimes")]')->click(); + $d->move_and_click('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Off-Peaktimes")]', 'xpath', '//*[@id="billing_profile_table_filter"]//input'); diag("Edit Wednesday"); $d->move_and_click('//table//td[contains(text(),"Wednesday")]/..//a[text()[contains(.,"Edit")]]', 'xpath', '//h3[contains(text(),"Weekdays")]'); @@ -161,8 +154,7 @@ sub ctr_billing { ok($d->wait_for_text('//*[@id="date_definition_table"]/tbody/tr/td[3]', '2008-02-28 13:37:00'), 'End Date definition is correct'); diag("Delete my created date definition"); - $d->move_action(element => ($d->find_element('//*[@id="date_definition_table"]/tbody//tr//td//div//a[contains(text(),"Delete")]'))); - $d->find_element('//*[@id="date_definition_table"]/tbody//tr//td//div//a[contains(text(),"Delete")]')->click(); + $d->move_and_click('//*[@id="date_definition_table"]/tbody//tr//td//div//a[contains(text(),"Delete")]', 'xpath', '//div[contains(@class, "dataTables_filter")]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); @@ -173,8 +165,7 @@ sub ctr_billing { ok($d->find_element_by_css('#billing_profile_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('#billing_profile_table_filter label input', 'css', $billingname); ok($d->wait_for_text('//*[@id="billing_profile_table"]/tbody/tr/td[2]', $billingname), 'Billing profile was found'); - $d->move_action(element => $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Terminate")]')); - $d->find_element('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Terminate")]')->click(); + $d->move_and_click('//*[@id="billing_profile_table"]/tbody/tr[1]//td//div//a[contains(text(), "Terminate")]', 'xpath', '//*[@id="billing_profile_table_filter"]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); diff --git a/t/selenium/controller_customer.t b/t/selenium/controller_customer.t index 749dbbf887..7936e384bc 100644 --- a/t/selenium/controller_customer.t +++ b/t/selenium/controller_customer.t @@ -45,8 +45,7 @@ sub ctr_customer { ok($d->find_element_by_xpath('//*[@id="Customer_table"]/tbody/tr[1]/td[contains(text(), "Default Billing Profile")]'), 'Billing Profile is correct'); diag("Open Details for our just created Customer"); - $d->move_action(element=> $d->find_element('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]')); - $d->find_element('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]')->click(); + $d->move_and_click('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]', 'xpath', '//*[@id="Customer_table_filter"]//input'); diag("Edit our contact"); $d->find_element('//div[contains(@class,"accordion-heading")]//a[contains(text(),"Contact Details")]')->click(); diff --git a/t/selenium/controller_domain.t b/t/selenium/controller_domain.t index d8deebebef..73f86135d9 100644 --- a/t/selenium/controller_domain.t +++ b/t/selenium/controller_domain.t @@ -51,8 +51,7 @@ sub ctr_domain { ok($d->find_element_by_xpath('//table/tbody/tr/td[contains(text(), "concurrent_max")]/../td[contains(text(), "789")]'), "Value has been applied"); diag("Click edit for the preference allowed_ips"); - $d->move_action(element=> $d->find_element('//table/tbody/tr/td[contains(text(), "allowed_ips")]/../td/div/a[contains(text(), "Edit")]')); - $d->find_element('//table/tbody/tr/td[contains(text(), "allowed_ips")]/../td/div/a[contains(text(), "Edit")]')->click(); + $d->move_and_click('//table/tbody/tr/td[contains(text(), "allowed_ips")]/../td/div/a[contains(text(), "Edit")]', 'xpath', '//table/tbody/tr/td[contains(text(), "man_allowed_ips")]/../td/div/a[contains(text(), "Edit")]'); diag("Enter an IP address"); $d->fill_element('//*[@id="allowed_ips"]', 'xpath', '127.0.0.0.0'); diff --git a/t/selenium/controller_peering.t b/t/selenium/controller_peering.t index 8962fa3d6e..d23aec439a 100644 --- a/t/selenium/controller_peering.t +++ b/t/selenium/controller_peering.t @@ -105,15 +105,13 @@ sub ctr_peering { $d->find_element('#peering_servers_table tr > td.dataTables_empty', 'css'); $d->fill_element('#peering_servers_table_filter input', 'css', $servername); ok($d->wait_for_text('//*[@id="peering_servers_table"]/tbody/tr[1]/td[2]', $servername), 'Peering Server has been found'); - $d->move_action(element => $d->find_element('//*[@id="peering_servers_table"]/tbody/tr[1]//td//div//a[contains(text(), "Preferences")]')); - $d->find_element('//*[@id="peering_servers_table"]/tbody/tr[1]//td//div//a[contains(text(), "Preferences")]')->click(); + $d->move_and_click('//*[@id="peering_servers_table"]/tbody/tr[1]//td//div//a[contains(text(), "Preferences")]', 'xpath', '//*[@id="peering_servers_table_filter"]//input'); diag('Open the tab "Number Manipulations"'); $d->find_element("Number Manipulations", 'link_text')->click(); diag("Click edit for the preference inbound_upn"); - $d->move_action(element => $d->find_element('//table//td[contains(text(), "inbound_upn")]/..//td//a[contains(text(), "Edit")]')); - $d->find_element('//table//td[contains(text(), "inbound_upn")]/..//td//a[contains(text(), "Edit")]')->click(); + $d->move_and_click('//table//td[contains(text(), "inbound_upn")]/..//td//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Number Manipulation")]'); diag('Change to "P-Asserted-Identity'); $d->find_element('//*[@id="inbound_upn"]/option[@value="pai_user"]')->click(); @@ -128,8 +126,7 @@ sub ctr_peering { $d->find_element("Remote Authentication", 'link_text')->click(); diag('Edit peer_auth_user'); - $d->move_action(element => $d->find_element('//table/tbody/tr/td[contains(text(), "peer_auth_user")]/../td/div//a[contains(text(), "Edit")]')); - $d->find_element('//table/tbody/tr/td[contains(text(), "peer_auth_user")]/../td/div//a[contains(text(), "Edit")]')->click(); + $d->move_and_click('//table/tbody/tr/td[contains(text(), "peer_auth_user")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Remote Authentication")]'); $d->fill_element('//*[@id="peer_auth_user"]', 'xpath', 'peeruser1'); $d->find_element('#save', 'css')->click(); @@ -139,8 +136,7 @@ sub ctr_peering { ok($d->wait_for_text('//table/tbody/tr/td[contains(text(), "peer_auth_user")]/../td[4]', 'peeruser1'), 'peer_auth_user value has been set'); diag('Edit peer_auth_pass'); - $d->move_action(element => $d->find_element('//table/tbody/tr/td[contains(text(), "peer_auth_pass")]/../td/div//a[contains(text(), "Edit")]')); - $d->find_element('//table/tbody/tr/td[contains(text(), "peer_auth_pass")]/../td/div//a[contains(text(), "Edit")]')->click(); + $d->move_and_click('//table/tbody/tr/td[contains(text(), "peer_auth_pass")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Remote Authentication")]'); $d->fill_element('//*[@id="peer_auth_pass"]', 'xpath', 'peerpass1'); $d->find_element('#save', 'css')->click(); @@ -150,8 +146,7 @@ sub ctr_peering { ok($d->wait_for_text('//table/tbody/tr/td[contains(text(), "peer_auth_pass")]/../td[4]', 'peerpass1'), 'peer_auth_pass value has been set'); diag('Edit peer_auth_realm'); - $d->move_action(element => $d->find_element('//table/tbody/tr/td[contains(text(), "peer_auth_realm")]/../td/div//a[contains(text(), "Edit")]')); - $d->find_element('//table/tbody/tr/td[contains(text(), "peer_auth_realm")]/../td/div//a[contains(text(), "Edit")]')->click(); + $d->move_and_click('//table/tbody/tr/td[contains(text(), "peer_auth_realm")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Remote Authentication")]'); $d->fill_element('//*[@id="peer_auth_realm"]', 'xpath', 'testpeering.com'); $d->find_element('#save', 'css')->click(); @@ -169,8 +164,7 @@ sub ctr_peering { ok($d->find_element_by_css('#peering_servers_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('#peering_servers_table_filter input', 'css', $servername); ok($d->wait_for_text('//*[@id="peering_servers_table"]/tbody/tr/td[2]', $servername), "mytestserver was found"); - $d->move_action(element => $d->find_element('//*[@id="peering_servers_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')); - $d->find_element('//*[@id="peering_servers_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')->click(); + $d->move_and_click('//*[@id="peering_servers_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]', 'xpath', '//*[@id="peering_servers_table_filter"]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); ok($d->find_text("successfully deleted"), 'Text "successfully deleted" appears'); @@ -180,8 +174,7 @@ sub ctr_peering { ok($d->find_element_by_css('#PeeringRules_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('#PeeringRules_table_filter input', 'css', 'for testing purposes'); ok($d->wait_for_text('//*[@id="PeeringRules_table"]/tbody/tr/td[5]', 'for testing purposes'), "Outbound Peering Rule was found"); - $d->move_action(element => $d->find_element('//*[@id="PeeringRules_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')); - $d->find_element('//*[@id="PeeringRules_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')->click(); + $d->move_and_click('//*[@id="PeeringRules_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]', 'xpath', '//*[@id="PeeringRules_table_filter"]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); ok($d->find_text("successfully deleted"), 'Text "successfully deleted" appears'); @@ -192,8 +185,7 @@ sub ctr_peering { ok($d->find_element_by_css('#InboundPeeringRules_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('#InboundPeeringRules_table_filter input', 'css', 'forbidden'); ok($d->wait_for_text('//*[@id="InboundPeeringRules_table"]/tbody/tr/td[6]', 'forbidden'), "Inbound Peering Rule was found"); - $d->move_action(element => $d->find_element('//*[@id="InboundPeeringRules_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')); - $d->find_element('//*[@id="InboundPeeringRules_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')->click(); + $d->move_and_click('//*[@id="InboundPeeringRules_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]', 'xpath', '//*[@id="InboundPeeringRules_table_filter"]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); ok($d->find_text("successfully deleted"), 'Text "successfully deleted" appears'); @@ -206,8 +198,7 @@ sub ctr_peering { ok($d->find_element_by_css('#sip_peering_group_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('//*[@id="sip_peering_group_table_filter"]/label/input', 'xpath', $groupname); ok($d->wait_for_text('//*[@id="sip_peering_group_table"]/tbody/tr/td[3]', $groupname), 'Testing Group was found'); - $d->move_action(element=> $d->find_element('//*[@id="sip_peering_group_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')); - $d->find_element('//*[@id="sip_peering_group_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]')->click(); + $d->move_and_click('//*[@id="sip_peering_group_table"]/tbody/tr[1]//td//div//a[contains(text(), "Delete")]', 'xpath', '//*[@id="sip_peering_group_table_filter"]//input'); ok($d->find_text("Are you sure?"), 'Delete dialog appears'); $d->find_element('#dataConfirmOK', 'css')->click(); ok($d->find_text("successfully deleted"), 'Text "successfully deleted" appears'); diff --git a/t/selenium/controller_reseller.t b/t/selenium/controller_reseller.t index 53801e7a32..546da0cacd 100644 --- a/t/selenium/controller_reseller.t +++ b/t/selenium/controller_reseller.t @@ -38,13 +38,11 @@ sub ctr_reseller { ok($d->wait_for_text('//*[@id="Resellers_table"]/tbody/tr[1]/td[3]', $resellername), 'Reseller Name is correct'); diag("Click Edit on our newly created reseller"); - $d->move_action(element=> $d->find_element('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Edit")]')); - $d->find_element('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Edit")]')->click(); + $d->move_and_click('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Edit")]', 'xpath', '//*[@id="Resellers_table_filter"]//input'); $d->find_element('#mod_close', 'css')->click(); diag("Click Details on our newly created reseller"); - $d->move_action(element=> $d->find_element('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]')); - $d->find_element('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]')->click(); + $d->move_and_click('//*[@id="Resellers_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]', 'xpath', '//*[@id="Resellers_table_filter"]//input'); diag("Create a new Invoice Template"); $d->find_element('//*[@id="reseller_details"]//div//div//a[contains(text(),"Invoice Templates")]')->click(); diff --git a/t/selenium/controller_rw_ruleset.t b/t/selenium/controller_rw_ruleset.t index 889260c1bd..07ae01e67f 100644 --- a/t/selenium/controller_rw_ruleset.t +++ b/t/selenium/controller_rw_ruleset.t @@ -31,8 +31,7 @@ sub ctr_rw_ruleset { ok($d->wait_for_text('//*[@id="rewrite_rule_set_table"]/tbody/tr[1]/td[3]', $rulesetname), 'Ruleset was found'); diag('Create a new Rule for Caller'); - $d->move_action(element => $d->find_element('//*[@id="rewrite_rule_set_table"]/tbody/tr[1]//td//div//a[contains(text(), "Rules")]')); - $d->find_element('//*[@id="rewrite_rule_set_table"]/tbody/tr[1]//td//div//a[contains(text(), "Rules")]')->click(); + $d->move_and_click('//*[@id="rewrite_rule_set_table"]/tbody/tr[1]//td//div//a[contains(text(), "Rules")]', 'xpath', '//*[@id="rewrite_rule_set_table_filter"]/label/input'); $d->find_element('Create Rewrite Rule', 'link_text')->click; $d->fill_element('//*[@id="match_pattern"]', 'xpath', '^(00|\+)([1-9][0-9]+)$'); $d->fill_element('//*[@id="replace_pattern"]', 'xpath', '\2'); @@ -82,13 +81,11 @@ sub ctr_rw_ruleset { ok($d->find_element_by_css('#Domain_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('//*[@id="Domain_table_filter"]/label/input', 'xpath', $domainstring); ok($d->wait_for_text('//*[@id="Domain_table"]/tbody/tr/td[3]', $domainstring), 'Entry was found'); - $d->move_action(element => $d->find_element('//*[@id="Domain_table"]/tbody/tr[1]//td//div//a[contains(text(),"Preferences")]')); - $d->find_element('//*[@id="Domain_table"]/tbody/tr[1]//td//div//a[contains(text(),"Preferences")]')->click(); + $d->move_and_click('//*[@id="Domain_table"]/tbody/tr[1]//td//div//a[contains(text(),"Preferences")]', 'xpath', '//*[@id="Domain_table_filter"]/label/input'); diag('Add ruleset to a domain'); - $d->find_element('Number Manipulations', 'link_text')->click; - $d->move_action(element => $d->find_element('//table/tbody/tr/td[contains(text(), "rewrite_rule_set")]/../td/div//a[contains(text(), "Edit")]')); - $d->find_element('//table/tbody/tr/td[contains(text(), "rewrite_rule_set")]/../td/div//a[contains(text(), "Edit")]')->click(); + $d->find_element('Number Manipulations', 'link_text')->click(); + $d->move_and_click('//table/tbody/tr/td[contains(text(), "rewrite_rule_set")]/../td/div//a[contains(text(), "Edit")]', 'xpath', '//*[@id="preference_groups"]//div//a[contains(text(), "Number Manipulations")]'); $d->find_element('//*[@id="rewrite_rule_set.1"]')->click(); $d->find_element('//*[@id="save"]')->click(); diff --git a/t/selenium/controller_subscriber.t b/t/selenium/controller_subscriber.t index 8445d837f3..aa65a15e58 100644 --- a/t/selenium/controller_subscriber.t +++ b/t/selenium/controller_subscriber.t @@ -33,8 +33,7 @@ sub ctr_subscriber { 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->wait_for_text('//*[@id="Customer_table"]/tbody/tr[1]/td[2]', $customerid), 'Customer found'); - $d->move_action(element=> $d->find_element('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]')); - $d->find_element('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]')->click(); + $d->move_and_click('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]', 'xpath', '//*[@id="Customer_table_filter"]//input'); diag("Trying to add a Subscriber"); $d->find_element('//*[@id="customer_details"]//div//a[contains(text(), "Subscribers")]')->click(); @@ -127,8 +126,7 @@ sub ctr_subscriber { ok($d->wait_for_text('//*[@id="subscriber_table"]/tbody/tr/td[5]', $domainstring), 'Domain name is correct'); diag('Go to Subscriber details'); - $d->move_action(element => $d->find_element('//*[@id="subscriber_table"]/tbody/tr[1]/td/div/a[contains(text(), "Details")]')); - $d->find_element('//*[@id="subscriber_table"]/tbody/tr[1]/td/div/a[contains(text(), "Details")]')->click(); + $d->move_and_click('//*[@id="subscriber_table"]/tbody/tr[1]/td/div/a[contains(text(), "Details")]', 'xpath', '//*[@id="subscriber_table_filter"]//input'); diag('Edit master data'); $d->find_element('//*[@id="subscriber_data"]//div//a[contains(text(), "Master Data")]')->click(); @@ -288,8 +286,7 @@ sub ctr_subscriber { ok($d->find_element_by_css('#subscriber_table tr > td.dataTables_empty'), 'Table is empty'); $d->fill_element('//*[@id="subscriber_table_filter"]/label/input', 'xpath', $username); ok($d->wait_for_text('//*[@id="subscriber_table"]/tbody/tr/td[4]', $username), 'Subscriber was found'); - $d->move_action(element => $d->find_element('//*[@id="subscriber_table"]/tbody/tr[1]/td/div/a[contains(text(), "Terminate")]')); - $d->find_element('//*[@id="subscriber_table"]/tbody/tr[1]/td/div/a[contains(text(), "Terminate")]')->click(); + $d->move_and_click('//*[@id="subscriber_table"]/tbody/tr[1]/td/div/a[contains(text(), "Terminate")]', 'xpath', '//*[@id="subscriber_table_filter"]//input'); $d->find_element('//*[@id="dataConfirmOK"]')->click(); diag('Check if Subscriber has been deleted');