Skip to content

Commit

Permalink
TEN-1737 / 13.3-U1 test xpaths fixes. (#11079)
Browse files Browse the repository at this point in the history
* Fixed AWS and Backblaze login

* Fixed xpath syntax

* Fixed some more xpaths
  • Loading branch information
ericbsd authored Nov 20, 2024
1 parent 83ca00f commit cbded0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
15 changes: 5 additions & 10 deletions tests/bdd/core/test_NAS_T1121.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,19 @@ def open_a_new_tab_navigate_to_s3_url_and_input_account_id(driver, s3_url, accou
driver.execute_script("window.open();")
driver.switch_to.window(driver.window_handles[1])
driver.get(s3_url)
assert wait_on_element(driver, 5, '//a[text()="Amazon Web Services Login"]')
assert wait_on_element(driver, 5, '//input[@id="iam_user_radio_button"]', 'clickable')
driver.find_element_by_xpath('//input[@id="iam_user_radio_button"]').click()
assert wait_on_element(driver, 5, '//input[@id="resolving_input"]', 'inputable')
driver.find_element_by_xpath('//input[@id="resolving_input"]').send_keys(account_id)
assert wait_on_element(driver, 5, '//button[@id="next_button"]', 'clickable')
driver.find_element_by_xpath('//button[@id="next_button"]').click()
assert wait_on_element(driver, 5, '//*[contains(text(),"IAM user sign in")]')
assert wait_on_element(driver, 5, '//*[@id="account"]', 'inputable')
driver.find_element_by_xpath('//*[@id="account"]').send_keys(account_id)


@then('input <user_name> and <password>, click Sign in')
def input_user_name_and_password_click_sign_in(driver, user_name, password):
"""input <user_name> and <password>, click Sign in."""
assert wait_on_element(driver, 5, '//div[contains(.,"Sign in as IAM user")]')
assert wait_on_element(driver, 5, '//input[@id="username"]', 'inputable')
driver.find_element_by_xpath('//input[@id="username"]').send_keys(user_name)
driver.find_element_by_xpath('//input[@id="password"]').send_keys(password)
assert wait_on_element(driver, 5, '//a[@id="signin_button"]', 'clickable')
driver.find_element_by_xpath('//a[@id="signin_button"]').click()
assert wait_on_element(driver, 5, '//*[@id="signin_button"]', 'clickable')
driver.find_element_by_xpath('//*[@id="signin_button"]').click()


@then('click on the bucket being used and then upload a file')
Expand Down
8 changes: 4 additions & 4 deletions tests/bdd/core/test_NAS_T1143.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def enter_the_user_name_click_next_and_enter_the_password_click_next(driver, use
assert wait_on_element(driver, 5, '//button[contains(text(),"Next")]', 'clickable')
driver.find_element_by_xpath('//button[contains(text(),"Next")]').click()
time.sleep(1)
assert wait_on_element(driver, 10, f'//p[@class="user-email" and contains(text(),"{user_name}")]')
assert wait_on_element(driver, 10, f'//input[@value="{user_name}"]')
assert wait_on_element(driver, 5, '//input[@name="password-field"]', 'inputable')
driver.find_element_by_xpath('//input[@name="password-field"]').send_keys(password)
time.sleep(1)
Expand All @@ -124,13 +124,13 @@ def click_on_browser_files_click_on_bucket_then_click_on_the_test_folder(driver,
"""click on Browser Files, click on {bucket}, then click on the bucket."""
global my_bucket
my_bucket = bucket
assert wait_on_element(driver, 10, '//span[text()="B2 Cloud Storage Buckets"]')
assert wait_on_element(driver, 10, '//h1[contains(text(),"B2 Cloud Storage Buckets")]')
assert wait_on_element(driver, 7, '//a[text()="Browse Files"]', 'clickable')
driver.find_element_by_xpath('//a[text()="Browse Files"]').click()
assert wait_on_element(driver, 10, '//h1[text()="Browse Files"]')
assert wait_on_element(driver, 10, '//div[@class="b2-browse-crumbs" and contains(.,"Buckets")]')
assert wait_on_element(driver, 10, f'//span[contains(text(),"{bucket} ")]', 'clickable')
driver.find_element_by_xpath(f'//span[contains(text(),"{bucket} ")]').click()
assert wait_on_element(driver, 10, f'//*[contains(text(),"{bucket} ")]', 'clickable')
driver.find_element_by_xpath(f'//*[contains(text(),"{bucket} ")]').click()
assert wait_on_element(driver, 10, f'//a[text()="{bucket}"]', 'clickable')
time.sleep(1)

Expand Down

0 comments on commit cbded0a

Please sign in to comment.