diff --git a/t/selenium/functions/Collections.py b/t/selenium/functions/Collections.py index 22c380c7f6..de1cee3bf9 100644 --- a/t/selenium/functions/Collections.py +++ b/t/selenium/functions/Collections.py @@ -78,7 +78,7 @@ def create_reseller_contract(driver, contractname): 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")]') driver.find_element_by_xpath('//*[@id="q-app"]/div//main//div/button[contains(., "Add")]').click() - driver.find_element_by_xpath('/html/body//div[@class="q-list"]/a[2]').click() + driver.find_element_by_xpath('//*[@data-cy="aui-list-action-menu-item--contract-create-reseller"]').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) diff --git a/t/selenium/testrun.py b/t/selenium/testrun.py index 5f45c6323c..6ebf13b808 100644 --- a/t/selenium/testrun.py +++ b/t/selenium/testrun.py @@ -152,46 +152,6 @@ class testrun(unittest.TestCase): driver.find_element_by_xpath('//div[@data-cy="aui-main-menu-items--settings"]').click() 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("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', 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") - 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[2]/div[2]/div/div[1]'))) - driver.find_element_by_xpath('//*[@id="q-app"]/div/div[2]/main/div[1]/form/div[2]/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 'master' is not allowed to edit admins from other resellers...", end="") - logout_panel(driver) - login_panel(driver, adminname2, 'administrato') - driver.find_element_by_xpath('//div[@data-cy="aui-main-menu-items--settings"]').click() - 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'))) - fill_element(driver, '/html/body//div/main//div/label//div/input', adminname) - 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//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('//div[@data-cy="aui-main-menu-items--settings"]').click() - 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")]') WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '/html/body//div/main//div/label//div/input'))) @@ -400,14 +360,14 @@ 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[5]/span').click() + driver.find_element_by_xpath('//*[@data-cy="q-td--firstname"]/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() + 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'))) 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[6]/span').click() + driver.find_element_by_xpath('//*[@data-cy="q-td--lastname"]/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")]') @@ -449,14 +409,14 @@ 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[5]/span').click() + driver.find_element_by_xpath('//*[@data-cy="q-td--firstname"]/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() + 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'))) 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[6]/span').click() + driver.find_element_by_xpath('//*[@data-cy="q-td--lastname"]/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")]') @@ -864,7 +824,7 @@ class testrun(unittest.TestCase): 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//a[contains(., "Tablón")]')) > 0, "Language wasn't changed") + len(driver.find_elements_by_xpath('//*[@id="q-app"]/div//aside//div//a[contains(., "Tablero")]')) > 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()