@ -63,6 +63,7 @@ ok($d->find_element_by_css('#InvoiceTemplate_table tr > td.dataTables_empty', 'c
$ d - > fill_element ( '//*[@id="InvoiceTemplate_table_filter"]/label/input' , 'xpath' , $ templatename ) ;
diag ( "Check details" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="content"]//div[contains(text(), "Invoice template successfully created")]' ) , "Label 'Invoice template successfully created' was shown" ) ;
ok ( $ d - > wait_for_text ( '//*[@id="InvoiceTemplate_table"]/tbody/tr/td[2]' , $ resellername ) , 'Reseller is correct' ) ;
ok ( $ d - > wait_for_text ( '//*[@id="InvoiceTemplate_table"]/tbody/tr/td[3]' , $ templatename ) , 'Name is correct' ) ;
ok ( $ d - > wait_for_text ( '//*[@id="InvoiceTemplate_table"]/tbody/tr/td[4]' , 'svg' ) , 'Type is correct' ) ;
@ -79,6 +80,7 @@ ok($d->find_element_by_css('#InvoiceTemplate_table tr > td.dataTables_empty', 'c
$ d - > fill_element ( '//*[@id="InvoiceTemplate_table_filter"]/label/input' , 'xpath' , $ templatename ) ;
diag ( "Check details" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="content"]//div[contains(text(), "Invoice template successfully updated")]' ) , "Label 'Invoice template successfully updated' was shown" ) ;
ok ( $ d - > wait_for_text ( '//*[@id="InvoiceTemplate_table"]/tbody/tr/td[2]' , $ resellername ) , 'Reseller is correct' ) ;
ok ( $ d - > wait_for_text ( '//*[@id="InvoiceTemplate_table"]/tbody/tr/td[3]' , $ templatename ) , 'Name is correct' ) ;
ok ( $ d - > wait_for_text ( '//*[@id="InvoiceTemplate_table"]/tbody/tr/td[4]' , 'svg' ) , 'Type is correct' ) ;
@ -120,6 +122,7 @@ ok($d->find_element_by_css('#Invoice_table tr > td.dataTables_empty', 'css'), 'G
$ d - > fill_element ( '//*[@id="Invoice_table_filter"]/label/input' , 'xpath' , $ contactmail ) ;
diag ( "Check details" ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="content"]//div[contains(text(), "successfully created")]' ) , "Label 'Invoice template successfully created' was shown" ) ;
ok ( $ d - > wait_for_text ( '//*[@id="Invoice_table"]/tbody/tr/td[2]' , $ customernumber ) , 'Customer# is correct' ) ;
ok ( $ d - > wait_for_text ( '//*[@id="Invoice_table"]/tbody/tr/td[3]' , $ contactmail ) , 'Customer Email is correct' ) ;
@ -140,6 +143,7 @@ $d->find_element('//*[@id="dataConfirmOK"]')->click();
diag ( "Check if Invoice has been deleted" ) ;
$ d - > fill_element ( '//*[@id="Invoice_table_filter"]/label/input' , 'xpath' , $ contactmail ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="content"]//div[contains(text(), "Invoice successfully deleted")]' ) , "Label 'Invoice template successfully created' was shown" ) ;
ok ( $ d - > find_element_by_css ( '#Invoice_table tr > td.dataTables_empty' , 'css' ) , 'Invoice was deleted' ) ;
diag ( "Go to Invoice Templates page" ) ;
@ -153,21 +157,19 @@ $d->fill_element('//*[@id="InvoiceTemplate_table_filter"]/label/input', 'xpath',
$ d - > move_and_click ( '//*[@id="InvoiceTemplate_table"]//tr[1]//td//a[contains(text(), "Delete")]' , 'xpath' , '//*[@id="InvoiceTemplate_table_filter"]/label/input' ) ;
$ d - > find_element ( '//*[@id="dataConfirmCancel"]' ) - > click ( ) ;
diag ( "Check if Invoice Template was deleted ") ;
diag ( "Check if Invoice Template is still here ") ;
$ d - > fill_element ( '//*[@id="InvoiceTemplate_table_filter"]/label/input' , 'xpath' , 'thisshouldnotexist' ) ;
ok ( $ d - > find_element_by_css ( '#InvoiceTemplate_table tr > td.dataTables_empty' , 'css' ) , 'Garbage text was not found' ) ;
$ d - > fill_element ( '//*[@id="InvoiceTemplate_table_filter"]/label/input' , 'xpath' , $ templatename ) ;
ok ( $ d - > wait_for_text ( '//*[@id="InvoiceTemplate_table"]/tbody/tr/td[3]' , $ templatename ) , 'Template is still here' ) ;
diag ( "Trying to delete Invoice Template" ) ;
$ d - > fill_element ( '//*[@id="InvoiceTemplate_table_filter"]/label/input' , 'xpath' , 'thisshouldnotexist' ) ;
ok ( $ d - > find_element_by_css ( '#InvoiceTemplate_table tr > td.dataTables_empty' , 'css' ) , 'Garbage text was not found' ) ;
$ d - > fill_element ( '//*[@id="InvoiceTemplate_table_filter"]/label/input' , 'xpath' , $ templatename ) ;
$ d - > move_and_click ( '//*[@id="InvoiceTemplate_table"]//tr[1]//td//a[contains(text(), "Delete")]' , 'xpath' , '//*[@id="InvoiceTemplate_table_filter"]/label/input' ) ;
$ d - > find_element ( '//*[@id="dataConfirmOK"]' ) - > click ( ) ;
diag ( "Check if Invoice Template was deleted" ) ;
$ d - > fill_element ( '//*[@id="InvoiceTemplate_table_filter"]/label/input' , 'xpath' , $ templatename ) ;
ok ( $ d - > find_element_by_xpath ( '//*[@id="content"]//div[contains(text(), "Invoice template successfully deleted")]' ) , "Label 'Invoice template successfully deleted' was shown" ) ;
ok ( $ d - > find_element_by_css ( '#InvoiceTemplate_table tr > td.dataTables_empty' , 'css' ) , 'Invoice Template was deleted' ) ;
$ c - > delete_customer ( $ customerid ) ;