diff --git a/t/selenium/controller_billing.t b/t/selenium/controller_billing.t index 1ddc7a7aac..52678912ad 100644 --- a/t/selenium/controller_billing.t +++ b/t/selenium/controller_billing.t @@ -24,10 +24,7 @@ my $run_ok = 0; $c->login_ok(); $c->create_reseller_contract($contractid); $c->create_reseller($resellername, $contractid); - -diag("Go to 'Billing Profiles' page"); -$d->find_element('//*[@class="brand"]')->click(); -$d->find_element('//*[@id="content"]//div[contains(text(), "Billing")]/../../div/a')->click(); +$c->create_billing_profile($billingname, $resellername); diag("Try to create an empty Billing Profile"); $d->find_element('Create Billing Profile', 'link_text')->click(); @@ -37,10 +34,7 @@ diag("Check error messages"); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Reseller field is required")]')); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Handle field is required")]')); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Name field is required")]')); - -diag("Create a legit Billing Profile"); $d->find_element('//*[@id="mod_close"]')->click(); -$c->create_billing_profile($billingname, $resellername); diag("Search Billing Profile"); $d->fill_element('//*[@id="billing_profile_table_filter"]//input', 'xpath', 'thisshouldnotexist'); diff --git a/t/selenium/controller_customer.t b/t/selenium/controller_customer.t index 417704fab7..44d455fe7e 100644 --- a/t/selenium/controller_customer.t +++ b/t/selenium/controller_customer.t @@ -36,9 +36,11 @@ $c->create_reseller($resellername, $contractid); $c->create_contact($contactmail, $resellername); $c->create_billing_profile($billingname, $resellername); -diag("Go to 'Customers' page"); -$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click(); -$d->find_element('Customers', 'link_text')->click(); +if($pbx == 1){ + $c->create_customer($customerid, $contactmail, $billingname, 'pbx locked'); +} else { + $c->create_customer($customerid, $contactmail, $billingname, 'locked'); +} diag("Try to create an empty Customer"); $d->find_element('Create Customer', 'link_text')->click(); @@ -51,16 +53,8 @@ $d->find_element('#save', 'css')->click(); diag("Check if error messages appear"); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Contact field is required")]')); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Invalid \'billing_profile_id\', not defined.")]')); - -diag("Continuing creating a legit customer"); $d->find_element('//*[@id="mod_close"]')->click(); -if($pbx == 1){ - $c->create_customer($customerid, $contactmail, $billingname, 'pbx locked'); -} else { - $c->create_customer($customerid, $contactmail, $billingname, 'locked'); -} - diag("Search Customer"); $d->fill_element('#Customer_table_filter input', 'css', 'thisshouldnotexist'); ok($d->find_element_by_css('#Customer_table tr > td.dataTables_empty', 'css'), 'Garbage test was not found'); @@ -73,8 +67,6 @@ ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text( ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(), "' . $billingname . '")]'), 'Billing Profile is correct'); ok($d->find_element_by_xpath('//*[@id="Customer_table"]//tr[1]/td[contains(text(), "locked")]'), 'Status is correct'); $custnum = $d->get_text('//*[@id="Customer_table"]//tr[1]//td[1]'); -$compstring = "Customer #" . $custnum . " successfully created - Details"; -is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), $compstring, 'Correct Alert was shown'); diag("Check if Customer is locked"); $d->move_and_click('//*[@id="Customer_table"]/tbody/tr[1]//td//div//a[contains(text(),"Details")]', 'xpath', '//*[@id="Customer_table_filter"]//input'); diff --git a/t/selenium/controller_domain.t b/t/selenium/controller_domain.t index 4564eec8a9..8a362def8a 100644 --- a/t/selenium/controller_domain.t +++ b/t/selenium/controller_domain.t @@ -19,7 +19,7 @@ my $run_ok = 0; $c->login_ok(); $c->create_domain($domainstring); -diag("Try to add an empty Domain"); +diag("Try to create an empty Domain"); $d->find_element('Create Domain', 'link_text')->click(); $d->find_element('//*[@id="save"]')->click(); diff --git a/t/selenium/controller_ncos.t b/t/selenium/controller_ncos.t index b477cde8f4..fa6fec1d5c 100644 --- a/t/selenium/controller_ncos.t +++ b/t/selenium/controller_ncos.t @@ -25,6 +25,7 @@ my $run_ok = 0; $c->login_ok(); $c->create_reseller_contract($contractid); $c->create_reseller($resellername, $contractid); +$c->create_ncos($resellername, $ncosname); diag("Go to 'Number Porting' page"); $d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click(); @@ -85,9 +86,6 @@ ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Reseller field ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Level Name field is required")]')); $d->find_element('//*[@id="mod_close"]')->click(); -diag("Create a normal NCOS"); -$c->create_ncos($resellername, $ncosname); - diag("Search our new NCOS"); $d->fill_element('//*[@id="ncos_level_table_filter"]/label/input', 'xpath', 'thisshouldnotexist'); ok($d->find_element_by_css('#ncos_level_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); diff --git a/t/selenium/controller_reseller.t b/t/selenium/controller_reseller.t index 65fb02a1f2..b589eb8e85 100644 --- a/t/selenium/controller_reseller.t +++ b/t/selenium/controller_reseller.t @@ -20,10 +20,7 @@ my $run_ok = 0; $c->login_ok(); $c->create_reseller_contract($contractid); - -diag("Go to 'Resellers' page"); -$d->find_element('//*[@class="brand"]')->click(); -$d->find_element('//*[@id="content"]//div[contains(text(), "Resellers")]/../../div/a')->click(); +$c->create_reseller($resellername, $contractid); diag("Try to create an empty Reseller"); $d->find_element('Create Reseller', 'link_text')->click(); @@ -33,10 +30,7 @@ $d->find_element('//*[@id="save"]')->click(); diag("Check error messages"); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Contract field is required")]')); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Name field is required")]')); - -diag("Create a legit Reseller"); $d->find_element('#mod_close', 'css')->click(); -$c->create_reseller($resellername, $contractid); diag("Search Reseller"); $d->fill_element('#Resellers_table_filter label input', 'css', 'thisshouldnotexist'); diff --git a/t/selenium/controller_rw_ruleset.t b/t/selenium/controller_rw_ruleset.t index 221da3c933..2a0e0e0a3f 100644 --- a/t/selenium/controller_rw_ruleset.t +++ b/t/selenium/controller_rw_ruleset.t @@ -22,12 +22,9 @@ my $run_ok = 0; $c->login_ok(); $c->create_reseller_contract($contractid); $c->create_reseller($resellername, $contractid); +$c->create_rw_ruleset($rulesetname, $resellername); -diag("Go to 'Rewrite Rule Sets' page"); -$d->find_element('//*[@id="main-nav"]//*[contains(text(),"Settings")]')->click(); -$d->find_element('Rewrite Rule Sets', 'link_text')->click(); - -diag("Try to create a empty Rewrite Rule Set"); +diag("Try to create an empty Rewrite Rule Set"); $d->find_element('Create Rewrite Rule Set', 'link_text')->click(); $d->unselect_if_selected('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input'); $d->find_element('//*[@id="save"]')->click(); @@ -35,13 +32,9 @@ $d->find_element('//*[@id="save"]')->click(); diag("Check error messages"); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Reseller field is required")]')); ok($d->find_element_by_xpath('//form//div//span[contains(text(), "Name field is required")]')); - -diag("Create a legit Rewrite Rule Set"); $d->find_element('#mod_close', 'css')->click(); -$c->create_rw_ruleset($rulesetname, $resellername); diag("Search Rewrite Rule Set"); -is($d->get_text_safe('//*[@id="content"]//div[contains(@class, "alert")]'), 'Rewrite rule set successfully created', 'Correct Alert was shown'); $d->fill_element('//*[@id="rewrite_rule_set_table_filter"]/label/input', 'xpath', 'thisshouldnotexist'); ok($d->find_element_by_css('#rewrite_rule_set_table tr > td.dataTables_empty', 'css'), 'Garbage text was not found'); $d->fill_element('//*[@id="rewrite_rule_set_table_filter"]/label/input', 'xpath', $rulesetname);