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