TT#82258 fix customer creation on pro machines with cloudpbx enabled

Some pro machines that are used for running tests have cloudpbx enabled and
when trying to create a customer on those it will fail, because it wont
select the product at all. this patch will select basic sip account as product
if cloudpbx is enabled

Change-Id: Ie6a4b5813017b245838b1f1ded875dab4975f52d
changes/24/40224/11
Nico Schedel 5 years ago
parent ddd35a292e
commit 32c2cff56c

@ -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');
}

@ -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();

Loading…
Cancel
Save