@ -49,6 +49,9 @@ class testrun(unittest.TestCase):
resellername = " reseller " + str ( random . randint ( 1 , 99999 ) )
resellercontract = " contract " + str ( random . randint ( 1 , 99999 ) )
email = " test " + str ( random . randint ( 1 , 99999 ) ) + " @test.com "
adminname2 = " admin " + str ( random . randint ( 1 , 99999 ) )
resellername2 = " reseller " + str ( random . randint ( 1 , 99999 ) )
resellercontract2 = " contract " + str ( random . randint ( 1 , 99999 ) )
filename = " test_admin.png "
driver = self . driver
login_panel ( driver )
@ -56,6 +59,10 @@ class testrun(unittest.TestCase):
create_reseller_contract ( driver , resellercontract )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
create_reseller ( driver , resellername , resellercontract )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
create_reseller_contract ( driver , resellercontract2 )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
create_reseller ( driver , resellername2 , resellercontract2 )
print ( " Go to ' Administrators ' ... " , end = " " )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrators " )] ' ) . click ( )
@ -66,9 +73,30 @@ class testrun(unittest.TestCase):
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body/div//div[@class= " q-virtual-scroll__content " ]/div[1] ' ) ) )
driver . find_element_by_xpath ( ' /html/body/div//div[@class= " q-virtual-scroll__content " ]/div[1] ' ) . click ( )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//div[contains(., " Login " )]/../div/input ' , adminname )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//div[contains(., " Email " )]/../div/input ' , email )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//input[@aria-label= " Password " ] ' , ' administrato ' )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//input[@aria-label= " Password Retype " ] ' , ' administrato ' )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Superuser " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Superuser " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Master " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Master " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Customer Care " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Customer Care " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Active " ] ' ) . get_attribute ( ' aria-checked ' ) == " false " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Active " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Read Only " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Read Only " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Show Passwords " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Show Passwords " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Can Reset Password " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Can Reset Password " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Show CDRs " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Show CDRs " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Show Billing Info " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Show Billing Info " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Lawful Intercept " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " Lawful Intercept " ] ' ) . click ( )
if driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " System " ] ' ) . get_attribute ( ' aria-checked ' ) == " true " :
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/form//div[@aria-label= " System " ] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Save " )] ' ) . click ( )
print ( " OK " )
print ( " Check if Administrator was created... " , end = " " )
@ -78,9 +106,41 @@ class testrun(unittest.TestCase):
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//table/tbody/tr[1]/td[contains(., " ' + adminname + ' " )] ' ) ) > 0 , " Administrator was not found " )
print ( " OK " )
print ( " Try to log-in with new Administrator... " , end = " " )
print ( " Create a second Administrator... " , end = " " )
click_js ( driver , ' //*[@id= " q-app " ]/div//main//div/a[contains(., " add " )] ' )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//div[contains(., " Reseller " )]/../div/input ' , resellername2 )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body/div//div[@class= " q-virtual-scroll__content " ]/div[1] ' ) ) )
driver . find_element_by_xpath ( ' /html/body/div//div[@class= " q-virtual-scroll__content " ]/div[1] ' ) . click ( )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//div[contains(., " Login " )]/../div/input ' , adminname2 )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//input[@aria-label= " Password " ] ' , ' administrato ' )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main/form/div//label//input[@aria-label= " Password Retype " ] ' , ' administrato ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Save " )] ' ) . click ( )
print ( " OK " )
print ( " Try to login and check if admin is prohibited from changing his permissions... " , end = " " )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
logout_panel ( driver )
login_panel ( driver , adminname , ' administrato ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrators " )] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr/td[5] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[5]//div[@aria-checked= " false " ] ' ) ) > 0 , " ' Master ' permission was granted " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[6]//div[@aria-disabled= " true " ] ' ) ) > 0 , " ' Ccare ' toggle is not disabled " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[7]//div[@aria-disabled= " true " ] ' ) ) > 0 , " ' Active ' toggle is not disabled " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[8]//div[@aria-disabled= " true " ] ' ) ) > 0 , " ' Read-only ' toggle is not disabled " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[9]//div[@aria-disabled= " true " ] ' ) ) > 0 , " ' Show passwords ' toggle is not disabled " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[10]//div[@aria-disabled= " true " ] ' ) ) > 0 , " ' Show CDRs ' toggle is not disabled " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[11]//div[@aria-disabled= " true " ] ' ) ) > 0 , " ' Show billing ' info toggle is not disabled " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//table//tr[1]/td[12]//div[@aria-disabled= " true " ] ' ) ) > 0 , " ' Can reset password ' toggle is not disabled " )
print ( " OK " )
print ( " Go back to administrator login... " , end = " " )
logout_panel ( driver )
@ -88,35 +148,45 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrators " )] ' ) . click ( )
print ( " OK " )
print ( " Try to enable ' Read only ' for administrator... " , end = " " )
print ( " Try to enable ' Superuser ' for administrator... " , end = " " )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( ( By . XPATH , ' /html/body//div/main//div/label//div/input ' ) ) )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//table/tbody/tr[1]/td[contains(., " ' + adminname + ' " )] ' ) ) > 0 , " Administrator was not found " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main//div//table//tr[1]/td[9]/div ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div//main//table//tr[1]//td/button ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body//div/a[contains(., " Edit " )] ' ) ) )
driver . find_element_by_xpath ( ' /html/body//div/a[contains(., " Edit " )] ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[1] ' ) ) )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[1] ' ) . click ( )
time . sleep ( 1 )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Save " )] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Close " )] ' ) . click ( )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
print ( " OK " )
print ( " Check if ' Read-only ' was enabled... " , end = " " )
print ( " Check if ' Superuser' can edit admins from other resellers ..." , end = " " )
logout_panel ( driver )
login_panel ( driver , adminname , ' administrato ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Customers " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrato rs" )] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . implicitly_wait ( 1 )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//div/a[contains(., " Add " )] ' ) ) == 0 , " ' Add ' Button is still there " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Contacts " )] ' ) . click ( )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( ( By . XPATH , ' /html/body//div/main//div/label//div/input ' ) ) )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname2 )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . implicitly_wait ( 1 )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div//main//table//tr[1]//td/button ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body//div/a[contains(., " Edit " )] ' ) ) )
driver . find_element_by_xpath ( ' /html/body//div/a[contains(., " Edit " )] ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' //*[@id= " q-app " ]/div//main//form//div//label//div[contains(., " Email " )]/../div/input ' ) ) )
fill_element ( driver , ' //*[@id= " q-app " ]/div//main//form//div//label//div[contains(., " Email " )]/../div/input ' , email )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Save " )] ' ) . click ( )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//div/a[contains(., " Add " )] ' ) ) == 0 , " ' Add ' Button is still there " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Domains " )] ' ) . click ( )
len ( driver . find_elements_by_xpath ( ' /html/body//div[@role= " alert " ][contains(., " Administrator saved successfully " )] ' ) ) > 0 , " Admin could not be edited " )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . implicitly_wait ( 1 )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//div/a[contains(., " Add " )] ' ) ) == 0 , " ' Add ' Button is still there " )
driver . implicitly_wait ( 10 )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Close " )] ' ) . click ( )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
print ( " OK " )
print ( " Go back to administrator login... " , end = " " )
logout_panel ( driver )
@ -124,44 +194,86 @@ class testrun(unittest.TestCase):
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrators " )] ' ) . click ( )
print ( " OK " )
print ( " Try to enable ' Superuser ' for administrator ..." , end = " " )
print ( " Disable ' Superuser ' and enable ' master ' ..." , end = " " )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( ( By . XPATH , ' /html/body//div/main//div/label//div/input ' ) ) )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//table/tbody/tr[1]/td[contains(., " ' + adminname + ' " )] ' ) ) > 0 , " Administrator was not found " )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/ div//main//div// table/tbody /tr[1]/td[16] /button' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/ / div//main//table//tr[1]/ /td/button' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body//div/a[contains(., " Edit " )] ' ) ) )
driver . find_element_by_xpath ( ' /html/body//div/a[contains(., " Edit " )] ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[1]/div/div/div[1] ' ) ) )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[1]/div/div/div[1] ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[1] ' ) ) )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[1] ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[2] ' ) ) )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/form/div/div[2]/div/div[2] ' ) . click ( )
time . sleep ( 1 )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Save " )] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//button[contains(., " Close " )] ' ) . click ( )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
print ( " OK " )
print ( " Check if ' Superuser can still see entries with ' Read-only ' also enabled ..." , end = " " )
print ( " Check if ' master' is not allowed to edit admins from other resellers ..." , end = " " )
logout_panel ( driver )
login_panel ( driver , adminname , ' administrato ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Custome rs" )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrato rs" )] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . implicitly_wait ( 1 )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( ( By . XPATH , ' /html/body//div/main//div/label//div/input ' ) ) )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname2 )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//div/a[contains(., " Add " )] ' ) ) == 0 , " ' Add ' Button is still there " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Contacts " )] ' ) . click ( )
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]//div//main//div/i[contains(., " warning " )] ' ) ) > 0 , " Second administrator should not appear " )
print ( " OK " )
print ( " Go back to administrator login... " , end = " " )
logout_panel ( driver )
login_panel ( driver )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrators " )] ' ) . click ( )
print ( " OK " )
print ( " Try to enable ' Customer Care ' ... " , end = " " )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( ( By . XPATH , ' /html/body//div/main//div/label//div/input ' ) ) )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//table/tbody/tr[1]/td[contains(., " ' + adminname + ' " )] ' ) ) > 0 , " Administrator was not found " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[7] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . implicitly_wait ( 1 )
print ( " OK " )
print ( " Check if ' Customer Care ' is enabled... " , end = " " )
logout_panel ( driver )
login_panel ( driver , adminname , ' administrato ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//div/a[contains(., " Add " )] ' ) ) == 0 , " ' Add ' Button is still there " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Domains " )] ' ) . click ( )
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]//div//aside//div//a[1][contains(., " Customers " )] ' ) ) > 0 , " Customers buttons was not found " )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]//div//aside//div//a[2][contains(., " Subscribers " )] ' ) ) > 0 , " Subscribers buttons was not found " )
print ( " OK " )
print ( " Go back to administrator login... " , end = " " )
logout_panel ( driver )
login_panel ( driver )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Administrators " )] ' ) . click ( )
print ( " OK " )
print ( " Try to enable ' Read-only ' ... " , end = " " )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
WebDriverWait ( driver , 10 ) . until ( EC . element_to_be_clickable ( ( By . XPATH , ' /html/body//div/main//div/label//div/input ' ) ) )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//table/tbody/tr[1]/td[contains(., " ' + adminname + ' " )] ' ) ) > 0 , " Administrator was not found " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[9] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
print ( " OK " )
print ( " Check if ' Read-only ' was enabled... " , end = " " )
logout_panel ( driver )
login_panel ( driver , adminname , ' administrato ' )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div/div[2]//div[contains(., " Settings " )] ' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div/aside/div//a[contains(., " Customers " )] ' ) . click ( )
wait_for_invisibility ( driver , ' //*[@id= " q-app " ]/div//main//div/table/thead/tr[2]/th/div[@role= " progressbar " ] ' )
driver . implicitly_wait ( 1 )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main//div/a[contains(., " Add " )] ' ) ) == 0 , " ' Add ' Button is still there " )
driver . implicitly_wait ( 10 )
print ( " OK " )
print ( " Go back to administrator login... " , end = " " )
logout_panel ( driver )
@ -196,7 +308,7 @@ class testrun(unittest.TestCase):
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//table/tbody/tr[1]/td[contains(., " ' + adminname + ' " )] ' ) ) > 0 , " Administrator was not found " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/ div//main//div// table/tbody /tr[1]/td[16] /button' ) . click ( )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]/ / div//main//table//tr[1]/ /td/button' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body/div[4]/div/div ' ) ) )
driver . find_element_by_xpath ( ' /html/body/div[4]/div/div ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body/div[4]/div[2]/div/div[3]/button[2] ' ) ) )
@ -204,9 +316,24 @@ class testrun(unittest.TestCase):
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]//div//main//div//i ' ) ) > 0 , " Admin was not deleted " )
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]//div//main//div/i[contains(., " warning " )] ' ) ) > 0 , " Admin was not deleted " )
print ( " OK " )
print ( " Try to delete second administrator... " , end = " " )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname2 )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]/div//main/div//table/tbody/tr[1]/td[contains(., " ' + adminname2 + ' " )] ' ) ) > 0 , " Administrator was not found " )
driver . find_element_by_xpath ( ' //*[@id= " q-app " ]//div//main//table//tr[1]//td/button ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body/div[4]/div/div ' ) ) )
driver . find_element_by_xpath ( ' /html/body/div[4]/div/div ' ) . click ( )
WebDriverWait ( driver , 10 ) . until ( EC . visibility_of_element_located ( ( By . XPATH , ' /html/body/div[4]/div[2]/div/div[3]/button[2] ' ) ) )
driver . find_element_by_xpath ( ' /html/body/div[4]/div[2]/div/div[3]/button[2] ' ) . click ( )
wait_for_invisibility ( driver , ' /html/body//div/main//div/label//div/input[contains(@class, " q-field--disabled " )] ' )
fill_element ( driver , ' /html/body//div/main//div/label//div/input ' , adminname2 )
self . assertTrue (
len ( driver . find_elements_by_xpath ( ' //*[@id= " q-app " ]//div//main//div/i[contains(., " warning " )] ' ) ) > 0 , " Admin was not deleted " )
print ( " OK " )
delete_reseller ( driver , resellername )
delete_reseller ( driver , resellername2 )
filename = 0
"""