@ -27,8 +27,14 @@ sub ctr_ncos {
$ d - > find_element ( '//*[@id="main-nav"]//*[contains(text(),"Settings")]' ) - > click ( ) ;
$ d - > find_element ( "NCOS Levels" , 'link_text' ) - > click ( ) ;
diag ( 'Trying to create a new administrator ') ;
diag ( 'Trying to create a empty NCOS Level ') ;
$ d - > find_element ( "Create NCOS Level" , 'link_text' ) - > click ( ) ;
$ d - > unselect_if_selected ( '//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input' , 'xpath' ) ;
$ 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(), "Level Name field is required")]' ) ) ;
diag ( 'Fill in values' ) ;
$ d - > fill_element ( '//*[@id="reselleridtable_filter"]/label/input' , 'xpath' , 'thisshouldnotexist' ) ;
@ -52,12 +58,37 @@ sub ctr_ncos {
ok ( $ d - > find_element_by_xpath ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[contains(text(), "blacklist")]' ) , "NCOS mode is correct" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[contains(text(), "This is a simple description")]' ) , "NCOS descriptions is correct" ) ;
diag ( 'Edit NCOS' ) ;
$ d - > move_and_click ( '//*[@id="ncos_level_table"]//tr[1]//td//a[contains(text(), "Edit")]' , 'xpath' , '//*[@id="ncos_level_table_filter"]//input' ) ;
$ ncosname = ( "ncos" . int ( rand ( 100000 ) ) . "level" ) ;
$ d - > fill_element ( '//*[@id="level"]' , 'xpath' , $ ncosname ) ;
$ d - > find_element ( '//*[@id="mode"]/option[@value="whitelist"]' ) - > click ( ) ;
$ d - > fill_element ( '//*[@id="description"]' , 'xpath' , "This is a very simple description" ) ;
$ d - > find_element ( '//*[@id="save"]' ) - > click ( ) ;
diag ( 'Search for 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' ) ;
$ d - > fill_element ( '//*[@id="ncos_level_table_filter"]/label/input' , 'xpath' , $ ncosname ) ;
diag ( "Check NCOS details" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[contains(text(), ' . $ resellername . ')]' ) , 'Reseller is correct' ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[contains(text(), ' . $ ncosname . ')]' ) , 'NCOS name is correct' ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[contains(text(), "whitelist")]' ) , "NCOS mode is correct" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[contains(text(), "This is a very simple description")]' ) , "NCOS descriptions is correct" ) ;
diag ( "Enter NCOS patterns" ) ;
$ d - > move_and_click ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td/div/a[contains(text(), "Patterns")]' , 'xpath' , '//*[@id="ncos_level_table_filter"]/label/input' ) ;
diag ( "Create new pattern" ) ;
$ d - > find_element ( "Create Pattern Entry" , 'link_text' ) - > click ( ) ;
diag ( "Click 'Save'" ) ;
$ d - > find_element ( '//*[@id="save"]' ) - > click ( ) ;
diag ( "Check Error messages" ) ;
ok ( $ d - > find_element_by_xpath ( '//form//div//span[contains(text(), "Pattern field is required")]' ) ) ;
diag ( "Enter pattern details" ) ;
$ d - > fill_element ( '//*[@id="pattern"]' , 'xpath' , '^439' ) ;
$ d - > fill_element ( '//*[@id="description"]' , 'xpath' , 'Austrian Premium Numbers' ) ;
@ -66,6 +97,16 @@ sub ctr_ncos {
diag ( "Check pattern details" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="number_pattern_table"]/tbody/tr/td[contains(text(), "^439")]' ) , "Pattern is correct" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="number_pattern_table"]/tbody/tr/td[contains(text(), "Austrian Premium Numbers")]' ) , "Description is correct" ) ;
diag ( "Edit NCOS Pattern" ) ;
$ d - > move_and_click ( '//*[@id="number_pattern_table"]//tr[1]//td//a[contains(text(), "Edit")]' , 'xpath' , '//*[@id="number_pattern_table_filter"]//input' ) ;
$ d - > fill_element ( '//*[@id="pattern"]' , 'xpath' , '^491' ) ;
$ d - > fill_element ( '//*[@id="description"]' , 'xpath' , 'German Premium Numbers' ) ;
$ d - > find_element ( '//*[@id="save"]' ) - > click ( ) ;
diag ( "Check pattern details" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="number_pattern_table"]/tbody/tr/td[contains(text(), "^491")]' ) , "Pattern is correct" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="number_pattern_table"]/tbody/tr/td[contains(text(), "German Premium Numbers")]' ) , "Description is correct" ) ;
= pod
diag ( "Create LNP entry" ) ;
$ d - > find_element ( "Create LNP Entry" , 'link_text' ) - > click ( ) ;
@ -138,14 +179,29 @@ sub ctr_ncos {
diag ( "Go back to NCOS page" ) ;
$ d - > find_element ( "Back" , 'link_text' ) - > click ( ) ;
diag ( "Trying to delete NCOS") ;
diag ( "Trying to NOT delete 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' ) ;
$ d - > fill_element ( '//*[@id="ncos_level_table_filter"]/label/input' , 'xpath' , $ ncosname ) ;
ok ( $ d - > wait_for_text ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[3]' , $ ncosname ) , "NCOS found" ) ;
$ d - > move_and_click ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td/div/a[contains(text(), "Delete")]' , 'xpath' , '//*[@id="ncos_level_table_filter"]/label/input' ) ;
$ d - > find_element ( '//*[@id="dataConfirmCancel"]' ) - > click ( ) ;
diag ( "Check if Entry is still here" ) ;
$ 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' ) ;
$ d - > fill_element ( '//*[@id="ncos_level_table_filter"]/label/input' , 'xpath' , $ ncosname ) ;
ok ( $ d - > wait_for_text ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td[3]' , $ ncosname ) , "NCOS still here" ) ;
diag ( "Trying to delete NCOS" ) ;
$ d - > move_and_click ( '//*[@id="ncos_level_table"]/tbody/tr[1]/td/div/a[contains(text(), "Delete")]' , 'xpath' , '//*[@id="ncos_level_table_filter"]/label/input' ) ;
$ d - > find_element ( '//*[@id="dataConfirmOK"]' ) - > click ( ) ;
diag ( "Check if Entry was deleted" ) ;
$ d - > fill_element ( '//*[@id="ncos_level_table_filter"]/label/input' , 'xpath' , $ ncosname ) ;
ok ( $ d - > find_element_by_css ( '#ncos_level_table tr > td.dataTables_empty' , 'css' ) , 'NCOS was deleted' ) ;
$ c - > delete_domain ( $ domainstring ) ;
$ c - > delete_reseller_contract ( $ contractid ) ;
$ c - > delete_reseller ( $ resellername ) ;