diff --git a/t/lib/Selenium/Collection/Common.pm b/t/lib/Selenium/Collection/Common.pm index 0f52ff49da..27e0d6181c 100644 --- a/t/lib/Selenium/Collection/Common.pm +++ b/t/lib/Selenium/Collection/Common.pm @@ -3,7 +3,7 @@ package Selenium::Collection::Common; use warnings; use strict; use Moo; - +use TryCatch; use Test::More import => [qw(diag ok is)]; has 'driver' => ( @@ -233,6 +233,16 @@ sub create_customer { $self->driver->find_element('#contactidtable tr > td.dataTables_empty', 'css'); $self->driver->fill_element('#contactidtable_filter input', 'css', $contactmail); $self->driver->select_if_unselected('//table[@id="contactidtable"]/tbody/tr[1]/td//input[@type="checkbox"]'); + try { + $self->driver->set_timeout("implicit", 2_000); + $self->driver->fill_element('#productidtable_filter input', 'css', 'thisshouldnotexist'); + $self->driver->find_element('#productidtable tr > td.dataTables_empty', 'css'); + $self->driver->fill_element('#productidtable_filter input', 'css', 'Basic'); + $self->driver->find_element_by_xpath('//*[@id="productidtable"]//tr[1]//td/input')->click(); + $self->driver->set_timeout("implicit", 10_000); + } catch { + $self->driver->set_timeout("implicit", 10_000); + }; $self->driver->fill_element('#billing_profileidtable_filter input', 'css', 'thisshouldnotexist'); $self->driver->find_element('#billing_profileidtable tr > td.dataTables_empty', 'css'); $self->driver->fill_element('#billing_profileidtable_filter input', 'css', $billingname); @@ -243,10 +253,6 @@ sub create_customer { $self->driver->find_element('//*[@id="status"]/option[contains(text(), "locked")]')->click(); } $self->driver->fill_element('#external_id', 'css', $customerid); - if(index($special, 'pbx') != -1) { - diag("Creating Customer for PBX testing"); - $self->driver->select_if_unselected('//table[@id="productidtable"]/tbody/tr[1]/td[contains(text(),"Basic SIP Account")]/..//input[@type="checkbox"]'); - } $self->driver->find_element('#save', 'css')->click(); ok($self->driver->find_element_by_xpath('//*[@id="content"]//div[contains(text(), "successfully created")]'), 'Correct Alert was shown'); } diff --git a/t/selenium/controller_customer.t b/t/selenium/controller_customer.t index 047869de19..bac99ec48b 100644 --- a/t/selenium/controller_customer.t +++ b/t/selenium/controller_customer.t @@ -35,12 +35,8 @@ $c->create_reseller_contract($contractid); $c->create_reseller($resellername, $contractid); $c->create_contact($contactmail, $resellername); $c->create_billing_profile($billingname, $resellername); +$c->create_customer($customerid, $contactmail, $billingname, 'locked'); -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();