TT#122872 selenium: fix many many button positions

tests can finally run again

Change-Id: Ie775125a97221f712024684b16566dee2136ced0
mr10.2
Nico Schedel 4 years ago
parent 8c556bbe36
commit 88536612b8

@ -38,8 +38,8 @@ def logout_panel(driver):
def create_reseller(driver, resellername, contractname):
print("Go to 'Reseller'...", end="")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[2]')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[2]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]').click()
print("OK")
print("Try to create a new Reseller...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/a[contains(., "Add")]').click()
@ -53,15 +53,15 @@ def create_reseller(driver, resellername, contractname):
def delete_reseller(driver, reseller):
print("Go to 'Reseller'...", end="")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[2]')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[2]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]').click()
print("OK")
print("Try to delete Reseller...", end="")
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', reseller)
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[contains(., "' + reseller + '")]')))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[7]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[7]/button').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/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]')))
@ -72,8 +72,8 @@ def delete_reseller(driver, reseller):
def create_reseller_contract(driver, contractname):
print("Go to 'Contracts'...", end="")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[4]')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[4]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Contracts")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Contracts")]').click()
print("OK")
print("Try to create a new Reseller Contract...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -100,15 +100,15 @@ def create_reseller_contract(driver, contractname):
def delete_reseller_contract(driver, contract):
print("Go to 'Contracts'...", end="")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[4]')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[4]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Contracts")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Contracts")]').click()
print("OK")
print("Try to delete Reseller Contract...", end="")
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', contract)
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr/td[contains(., "' + contract + '")]')))
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr/td[8]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr/td[8]/button').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/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]')))
@ -119,8 +119,8 @@ def delete_reseller_contract(driver, contract):
def create_billing_profile(driver, billingname, billingrealname, reseller):
print("Go to 'Billing Profiles'...", end="")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[10]')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[10]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Billing Profile")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Billing Profile")]').click()
print("OK")
print("Try to create a new Billing Profile...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div/div[2]/div[1]/div[1]/a').click()
@ -135,16 +135,16 @@ def create_billing_profile(driver, billingname, billingrealname, reseller):
def delete_billing_profile(driver, billingrealname):
print("Go to 'Billing Profiles'...", end="")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[10]')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[2]/div/div[2]/a[10]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Billing Profile")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Billing Profile")]').click()
print("OK")
print("Try to delete Billing Profile...", 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', billingrealname)
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div/table/thead/tr[2]/th/div[@role="progressbar"]')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div//main/div//table/tbody/tr[1]/td[7]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div//main/div//table/tbody/tr[1]/td[7]/button').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button').click()
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div[4]/div/div[2]')))
driver.find_element_by_xpath('/html/body/div[4]/div/div[2]').click()
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div[4]/div[2]/div/div[3]/button[2]')))

@ -55,7 +55,7 @@ class testrun(unittest.TestCase):
filename = "test_admin.png"
driver = self.driver
login_panel(driver)
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div/div[2]//div[contains(., "Settings")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
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)
@ -65,7 +65,7 @@ class testrun(unittest.TestCase):
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()
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]').click()
print("OK")
print("Try to create a new Administrator...", end="")
click_js(driver, '//*[@id="q-app"]/div//main//div/a[contains(., "add")]')
@ -120,33 +120,35 @@ class testrun(unittest.TestCase):
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[6]//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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[7]//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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[8]//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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[9]//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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[10]//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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[11]//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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[12]//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")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//table//tr[1]/td[13]//div[@aria-disabled="true"]')) > 0, "'Can reset password' toggle is not disabled")
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
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="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -169,8 +171,9 @@ class testrun(unittest.TestCase):
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(., "Administrators")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
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"]')
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')))
@ -191,8 +194,9 @@ class testrun(unittest.TestCase):
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]').click()
print("OK")
print("Disable 'Superuser' and enable 'master'...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -217,8 +221,9 @@ class testrun(unittest.TestCase):
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(., "Administrators")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
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"]')
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')))
@ -229,8 +234,9 @@ class testrun(unittest.TestCase):
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
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")]')
@ -238,13 +244,13 @@ 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/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[7]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[8]').click()
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div/table/thead/tr[2]/th/div[@role="progressbar"]')
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//aside//div//a[1][contains(., "Customers")]')) > 0, "Customers buttons was not found")
self.assertTrue(
@ -253,8 +259,9 @@ class testrun(unittest.TestCase):
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
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")]')
@ -262,14 +269,15 @@ 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/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[9]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[10]').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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Customers")]')))
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(
@ -278,8 +286,9 @@ class testrun(unittest.TestCase):
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]').click()
print("OK")
print("Try to deactivate administrator...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -287,7 +296,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//tr[1]/td[8]/div').click()
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"]')
print("OK")
print("Check if admin was deactivated...", end="")
@ -301,8 +310,9 @@ class testrun(unittest.TestCase):
print("OK")
print("Try to delete administrator...", end="")
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()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]').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', adminname)
@ -397,9 +407,10 @@ class testrun(unittest.TestCase):
filename = "test_contact.png"
driver = self.driver
login_panel(driver)
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div/div[2]//div[contains(., "Settings")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
print("Go to 'Contacts'...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div//a[contains(., "Contacts")]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Contacts")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Contacts")]').click()
print("OK")
print("Try to create a new customer contact with an invalid Email...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -426,25 +437,25 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main/div//table/tbody/tr[1]/td[contains(., "' + contactmail + '")]')) > 0, "Contact was not found")
print("OK")
print("Try to add first and last name to contact...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[4]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[5]/span').click()
fill_element(driver, '/html/body//div//label//div//input[@aria-label="First Name"]', firstname)
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div/main//div/label//div/input')))
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + firstname + '")]')) > 0, "Contact first name was not changed")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[5]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[6]/span').click()
fill_element(driver, '/html/body//div//label//div//input[@aria-label="Last Name"]', lasttname)
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').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', lasttname)
fill_element(driver, '/html/body//div/main//div/label//div/input', contactmail)
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + lasttname + '")]')) > 0, "Contact last name was not changed")
print("OK")
print("Try to delete contact...", 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//main//div//table/tbody/tr[1]/td[8]/button').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[2]/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]')))
@ -475,25 +486,25 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main/div//table/tbody/tr[1]/td[contains(., "' + contactmail + '")]')) > 0, "Contact was not found")
print("OK")
print("Try to add first and last name to contact...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[4]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[5]/span').click()
fill_element(driver, '/html/body//div//label//div//input[@aria-label="First Name"]', firstname)
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div/main//div/label//div/input')))
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + firstname + '")]')) > 0, "Contact first name was not changed")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[5]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[6]/span').click()
fill_element(driver, '/html/body//div//label//div//input[@aria-label="Last Name"]', lasttname)
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').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', lasttname)
fill_element(driver, '/html/body//div/main//div/label//div/input', contactmail)
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + lasttname + '")]')) > 0, "Contact last name was not changed")
print("OK")
print("Try to edit and reset edits to system contact...", 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//main//div//table/tbody/tr[1]/td[8]/button').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[2]/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()
fill_element(driver, '//*[@id="q-app"]//div/main//form//div/label//div/input[@aria-label="Company"]', contactmail)
@ -509,9 +520,10 @@ class testrun(unittest.TestCase):
filename = "test_contracts.png"
driver = self.driver
login_panel(driver)
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div/div[2]//div[contains(., "Settings")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
print("Go to 'Contracts'...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div//a[contains(., "Contracts")]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Contracts")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Contracts")]').click()
print("OK")
print("Try to create a new peering contract...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -541,7 +553,7 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + contractname + '")]')) > 0, "Reseller was not found")
print("OK")
print("Try to edit contract status...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[7]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[8]/span').click()
wait_for_invisibility(driver, '/html/body//div[@class="q-transition--fade-enter q-transition--fade-enter-active"]')
click_js(driver, '/html/body//div//label//div/span[contains(., "Active")]')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div[@class="q-item__label"][contains(., "Locked")]')))
@ -549,11 +561,11 @@ class testrun(unittest.TestCase):
wait_for_invisibility(driver, '/html/body/div[@role="listbox"]')
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[7]/span[contains(., "Locked")]')) > 0, "Subscriber status was not edited")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[8]/span[contains(., "Locked")]')) > 0, "Subscriber status was not edited")
print("OK")
print("Try to delete contract...", 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//main//div//table/tbody/tr[1]/td[8]/button').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[2]/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]')))
@ -591,7 +603,7 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + contractname + '")]')) > 0, "Reseller was not found")
print("OK")
print("Try to edit contract status...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[7]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[8]/span').click()
wait_for_invisibility(driver, '/html/body//div[@class="q-transition--fade-enter q-transition--fade-enter-active"]')
click_js(driver, '/html/body//div//label//div/span[contains(., "Active")]')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div[@class="q-item__label"][contains(., "Locked")]')))
@ -599,11 +611,12 @@ class testrun(unittest.TestCase):
wait_for_invisibility(driver, '/html/body/div[@role="listbox"]')
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[7]/span[contains(., "Locked")]')) > 0, "Subscriber status was not edited")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[8]/span[contains(., "Locked")]')) > 0, "Contract status was not edited")
print("OK")
print("Try to delete contract...", 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//main//div//table/tbody/tr[1]/td[8]/button').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/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]')))
@ -621,9 +634,10 @@ class testrun(unittest.TestCase):
filename = "test_customer.png"
driver = self.driver
login_panel(driver)
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div/div[2]//div[contains(., "Settings")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
print("Go to 'Customers'...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div//a[contains(., "Customers")]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Customers")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Customers")]').click()
print("OK")
print("Try to create a new customer...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -651,9 +665,9 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + customername + '")]')) > 0, "Reseller was not found")
print("OK")
print("Try to edit customer status...", end="")
scroll_to_element(driver, '//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[10]/span')
scroll_to_element(driver, '//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[11]/span')
time.sleep(1)
click_js(driver, '//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[10]/span')
click_js(driver, '//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[11]/span')
wait_for_invisibility(driver, '/html/body//div[@class="q-transition--fade-enter q-transition--fade-enter-active"]')
click_js(driver, '/html/body//div//label//div/span[contains(., "Active")]')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div[@class="q-item__label"][contains(., "Locked")]')))
@ -661,11 +675,10 @@ class testrun(unittest.TestCase):
wait_for_invisibility(driver, '/html/body/div[@role="listbox"]')
click_js(driver, '/html/body//div/button[contains(., "Save")]')
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[10]/span[contains(., "Locked")]')) > 0, "Subscriber status was not edited")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[11]/span[contains(., "Locked")]')) > 0, "Customer status was not edited")
print("OK")
print("Go to customer preferences...", end="")
scroll_to_element(driver, '//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[12]/button')
click_js(driver, '//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[12]/button')
click_js(driver, '//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[2]/button')
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body//div/a[contains(., "Preferences")]')))
driver.find_element_by_xpath('/html/body//div/a[contains(., "Preferences")]').click()
print("OK")
@ -693,12 +706,12 @@ class testrun(unittest.TestCase):
driver.find_element_by_xpath('/html/body//div//main//div//label//div/input[@aria-label="Maximum number of concurrent calls"]').get_attribute('value') == '', 'Saved value is not correct')
print("OK")
print("Try to delete customer...", end="")
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(., "Customers")]').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', customername)
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + customername + '")]')))
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[12]/button').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/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]')))
@ -716,9 +729,10 @@ class testrun(unittest.TestCase):
filename = "test_domain.png"
driver = self.driver
login_panel(driver)
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div/div[2]//div[contains(., "Settings")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
print("Go to 'Domains'...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div//a[contains(., "Domains")]').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Domains")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Domains")]').click()
print("OK")
print("Try to create a new domain...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -736,7 +750,7 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main/div//table/tbody/tr[1]/td[contains(., "' + domainname + '")]')) > 0, "Billing Profile was not found")
print("OK")
print("Try to open the domain preferences page...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[4]/button').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[2]/button').click()
WebDriverWait(driver, 10.).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div/a[contains(., "Preferences")]')))
driver.find_element_by_xpath('/html/body//div/a[contains(., "Preferences")]').click()
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div[@role="progressbar"]')
@ -785,14 +799,14 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('/html/body//div//main//div[contains(., "10.0.0.2")]')) == 0, 'IP address 10.0.0.2 was not deleted')
driver.implicitly_wait(10)
print("OK")
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div//a[contains(., "Domains")]').click()
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Domains")]').click()
print("Try to delete domain...", 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', domainname)
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div/table/thead/tr[2]/th/div[@role="progressbar"]')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div/main//div/table/tbody/tr[1]/td[4]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]//div/main//div/table/tbody/tr[1]/td[4]/button').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((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]')))
@ -874,50 +888,52 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main/div[2]/div/div[contains(., "Customers")]')) > 0, "Customers page wasn't opened")
driver.find_element_by_xpath('//*[@id="q-app"]/div//aside//div/label/div/div/div[3]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//aside//div/a[contains(., "Dashboard")]').click()
print("OK")
print("Try to change language to German...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[3]').click()
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[@class="q-menu q-position-engine scroll"]/div[3]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside/div/div[2]/a[contains(., "Übersicht")]')) > 0, "Language wasn't changed")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside//div//a[contains(., "Übersicht")]')) > 0, "Language wasn't changed")
print("OK")
print("Try to change language to Spanish...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[3]').click()
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[@class="q-menu q-position-engine scroll"]/div[4]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside/div/div[2]/a[contains(., "Tablón")]')) > 0, "Language wasn't changed")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside//div//a[contains(., "Tablón")]')) > 0, "Language wasn't changed")
print("OK")
print("Try to change language to French...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[3]').click()
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[@class="q-menu q-position-engine scroll"]/div[5]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside/div/div[2]/a[contains(., "Tableau de bord")]')) > 0, "Language wasn't changed")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside//div//a[contains(., "Tableau de bord")]')) > 0, "Language wasn't changed")
print("OK")
print("Try to change language to Italian...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[3]').click()
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[@class="q-menu q-position-engine scroll"]/div[6]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside/div/div[2]/a[contains(., "Dashboard")]')) > 0, "Language wasn't changed")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside//div//a[contains(., "Dashboard")]')) > 0, "Language wasn't changed")
print("OK")
print("Try to change language to Russian...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[3]').click()
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[@class="q-menu q-position-engine scroll"]/div[7]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside/div/div[2]/a[contains(., "Главная")]')) > 0, "Language wasn't changed")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside//div//a[contains(., "Главная")]')) > 0, "Language wasn't changed")
print("OK")
print("Try to change language back to English...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[3]').click()
time.sleep(1)
driver.find_element_by_xpath('/html/body/div[@class="q-menu q-position-engine scroll"]/div[2]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside/div/div[2]/a[contains(., "Dashboard")]')) > 0, "Language wasn't changed")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside//div//a[contains(., "Dashboard")]')) > 0, "Language wasn't changed")
print("OK")
print("Try to add Administrators and Resellers to favourites...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div/div[2]//div[contains(., "Settings")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Administrators")]')))
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[@role="progressbar"]')
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[2]').click()
@ -928,12 +944,12 @@ class testrun(unittest.TestCase):
time.sleep(1)
print("OK")
print("Check if webpages were added to favourites and unfavourite them afterwards...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//aside//div[@class="bg-secondary q-mb-lg q-list"]/a[@href="#/administrator"]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//aside/div/div[2]/div[1]/div/div/a[2]').click()
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div[@role="progressbar"]')
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div/a[contains(., "Administrators")]')) > 0, "Wrong webpage was opened")
driver.find_element_by_xpath('//*[@id="q-app"]/div/header/div/button[2]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//aside//div[@class="bg-secondary q-mb-lg q-list"]/a[@href="#/reseller"]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[1]/aside/div/div[2]/div[1]/div/div/a[2]').click()
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div[@role="progressbar"]')
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div/a[contains(., "Resellers")]')) > 0, "Wrong webpage was opened")
@ -948,8 +964,9 @@ class testrun(unittest.TestCase):
driver = self.driver
login_panel(driver)
print("Go to 'Reseller'...", end="")
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(., "Resellers")]').click()
click_js(driver, '//*[@id="q-app"]/div//aside//div[@class="bg-secondary main-menu q-list"]/div[1]//i')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]')))
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]').click()
print("OK")
print("Try to create a new Reseller Contract...", end="")
wait_for_invisibility(driver, '/html/body//div/main//div/label//div/input[contains(@class, "q-field--disabled")]')
@ -975,7 +992,7 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('/html/body//div[@role="alert"][contains(., "Contract created successfully")]')) > 0, "Message 'Contract created successfully' didnt show up")
print("OK")
print("Try to create a new Reseller...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div/aside/div//a[contains(., "Resellers")]').click()
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/a[contains(., "Add")]').click()
fill_element(driver, '//*[@id="q-app"]/div//main/form/div//label//div[contains(., "Contract")]/../div/input', resellercontract)
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body//div/div[@class="q-virtual-scroll__content"]/div[1]')))
@ -991,7 +1008,7 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + resellername + '")]')) > 0, "Reseller was not found")
print("OK")
print("Try to rename reseller...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[4]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/table/tbody/tr[1]/td[5]/span').click()
resellername = "reseller" + str(random.randint(1, 99999))
fill_element(driver, '/html/body//div//label//div//input[@aria-label="Name"]', resellername)
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').click()
@ -1004,7 +1021,7 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "' + resellername + '")]')) > 0, "Reseller name was not changed")
print("OK")
print("Try to edit reseller status...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[5]/span').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[6]/span').click()
wait_for_invisibility(driver, '/html/body//div[@class="q-transition--fade-enter q-transition--fade-enter-active"]')
click_js(driver, '/html/body//div//label//div/span[contains(., "Active")]')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div[@class="q-item__label"][contains(., "Locked")]')))
@ -1012,23 +1029,23 @@ class testrun(unittest.TestCase):
wait_for_invisibility(driver, '/html/body/div[@role="listbox"]')
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[5]/span[contains(., "Locked")]')) > 0, "Subscriber status was not edited")
len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[6]/span[contains(., "Locked")]')) > 0, "Subscriber status was not edited")
print("OK")
print("Try to enable and disable WebRTC...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[6]/div').click()
driver.find_element_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[7]/div').click()
driver.implicitly_wait(2)
if len(driver.find_elements_by_xpath('/html/body//div[@role="alert"]//div[contains(., "Status code: 400")]')) == 0:
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[6]/div[@aria-checked="true"]')) > 0, "WebRTC was not enabled")
driver.find_element_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[6]/div').click()
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[7]/div[@aria-checked="true"]')) > 0, "WebRTC was not enabled")
driver.find_element_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[7]/div').click()
self.assertTrue(
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[6]/div[@aria-checked="false"]')) > 0, "WebRTC was not disabled")
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div/table/tbody/tr[1]/td[7]/div[@aria-checked="false"]')) > 0, "WebRTC was not disabled")
print("OK")
else:
print("OK")
driver.implicitly_wait(10)
print("Try to open the reseller edit page...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[7]/button').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[2]/button').click()
WebDriverWait(driver, 10.).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div/a[contains(., "Edit")]')))
driver.find_element_by_xpath('/html/body//div/a[contains(., "Edit")]').click()
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div[@role="progressbar"]')
@ -1050,7 +1067,7 @@ class testrun(unittest.TestCase):
len(driver.find_elements_by_xpath('//*[@id="q-app"]//div//main//div//table/tbody/tr[1]/td[contains(., "Active")]')) > 0, "Status was not changed")
print("OK")
print("Go to reseller details page...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[7]/button').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table/tbody/tr[1]/td[2]/button').click()
WebDriverWait(driver, 10.).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div/a[contains(., "Edit")]')))
driver.find_element_by_xpath('/html/body//div/a[contains(., "Details")]').click()
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div[@role="progressbar"]')
@ -1090,9 +1107,10 @@ class testrun(unittest.TestCase):
print("Check if reseller contract status was changed...", end="")
self.assertTrue(driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div//table//tr/td[5]').text == "pending", "Reseller contract status is not correct")
print("Try to delete Reseller...", end="")
driver.find_element_by_xpath('//*[@id="q-app"]/div//aside//div/a[contains(., "Resellers")]').click()
driver.find_element_by_xpath('//*[@id="q-app"]//div//aside//div//a[contains(., "Resellers")]').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//table/tbody/tr[1]/td[7]/button').click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/button')))
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/div/div[1]/table/tbody/tr[1]/td[2]/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]')))

Loading…
Cancel
Save