diff --git a/tests/bdd/core/test_NAS_T1141.py b/tests/bdd/core/test_NAS_T1141.py index d23784130eb..78b2629df57 100644 --- a/tests/bdd/core/test_NAS_T1141.py +++ b/tests/bdd/core/test_NAS_T1141.py @@ -289,12 +289,12 @@ def verify_all_files_are_in_the_test_folder(driver): """verify all files are in the test folder.""" assert wait_on_element(driver, 7, '//div[@data-tooltip="test" and @role="button"]') assert wait_on_element(driver, 7, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 5, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]', 'clickable') - assert wait_on_element(driver, 5, '//div[@data-tooltip="Image: Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]', 'clickable') + assert wait_on_element(driver, 5, xpaths.google_Drive.pdf_file, 'clickable') + assert wait_on_element(driver, 5, xpaths.google_Drive.image_file, 'clickable') rsc.double_click(driver, xpaths.google_Drive.music_Folder) assert wait_on_element(driver, 7, '//div[@data-tooltip="music" and @role="button"]') assert wait_on_element(driver, 7, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 5, '//div[@data-tooltip="Audio: Mr_Smith_Pequeñas_Guitarras.mp3"]', 'clickable') + assert wait_on_element(driver, 5, xpaths.google_Drive.mp3_file, 'clickable') assert wait_on_element(driver, 5, '//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]', 'clickable') driver.find_element_by_xpath('//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]').click() @@ -365,11 +365,11 @@ def verify_all_files_are_moved_from_the_google_drive_test_folder_to_the_dataset( assert wait_on_element(driver, 7, '//div[@data-tooltip="test" and @role="button"]') assert wait_on_element(driver, 7, xpaths.google_Drive.name_Sort) assert wait_on_element(driver, 5, xpaths.google_Drive.music_Folder, 'clickable') - assert wait_on_element_disappear(driver, 10, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]') - assert wait_on_element_disappear(driver, 10, '//div[@data-tooltip="Image: Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]') + assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.pdf_file) + assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.image_file) rsc.double_click(driver, xpaths.google_Drive.music_Folder) assert wait_on_element(driver, 7, '//div[@data-tooltip="music" and @role="button"]') - assert wait_on_element_disappear(driver, 10, '//div[@data-tooltip="Audio: Mr_Smith_Pequeñas_Guitarras.mp3"]') + assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.mp3_file) assert wait_on_element(driver, 5, '//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]', 'clickable') driver.find_element_by_xpath('//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]').click() @@ -418,12 +418,12 @@ def verify_all_files_are_moved_from_the_dataset_to_the_google_drive_test_folder( driver.switch_to.window(driver.window_handles[1]) assert wait_on_element(driver, 7, '//div[@data-tooltip="test" and @role="button"]') assert wait_on_element(driver, 7, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 15, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]', 'clickable') - assert wait_on_element(driver, 15, '//div[@data-tooltip="Image: Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]', 'clickable') + assert wait_on_element(driver, 15, xpaths.google_Drive.pdf_file, 'clickable') + assert wait_on_element(driver, 15, xpaths.google_Drive.image_file, 'clickable') rsc.double_click(driver, xpaths.google_Drive.music_Folder) assert wait_on_element(driver, 7, '//div[@data-tooltip="music" and @role="button"]') assert wait_on_element(driver, 7, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 10, '//div[@data-tooltip="Audio: Mr_Smith_Pequeñas_Guitarras.mp3"]', 'clickable') + assert wait_on_element(driver, 10, xpaths.google_Drive.mp3_file, 'clickable') assert wait_on_element(driver, 5, '//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]', 'clickable') driver.find_element_by_xpath('//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]').click() @@ -476,14 +476,14 @@ def on_the_google_drive_test_folder_tab_delete_one_file(driver): driver.switch_to.window(driver.window_handles[1]) assert wait_on_element(driver, 7, '//div[@data-tooltip="test" and @role="button"]') assert wait_on_element(driver, 7, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 10, '//div[@data-tooltip="Image: Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]') - driver.find_element_by_xpath('//div[@data-tooltip="Image: Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]').click() + assert wait_on_element(driver, 10, xpaths.google_Drive.image_file) + driver.find_element_by_xpath(xpaths.google_Drive.image_file).click() action = ActionChains(driver) action.send_keys(Keys.DELETE).perform() assert wait_on_element(driver, 5, xpaths.google_Drive.move_To_Trash) assert wait_on_element(driver, 5, '//button[*/text()="Move to trash"]', 'clickable') driver.find_element_by_xpath('//button[*/text()="Move to trash"]').click() - assert wait_on_element_disappear(driver, 10, '//div[@data-tooltip="Image: Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]') + assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.image_file) @then('on the NAS cloud sync task tab, click Run Now') @@ -542,15 +542,15 @@ def on_the_google_drive_test_folder_tab_delete_all_file(driver): driver.find_element_by_xpath('//button[*/text()="Move to trash"]').click() assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.move_To_Trash) assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.music_Folder) - assert wait_on_element(driver, 5, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]', 'clickable') - driver.find_element_by_xpath('//div[@data-tooltip="PDF: Explaining_BSD.pdf"]').click() + assert wait_on_element(driver, 5, xpaths.google_Drive.pdf_file, 'clickable') + driver.find_element_by_xpath(xpaths.google_Drive.pdf_file).click() action = ActionChains(driver) action.send_keys(Keys.DELETE).perform() assert wait_on_element(driver, 5, xpaths.google_Drive.move_To_Trash) assert wait_on_element(driver, 5, '//button[*/text()="Move to trash"]', 'clickable') driver.find_element_by_xpath('//button[*/text()="Move to trash"]').click() assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.move_To_Trash) - assert wait_on_element_disappear(driver, 10, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]') + assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.pdf_file) @then('select PUSH as the Direction then under Transfer Mode, select SYNC') @@ -582,13 +582,13 @@ def verify_all_files_are_sync_to_the_google_drive_test_folder_tab(driver): driver.switch_to.window(driver.window_handles[1]) assert wait_on_element(driver, 10, '//div[@data-tooltip="test" and @role="button"]') assert wait_on_element(driver, 15, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 10, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]', 'clickable') + assert wait_on_element(driver, 10, xpaths.google_Drive.pdf_file, 'clickable') assert wait_on_element(driver, 10, xpaths.google_Drive.music_Folder, 'clickable') driver.find_element_by_xpath(xpaths.google_Drive.music_Folder).click() rsc.double_click(driver, xpaths.google_Drive.music_Folder) assert wait_on_element(driver, 5, '//div[@data-tooltip="music" and @role="button"]') assert wait_on_element(driver, 7, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 5, '//div[@data-tooltip="Audio: Mr_Smith_Pequeñas_Guitarras.mp3"]', 'clickable') + assert wait_on_element(driver, 5, xpaths.google_Drive.mp3_file, 'clickable') assert wait_on_element(driver, 5, '//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]', 'clickable') driver.find_element_by_xpath('//div[@data-tooltip="test" and @data-tooltip-unhoverable="true" and @role="link"]').click() @@ -607,16 +607,16 @@ def verify_the_file_is_removed_from_the_google_drive_test_folder_tab(driver): driver.switch_to.window(driver.window_handles[1]) assert wait_on_element(driver, 10, '//div[@data-tooltip="test" and @role="button"]') assert wait_on_element(driver, 15, xpaths.google_Drive.name_Sort) - assert wait_on_element(driver, 10, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]', 'clickable') + assert wait_on_element(driver, 10, xpaths.google_Drive.pdf_file, 'clickable') assert wait_on_element_disappear(driver, 15, xpaths.google_Drive.music_Folder) # clean the test folder on box tab before closing the tab. - assert wait_on_element(driver, 5, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]', 'clickable') - driver.find_element_by_xpath('//div[@data-tooltip="PDF: Explaining_BSD.pdf"]').click() + assert wait_on_element(driver, 5, xpaths.google_Drive.pdf_file, 'clickable') + driver.find_element_by_xpath(xpaths.google_Drive.pdf_file).click() action = ActionChains(driver) action.send_keys(Keys.DELETE).perform() assert wait_on_element(driver, 5, xpaths.google_Drive.move_To_Trash) assert wait_on_element(driver, 5, '//button[*/text()="Move to trash"]', 'clickable') driver.find_element_by_xpath('//button[*/text()="Move to trash"]').click() - assert wait_on_element_disappear(driver, 10, '//div[@data-tooltip="PDF: Explaining_BSD.pdf"]') + assert wait_on_element_disappear(driver, 10, xpaths.google_Drive.pdf_file) driver.close() driver.switch_to.window(driver.window_handles[0]) diff --git a/tests/bdd/core/test_NAS_T1143.py b/tests/bdd/core/test_NAS_T1143.py index 34c327d868f..d9375456847 100644 --- a/tests/bdd/core/test_NAS_T1143.py +++ b/tests/bdd/core/test_NAS_T1143.py @@ -97,13 +97,12 @@ def open_a_new_tab_navigate_to_backblaze_url_click_sign_in(driver, backblaze_url driver.get(backblaze_url) time.sleep(1) assert wait_on_element(driver, 7, '//img[@alt="Backblaze Logo"]') - assert wait_on_element(driver, 5, '//a[text()="Sign In"]', 'clickable') @then('enter the click Next and enter the click Next') -def enter_the_user_name_click_Next_and_enter_the_password_click_Next(driver, user_name, password): +def enter_the_user_name_click_next_and_enter_the_password_click_next(driver, user_name, password): """enter the click Next and enter the click Next.""" - assert wait_on_element(driver, 5, '//h3[text()="Welcome Back"]') + assert wait_on_element(driver, 5, '//h1[text()="Welcome Back"]') time.sleep(1) assert wait_on_element(driver, 5, '//input[@name="email-field"]', 'inputable') driver.find_element_by_xpath('//input[@name="email-field"]').send_keys(user_name) @@ -121,7 +120,7 @@ def enter_the_user_name_click_Next_and_enter_the_password_click_Next(driver, use @then(parsers.parse('click on Browser Files, click on {bucket} bucket')) -def click_on_Browser_Files_click_on_bucket_then_click_on_the_test_folder(driver, bucket): +def click_on_browser_files_click_on_bucket_then_click_on_the_test_folder(driver, bucket): """click on Browser Files, click on {bucket}, then click on the bucket.""" global my_bucket my_bucket = bucket diff --git a/tests/bdd/xpaths.py b/tests/bdd/xpaths.py index 7f6157d8d8e..2075d3d5d7e 100644 --- a/tests/bdd/xpaths.py +++ b/tests/bdd/xpaths.py @@ -63,6 +63,9 @@ class google_Drive: name_Sort = '//div[contains(text(),"Name") and @role="button"]' music_Folder = '//div[@data-tooltip="Google Drive Folder: music"]' move_To_Trash = '//div[text()="Move to trash?"]' + pdf_file = '//div[@aria-label="Explaining_BSD.pdf PDF"]' + image_file = '//div[@aria-label="Gloomy_Forest_wallpaper_ForWallpapercom.jpg Image"]' + mp3_file = '//div[@aria-label="Mr_Smith_Pequeñas_Guitarras.mp3 Audio"]' class input: