TT#158401 selenium: fix multiple obscuring elements

in admins, customers and contracts

Change-Id: Ic2f904e207a7c928b6f1a78b0fc61f9a49439de3
mr10.4
Nico Schedel 4 years ago
parent a4d3585430
commit a8fcd1dcb7

@ -202,6 +202,7 @@ class testrun(unittest.TestCase):
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()
wait_for_invisibility(driver, '//*[@id="q-app"]/div//main//div/table/thead/tr[2]/th/div[@role="progressbar"]')
driver.find_element_by_xpath('//label[@data-cy="roles-list"]').click()
driver.find_element_by_xpath('//div[@data-cy="q-item--3"]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div//main/div//button[contains(., "Save")]').click()
@ -571,7 +572,7 @@ class testrun(unittest.TestCase):
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div[@class="q-item__label"][contains(., "Locked")]')))
driver.find_element_by_xpath('/html/body//div[@class="q-item__label"][contains(., "Locked")]').click()
wait_for_invisibility(driver, '/html/body/div[@role="listbox"]')
driver.find_element_by_xpath('/html/body//div/button[contains(., "Save")]').click()
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[8]/span[contains(., "Locked")]')) > 0, "Contract status was not edited")
print("OK")
@ -604,19 +605,19 @@ class testrun(unittest.TestCase):
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")]')
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(., "Contact")]/../div/input', "default")
fill_element(driver, '//*[@id="q-app"]/div//main/form/div//label//div[contains(., "External")]/../div/input', customername)
driver.find_element_by_xpath('//*[@id="q-app"]//div//main/form//div//label[contains(., "Status")]').click()
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div//div[@class="q-virtual-scroll__content"]/div[1]')))
time.sleep(1)
driver.find_element_by_xpath('/html/body//div[@class="q-virtual-scroll__content"]/div[1]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/form/div/div[2]/div[1]/div[2]/div/label/div[1]').click()
fill_element(driver, '//*[@id="q-app"]/div//main/form/div//label//div[contains(., "Contact")]/../div/input', "default")
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div//div[@class="q-virtual-scroll__content"]/div[1]')))
time.sleep(1)
driver.find_element_by_xpath('/html/body//div[@class="q-virtual-scroll__content"]/div[1]').click()
driver.find_element_by_xpath('//*[@id="q-app"]//div//main/form//div//label[contains(., "Status")]').click()
driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/form/div/div[2]/div[1]/div[2]/div/label/div[1]').click()
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div//div[@class="q-virtual-scroll__content"]/div[1]')))
time.sleep(1)
driver.find_element_by_xpath('/html/body//div[@class="q-virtual-scroll__content"]/div[1]').click()
fill_element(driver, '//*[@id="q-app"]/div//main/form/div//label//div[contains(., "External")]/../div/input', customername)
driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/button[contains(., "Save")]').click()
print("OK")
print("Check if customer has been created...", end="")

Loading…
Cancel
Save