From 0c4c39284942849b0dd520a372a585501e4990dd Mon Sep 17 00:00:00 2001 From: Eric Turgeon <4249848+ericbsd@users.noreply.github.com> Date: Thu, 12 Oct 2023 16:17:12 -0300 Subject: [PATCH] TE-1184 / 13.0 / Removed dropbox cloud sync test and fixed aws cloud sync test (#9037) * Removed dropbox cloud sync test fixed aws create folder not in the view created scroll_To function * reduce sleep to 0.2 in scroll_To * fixed check_All_Checkbox xpath --- tests/bdd/core/test_NAS_T0984.py | 5 +- tests/bdd/core/test_NAS_T0985.py | 5 +- tests/bdd/core/test_NAS_T0986.py | 5 +- tests/bdd/core/test_NAS_T1001.py | 5 +- tests/bdd/core/test_NAS_T1002.py | 5 +- tests/bdd/core/test_NAS_T1003.py | 5 +- tests/bdd/core/test_NAS_T1004.py | 5 +- tests/bdd/core/test_NAS_T1006.py | 5 +- tests/bdd/core/test_NAS_T1007.py | 5 +- tests/bdd/core/test_NAS_T1008.py | 5 +- tests/bdd/core/test_NAS_T1009.py | 5 +- tests/bdd/core/test_NAS_T1010.py | 5 +- tests/bdd/core/test_NAS_T1011.py | 5 +- tests/bdd/core/test_NAS_T1012.py | 5 +- tests/bdd/core/test_NAS_T1013.py | 5 +- tests/bdd/core/test_NAS_T1014.py | 5 +- tests/bdd/core/test_NAS_T1015.py | 5 +- tests/bdd/core/test_NAS_T1016.py | 5 +- tests/bdd/core/test_NAS_T1017.py | 5 +- tests/bdd/core/test_NAS_T1018.py | 5 +- tests/bdd/core/test_NAS_T1019.py | 5 +- tests/bdd/core/test_NAS_T1020.py | 5 +- tests/bdd/core/test_NAS_T1021.py | 5 +- tests/bdd/core/test_NAS_T1022.py | 5 +- tests/bdd/core/test_NAS_T1024.py | 5 +- tests/bdd/core/test_NAS_T1025.py | 5 +- tests/bdd/core/test_NAS_T1026.py | 5 +- tests/bdd/core/test_NAS_T1027.py | 5 +- tests/bdd/core/test_NAS_T1028.py | 5 +- tests/bdd/core/test_NAS_T1029.py | 5 +- tests/bdd/core/test_NAS_T1030.py | 5 +- tests/bdd/core/test_NAS_T1031.py | 5 +- tests/bdd/core/test_NAS_T1041.py | 5 +- tests/bdd/core/test_NAS_T1042.py | 5 +- tests/bdd/core/test_NAS_T1043.py | 5 +- tests/bdd/core/test_NAS_T1044.py | 5 +- tests/bdd/core/test_NAS_T1049.py | 5 +- tests/bdd/core/test_NAS_T1050.py | 5 +- tests/bdd/core/test_NAS_T1051.py | 5 +- tests/bdd/core/test_NAS_T1052.py | 5 +- tests/bdd/core/test_NAS_T1053.py | 5 +- tests/bdd/core/test_NAS_T1054.py | 5 +- tests/bdd/core/test_NAS_T1055.py | 5 +- tests/bdd/core/test_NAS_T1079.py | 5 +- tests/bdd/core/test_NAS_T1080.py | 5 +- tests/bdd/core/test_NAS_T1081.py | 5 +- tests/bdd/core/test_NAS_T1083.py | 5 +- tests/bdd/core/test_NAS_T1085.py | 5 +- tests/bdd/core/test_NAS_T1086.py | 5 +- tests/bdd/core/test_NAS_T1088.py | 5 +- tests/bdd/core/test_NAS_T1090.py | 5 +- tests/bdd/core/test_NAS_T1103.py | 5 +- tests/bdd/core/test_NAS_T1105.py | 5 +- tests/bdd/core/test_NAS_T1109.py | 5 +- tests/bdd/core/test_NAS_T1110.py | 5 +- tests/bdd/core/test_NAS_T1111.py | 5 +- tests/bdd/core/test_NAS_T1118.py | 5 +- tests/bdd/core/test_NAS_T1121.py | 16 +- tests/bdd/core/test_NAS_T1128.py | 5 +- tests/bdd/core/test_NAS_T1132.py | 5 +- tests/bdd/core/test_NAS_T1135.py | 155 ------ tests/bdd/core/test_NAS_T1136.py | 657 -------------------------- tests/bdd/core/test_NAS_T1140.py | 5 +- tests/bdd/core/test_NAS_T1141.py | 5 +- tests/bdd/core/test_NAS_T1142.py | 5 +- tests/bdd/core/test_NAS_T1143.py | 5 +- tests/bdd/core/test_NAS_T1216.py | 5 +- tests/bdd/core/test_NAS_T1222.py | 5 +- tests/bdd/core/test_last_NAS_T1047.py | 5 +- tests/bdd/reusableSeleniumCode.py | 7 + tests/bdd/xpaths.py | 3 +- 71 files changed, 82 insertions(+), 1086 deletions(-) delete mode 100644 tests/bdd/core/test_NAS_T1135.py delete mode 100644 tests/bdd/core/test_NAS_T1136.py diff --git a/tests/bdd/core/test_NAS_T0984.py b/tests/bdd/core/test_NAS_T0984.py index 16cc9f1ea5c..93f61cfa51d 100644 --- a/tests/bdd/core/test_NAS_T0984.py +++ b/tests/bdd/core/test_NAS_T0984.py @@ -48,10 +48,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T0985.py b/tests/bdd/core/test_NAS_T0985.py index f4b1fb57cd1..0f8452aa6cf 100644 --- a/tests/bdd/core/test_NAS_T0985.py +++ b/tests/bdd/core/test_NAS_T0985.py @@ -42,10 +42,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw driver.find_element_by_xpath('//button[@name="signin_button"]').click() assert wait_on_element(driver, 10, '//span[contains(.,"root")]') if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 10, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T0986.py b/tests/bdd/core/test_NAS_T0986.py index f2d5cd7303b..d9ee1ecabd4 100644 --- a/tests/bdd/core/test_NAS_T0986.py +++ b/tests/bdd/core/test_NAS_T0986.py @@ -38,10 +38,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1001.py b/tests/bdd/core/test_NAS_T1001.py index 01729b83186..02b60e15861 100644 --- a/tests/bdd/core/test_NAS_T1001.py +++ b/tests/bdd/core/test_NAS_T1001.py @@ -40,10 +40,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1002.py b/tests/bdd/core/test_NAS_T1002.py index 99ce6237e2d..8c171cfee6c 100644 --- a/tests/bdd/core/test_NAS_T1002.py +++ b/tests/bdd/core/test_NAS_T1002.py @@ -41,10 +41,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1003.py b/tests/bdd/core/test_NAS_T1003.py index 60904e1bd68..6cf291acb21 100644 --- a/tests/bdd/core/test_NAS_T1003.py +++ b/tests/bdd/core/test_NAS_T1003.py @@ -40,10 +40,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1004.py b/tests/bdd/core/test_NAS_T1004.py index 926368808bf..a9716206bb9 100644 --- a/tests/bdd/core/test_NAS_T1004.py +++ b/tests/bdd/core/test_NAS_T1004.py @@ -42,10 +42,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1006.py b/tests/bdd/core/test_NAS_T1006.py index e7f60580576..7c38bf261be 100644 --- a/tests/bdd/core/test_NAS_T1006.py +++ b/tests/bdd/core/test_NAS_T1006.py @@ -42,10 +42,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1007.py b/tests/bdd/core/test_NAS_T1007.py index 5c5b1b952f5..d95ddff53d6 100644 --- a/tests/bdd/core/test_NAS_T1007.py +++ b/tests/bdd/core/test_NAS_T1007.py @@ -42,10 +42,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1008.py b/tests/bdd/core/test_NAS_T1008.py index df5f8b9760f..fa9fa610abd 100644 --- a/tests/bdd/core/test_NAS_T1008.py +++ b/tests/bdd/core/test_NAS_T1008.py @@ -40,10 +40,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1009.py b/tests/bdd/core/test_NAS_T1009.py index 260ee30db64..2ad67307798 100644 --- a/tests/bdd/core/test_NAS_T1009.py +++ b/tests/bdd/core/test_NAS_T1009.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1010.py b/tests/bdd/core/test_NAS_T1010.py index afeeb7222b1..dc38b819e92 100644 --- a/tests/bdd/core/test_NAS_T1010.py +++ b/tests/bdd/core/test_NAS_T1010.py @@ -42,10 +42,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1011.py b/tests/bdd/core/test_NAS_T1011.py index 50cb7a7d23e..80efd812660 100644 --- a/tests/bdd/core/test_NAS_T1011.py +++ b/tests/bdd/core/test_NAS_T1011.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1012.py b/tests/bdd/core/test_NAS_T1012.py index 115a1f88d2d..c04a378ced0 100644 --- a/tests/bdd/core/test_NAS_T1012.py +++ b/tests/bdd/core/test_NAS_T1012.py @@ -42,10 +42,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1013.py b/tests/bdd/core/test_NAS_T1013.py index ad9626d8977..402eb3e1ace 100644 --- a/tests/bdd/core/test_NAS_T1013.py +++ b/tests/bdd/core/test_NAS_T1013.py @@ -44,10 +44,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1014.py b/tests/bdd/core/test_NAS_T1014.py index 1217d38ae4f..cb15e178475 100644 --- a/tests/bdd/core/test_NAS_T1014.py +++ b/tests/bdd/core/test_NAS_T1014.py @@ -38,10 +38,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1015.py b/tests/bdd/core/test_NAS_T1015.py index d93734b6ed2..99507610714 100644 --- a/tests/bdd/core/test_NAS_T1015.py +++ b/tests/bdd/core/test_NAS_T1015.py @@ -42,10 +42,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1016.py b/tests/bdd/core/test_NAS_T1016.py index 4750149c3d3..569f7e7a3ce 100644 --- a/tests/bdd/core/test_NAS_T1016.py +++ b/tests/bdd/core/test_NAS_T1016.py @@ -44,10 +44,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1017.py b/tests/bdd/core/test_NAS_T1017.py index 2241f12a33d..7361e836b75 100644 --- a/tests/bdd/core/test_NAS_T1017.py +++ b/tests/bdd/core/test_NAS_T1017.py @@ -42,10 +42,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1018.py b/tests/bdd/core/test_NAS_T1018.py index 6854ec9fb14..11b0fe49b99 100644 --- a/tests/bdd/core/test_NAS_T1018.py +++ b/tests/bdd/core/test_NAS_T1018.py @@ -44,10 +44,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1019.py b/tests/bdd/core/test_NAS_T1019.py index b8e1b2d7600..61773f8aacc 100644 --- a/tests/bdd/core/test_NAS_T1019.py +++ b/tests/bdd/core/test_NAS_T1019.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1020.py b/tests/bdd/core/test_NAS_T1020.py index 9b07a68f028..85b19cddd3c 100644 --- a/tests/bdd/core/test_NAS_T1020.py +++ b/tests/bdd/core/test_NAS_T1020.py @@ -41,10 +41,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1021.py b/tests/bdd/core/test_NAS_T1021.py index 71dfafc4fa7..4e8d8ecaf70 100644 --- a/tests/bdd/core/test_NAS_T1021.py +++ b/tests/bdd/core/test_NAS_T1021.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1022.py b/tests/bdd/core/test_NAS_T1022.py index 3f46a94cc4c..1ebb84ce242 100644 --- a/tests/bdd/core/test_NAS_T1022.py +++ b/tests/bdd/core/test_NAS_T1022.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1024.py b/tests/bdd/core/test_NAS_T1024.py index 57df3b8b7ff..78a3ebf849b 100644 --- a/tests/bdd/core/test_NAS_T1024.py +++ b/tests/bdd/core/test_NAS_T1024.py @@ -49,10 +49,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1025.py b/tests/bdd/core/test_NAS_T1025.py index 4ac119eaa24..eb3adbf2b8a 100644 --- a/tests/bdd/core/test_NAS_T1025.py +++ b/tests/bdd/core/test_NAS_T1025.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1026.py b/tests/bdd/core/test_NAS_T1026.py index ca573e353a9..3cfa19a50cc 100644 --- a/tests/bdd/core/test_NAS_T1026.py +++ b/tests/bdd/core/test_NAS_T1026.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1027.py b/tests/bdd/core/test_NAS_T1027.py index 739ad76c14a..4ad62c47ef5 100644 --- a/tests/bdd/core/test_NAS_T1027.py +++ b/tests/bdd/core/test_NAS_T1027.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1028.py b/tests/bdd/core/test_NAS_T1028.py index e2dcbd34a5a..3259d5f5f31 100644 --- a/tests/bdd/core/test_NAS_T1028.py +++ b/tests/bdd/core/test_NAS_T1028.py @@ -47,10 +47,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1029.py b/tests/bdd/core/test_NAS_T1029.py index e6c0ff910ab..a88b20169fc 100644 --- a/tests/bdd/core/test_NAS_T1029.py +++ b/tests/bdd/core/test_NAS_T1029.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1030.py b/tests/bdd/core/test_NAS_T1030.py index a67e26a9059..999c18196ad 100644 --- a/tests/bdd/core/test_NAS_T1030.py +++ b/tests/bdd/core/test_NAS_T1030.py @@ -38,10 +38,7 @@ def the_browser_is_open_on_the_TrueNAS_URL_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1031.py b/tests/bdd/core/test_NAS_T1031.py index 8a3280b1731..7454f25c764 100644 --- a/tests/bdd/core/test_NAS_T1031.py +++ b/tests/bdd/core/test_NAS_T1031.py @@ -41,10 +41,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1041.py b/tests/bdd/core/test_NAS_T1041.py index c262bab8c8b..1f08b1b0b3f 100644 --- a/tests/bdd/core/test_NAS_T1041.py +++ b/tests/bdd/core/test_NAS_T1041.py @@ -45,10 +45,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1042.py b/tests/bdd/core/test_NAS_T1042.py index 424eb14c2df..270602862ce 100644 --- a/tests/bdd/core/test_NAS_T1042.py +++ b/tests/bdd/core/test_NAS_T1042.py @@ -45,10 +45,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1043.py b/tests/bdd/core/test_NAS_T1043.py index 836d0b46d35..582c3e6dc32 100644 --- a/tests/bdd/core/test_NAS_T1043.py +++ b/tests/bdd/core/test_NAS_T1043.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1044.py b/tests/bdd/core/test_NAS_T1044.py index 20101067e9f..2ef13230041 100644 --- a/tests/bdd/core/test_NAS_T1044.py +++ b/tests/bdd/core/test_NAS_T1044.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1049.py b/tests/bdd/core/test_NAS_T1049.py index ba760452a82..47d6e2c67b8 100644 --- a/tests/bdd/core/test_NAS_T1049.py +++ b/tests/bdd/core/test_NAS_T1049.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1050.py b/tests/bdd/core/test_NAS_T1050.py index 61ac4a34b83..61b26a1b155 100644 --- a/tests/bdd/core/test_NAS_T1050.py +++ b/tests/bdd/core/test_NAS_T1050.py @@ -67,10 +67,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1051.py b/tests/bdd/core/test_NAS_T1051.py index 37faa70c7b6..8104793ee0e 100644 --- a/tests/bdd/core/test_NAS_T1051.py +++ b/tests/bdd/core/test_NAS_T1051.py @@ -44,10 +44,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1052.py b/tests/bdd/core/test_NAS_T1052.py index 82dc53a0abc..b0731f176e2 100644 --- a/tests/bdd/core/test_NAS_T1052.py +++ b/tests/bdd/core/test_NAS_T1052.py @@ -45,10 +45,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1053.py b/tests/bdd/core/test_NAS_T1053.py index d65119c8bea..9a9815da988 100644 --- a/tests/bdd/core/test_NAS_T1053.py +++ b/tests/bdd/core/test_NAS_T1053.py @@ -45,10 +45,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1054.py b/tests/bdd/core/test_NAS_T1054.py index 7289625457f..e56a1fa790a 100644 --- a/tests/bdd/core/test_NAS_T1054.py +++ b/tests/bdd/core/test_NAS_T1054.py @@ -49,10 +49,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1055.py b/tests/bdd/core/test_NAS_T1055.py index c280b347d91..19f65af1ca3 100644 --- a/tests/bdd/core/test_NAS_T1055.py +++ b/tests/bdd/core/test_NAS_T1055.py @@ -46,10 +46,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1079.py b/tests/bdd/core/test_NAS_T1079.py index 01c7324bb5f..92bd7392bde 100644 --- a/tests/bdd/core/test_NAS_T1079.py +++ b/tests/bdd/core/test_NAS_T1079.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1080.py b/tests/bdd/core/test_NAS_T1080.py index e7c43d67ca3..cc741ff9604 100644 --- a/tests/bdd/core/test_NAS_T1080.py +++ b/tests/bdd/core/test_NAS_T1080.py @@ -64,10 +64,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1081.py b/tests/bdd/core/test_NAS_T1081.py index d41905036b9..26c1b097ffc 100644 --- a/tests/bdd/core/test_NAS_T1081.py +++ b/tests/bdd/core/test_NAS_T1081.py @@ -42,10 +42,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1083.py b/tests/bdd/core/test_NAS_T1083.py index b0aeb237943..2ee1681bc90 100644 --- a/tests/bdd/core/test_NAS_T1083.py +++ b/tests/bdd/core/test_NAS_T1083.py @@ -41,10 +41,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1085.py b/tests/bdd/core/test_NAS_T1085.py index 970cf727660..dcb976245d5 100644 --- a/tests/bdd/core/test_NAS_T1085.py +++ b/tests/bdd/core/test_NAS_T1085.py @@ -45,10 +45,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1086.py b/tests/bdd/core/test_NAS_T1086.py index 5ff80c540a7..2db35d5ef01 100644 --- a/tests/bdd/core/test_NAS_T1086.py +++ b/tests/bdd/core/test_NAS_T1086.py @@ -43,10 +43,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1088.py b/tests/bdd/core/test_NAS_T1088.py index 9b3f5883d0d..bca360d50a3 100644 --- a/tests/bdd/core/test_NAS_T1088.py +++ b/tests/bdd/core/test_NAS_T1088.py @@ -42,10 +42,7 @@ def the_browser_is_open_the_truenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1090.py b/tests/bdd/core/test_NAS_T1090.py index c88489df7b6..140299861c8 100644 --- a/tests/bdd/core/test_NAS_T1090.py +++ b/tests/bdd/core/test_NAS_T1090.py @@ -57,10 +57,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1103.py b/tests/bdd/core/test_NAS_T1103.py index 0a15dd9e9a5..947cf15a32e 100644 --- a/tests/bdd/core/test_NAS_T1103.py +++ b/tests/bdd/core/test_NAS_T1103.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1105.py b/tests/bdd/core/test_NAS_T1105.py index 9b649ed3d41..d2902cadc55 100644 --- a/tests/bdd/core/test_NAS_T1105.py +++ b/tests/bdd/core/test_NAS_T1105.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1109.py b/tests/bdd/core/test_NAS_T1109.py index 247755111ed..1a915f68803 100644 --- a/tests/bdd/core/test_NAS_T1109.py +++ b/tests/bdd/core/test_NAS_T1109.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1110.py b/tests/bdd/core/test_NAS_T1110.py index 5ffb7529dca..4608ec39556 100644 --- a/tests/bdd/core/test_NAS_T1110.py +++ b/tests/bdd/core/test_NAS_T1110.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1111.py b/tests/bdd/core/test_NAS_T1111.py index 0f523cfcc78..4cd4459c9ac 100644 --- a/tests/bdd/core/test_NAS_T1111.py +++ b/tests/bdd/core/test_NAS_T1111.py @@ -38,10 +38,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1118.py b/tests/bdd/core/test_NAS_T1118.py index b28edcac4d7..07995f7048e 100644 --- a/tests/bdd/core/test_NAS_T1118.py +++ b/tests/bdd/core/test_NAS_T1118.py @@ -40,10 +40,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1121.py b/tests/bdd/core/test_NAS_T1121.py index 591909b8b1c..cb665980dbd 100644 --- a/tests/bdd/core/test_NAS_T1121.py +++ b/tests/bdd/core/test_NAS_T1121.py @@ -8,7 +8,6 @@ aws_secret_access_key=ACCESS_KEY """ - import boto3 import time import reusableSeleniumCode as rsc @@ -49,10 +48,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() @@ -248,8 +244,9 @@ def on_the_bucket_tab_create_a_folder_and_upload_a_file_in_it(driver): assert wait_on_element(driver, 10, '//div[contains(.,"Create folder")]') assert wait_on_element(driver, 10, '//input[@placeholder="Enter folder name"]', 'inputable') driver.find_element_by_xpath('//input[@placeholder="Enter folder name"]').send_keys('my_folder') - assert wait_on_element(driver, 5, '//awsui-button[@class="createFolder-object-actions__actions-submit"]', 'clickable') - driver.find_element_by_xpath('//awsui-button[@class="createFolder-object-actions__actions-submit"]').click() + assert wait_on_element(driver, 5, xpaths.aws.create_The_Folder_Button, 'clickable') + rsc.scroll_To(driver, xpaths.aws.create_The_Folder_Button) + driver.find_element_by_xpath(xpaths.aws.create_The_Folder_Button).click() assert wait_on_element(driver, 10, f'//h1[text()="{my_bucket}"]') assert wait_on_element(driver, 5, '//span[text()="my_folder/"]', 'clickable') s3_client = boto3.client('s3') @@ -465,8 +462,9 @@ def create_a_folder_and_upload_a_file_in_it(driver): assert wait_on_element(driver, 10, '//div[contains(.,"Create folder")]') assert wait_on_element(driver, 10, '//input[@placeholder="Enter folder name"]', 'inputable') driver.find_element_by_xpath('//input[@placeholder="Enter folder name"]').send_keys('my_folder') - assert wait_on_element(driver, 5, '//awsui-button[@class="createFolder-object-actions__actions-submit"]', 'clickable') - driver.find_element_by_xpath('//awsui-button[@class="createFolder-object-actions__actions-submit"]').click() + assert wait_on_element(driver, 5, xpaths.aws.create_The_Folder_Button, 'clickable') + rsc.scroll_To(driver, xpaths.aws.create_The_Folder_Button) + driver.find_element_by_xpath(xpaths.aws.create_The_Folder_Button).click() assert wait_on_element(driver, 5, f'//h1[text()="{my_bucket}"]') assert wait_on_element(driver, 5, '//span[text()="my_folder/"]', 'clickable') s3_client = boto3.client('s3') diff --git a/tests/bdd/core/test_NAS_T1128.py b/tests/bdd/core/test_NAS_T1128.py index 8aa1ad3c376..ae66eb179a0 100644 --- a/tests/bdd/core/test_NAS_T1128.py +++ b/tests/bdd/core/test_NAS_T1128.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1132.py b/tests/bdd/core/test_NAS_T1132.py index 411c90e8592..839f4fa511b 100644 --- a/tests/bdd/core/test_NAS_T1132.py +++ b/tests/bdd/core/test_NAS_T1132.py @@ -41,10 +41,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1135.py b/tests/bdd/core/test_NAS_T1135.py deleted file mode 100644 index ac07101cce9..00000000000 --- a/tests/bdd/core/test_NAS_T1135.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding=utf-8 -"""Core UI feature tests.""" - -import time -import reusableSeleniumCode as rsc -import xpaths -from function import ( - wait_on_element, - is_element_present, - wait_on_element_disappear -) -from pytest_bdd import ( - given, - scenario, - then, - when, - parsers -) - -import pytest -pytestmark = [pytest.mark.debug_test] - - -@scenario('features/NAS-T1135.feature', 'Verify Dropbox credentials can be added') -def test_verify_dropbox_credentials_can_be_added(driver): - """Verify Dropbox credentials can be added.""" - pass - - -@given('the browser is open on the TrueNAS URL and logged in') -def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_password): - """the browser is open on the TrueNAS URL and logged in.""" - if nas_ip not in driver.current_url: - driver.get(f"http://{nas_ip}") - assert wait_on_element(driver, 10, '//input[@placeholder="Username"]') - if not is_element_present(driver, '//mat-list-item[@ix-auto="option__Dashboard"]'): - assert wait_on_element(driver, 10, '//input[@placeholder="Username"]') - driver.find_element_by_xpath('//input[@placeholder="Username"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Username"]').send_keys('root') - driver.find_element_by_xpath('//input[@placeholder="Password"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Password"]').send_keys(root_password) - assert wait_on_element(driver, 5, '//button[@name="signin_button"]') - driver.find_element_by_xpath('//button[@name="signin_button"]').click() - if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() - - -@when('on the dashboard, click System on the left sidebar, then click on Cloud Credentials') -def on_the_dashboard_click_system_on_the_left_sidebar_then_click_on_cloud_credentials(driver): - """on the dashboard, click System on the left sidebar, then click on Cloud Credentials.""" - assert wait_on_element(driver, 10, '//li[contains(.,"Dashboard")]') - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__System"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__System"]').click() - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Cloud Credentials"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Cloud Credentials"]').click() - - -@then('on the Cloud Credentials page, click Add') -def on_the_cloud_credentials_page_click_add(driver): - """on the Cloud Credentials page, click Add.""" - assert wait_on_element(driver, 5, '//div[contains(.,"Cloud Credentials")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__Cloud Credentials_ADD"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__Cloud Credentials_ADD"]').click() - - -@then(parsers.parse('input {account_name} as Name, select Dropbox has Provider')) -def input_account_name_as_name_select_dropbox_has_provider(driver, account_name): - """input account_name as Name, select Dropbox has Provider.""" - assert wait_on_element(driver, 5, '//li[contains(.,"Add")]') - assert wait_on_element(driver, 5, '//input[@placeholder="Name"]', 'inputable') - driver.find_element_by_xpath('//input[@placeholder="Name"]').send_keys(account_name) - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Provider"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Provider"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Provider_Dropbox"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Provider_Dropbox"]').click() - - -@then('click on Login to Provider Authorization box will appear') -def click_on_login_to_provider_authorization_box_will_appear(driver): - """click on Login to Provider Authorization box will appear.""" - assert wait_on_element(driver, 5, '//button[@id="cust_button_LOGIN TO PROVIDER"]', 'clickable') - driver.find_element_by_xpath('//button[@id="cust_button_LOGIN TO PROVIDER"]').click() - driver.switch_to.window(driver.window_handles[1]) - assert wait_on_element(driver, 15, '//h1[text()="Authorization"]') - - -@then(parsers.parse('click Proceed, then enter the login "{user_name}" and "{password}"')) -def click_proceed_then_enter_the_login_user_name_and_password(driver, user_name, password): - """click Proceed, then enter the login and .""" - assert wait_on_element(driver, 10, '//a[text()="Proceed"]', 'clickable') - driver.find_element_by_xpath('//a[text()="Proceed"]').click() - assert wait_on_element(driver, 10, '//div[@class="login-header" and contains(.,"Sign in to Dropbox to link with TrueNAS CloudSync")]') - - if wait_on_element(driver, 7, '//iframe[@id="ccpa-iframe"]'): - driver.switch_to.frame('ccpa-iframe') - wait_on_element(driver, 7, '//button[contains(text(),"Accept All")]', 'clickable') - driver.find_element_by_xpath('//button[contains(text(),"Accept All")]').click() - driver.switch_to.default_content() - assert wait_on_element(driver, 5, '//button[contains(.,"Continue with Google")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Continue with Google")]').click() - assert wait_on_element(driver, 10, '//div[text()="Sign in with Google"]') - assert wait_on_element(driver, 5, '//span[text()="Sign in"]') - assert wait_on_element(driver, 5, '//input[@id="identifierId"]', 'inputable') - driver.find_element_by_xpath('//input[@id="identifierId"]').send_keys(user_name) - time.sleep(1) - assert wait_on_element(driver, 5, '//button[contains(.,"Next")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Next")]').click() - assert wait_on_element(driver, 10, '//div[text()="Sign in with Google"]') - assert wait_on_element(driver, 5, '//span[text()="Welcome"]') - assert wait_on_element(driver, 5, '//input[@type="password"]', 'inputable') - driver.find_element_by_xpath('//input[@type="password"]').send_keys(password) - time.sleep(1) - assert wait_on_element(driver, 5, '//button[contains(.,"Next")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Next")]').click() - assert rsc.wait_For_The_Tab_To_Close(driver) is True - driver.switch_to.window(driver.window_handles[0]) - - -@then('verify Access Token, OAuth Client ID and OAuth Client Secret') -def verify_access_token_oauth_client_id_and_oauth_client_secret(driver): - """verify Access Token, OAuth Client ID and OAuth Client Secret.""" - assert wait_on_element(driver, 5, '//input[@placeholder="Access Token"]', 'inputable') - element1 = driver.find_element_by_xpath('//input[@placeholder="Access Token"]') - assert element1.get_attribute('value') != '', element1.get_attribute('value') - element2 = driver.find_element_by_xpath('//input[@placeholder="OAuth Client ID"]') - assert element2.get_attribute('value') != '', element2.get_attribute('value') - element3 = driver.find_element_by_xpath('//input[@placeholder="OAuth Client Secret"]') - assert element3.get_attribute('value') != '', element3.get_attribute('value') - - -@then('click Verify Credential to verify it is valid') -def click_verify_credential_to_verify_it_is_valid(driver): - """click Verify Credential to verify it is valid.""" - assert wait_on_element(driver, 5, '//button[@ix-auto="button__VERIFY CREDENTIAL"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__VERIFY CREDENTIAL"]').click() - if wait_on_element(driver, 5, '//h1[contains(.,"Please wait")]'): - assert wait_on_element_disappear(driver, 20, '//h1[contains(.,"Please wait")]') - assert wait_on_element(driver, 10, '//h1[normalize-space(text())="Valid"]') - assert wait_on_element(driver, 10, '//textarea[text()="The Credential is valid."]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CLOSE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click() - - -@then(parsers.parse('click Summit, {account_name} should be added to the list')) -def click_summit_account_name_should_be_added_to_the_list(driver, account_name): - """click Summit, account_name should be added to the list.""" - assert wait_on_element(driver, 5, xpaths.button.summit, 'clickable') - rsc.click_The_Summit_Button(driver) - assert wait_on_element_disappear(driver, 30, '//h1[contains(.,"Please wait")]') - assert wait_on_element(driver, 5, f'//div[normalize-space(text())="{account_name}"]') diff --git a/tests/bdd/core/test_NAS_T1136.py b/tests/bdd/core/test_NAS_T1136.py deleted file mode 100644 index 292c0297bea..00000000000 --- a/tests/bdd/core/test_NAS_T1136.py +++ /dev/null @@ -1,657 +0,0 @@ -# coding=utf-8 -"""Core UI feature tests.""" - -import time -from selenium.webdriver import ActionChains -import reusableSeleniumCode as rsc -import xpaths -from function import ( - wait_on_element, - is_element_present, - wait_on_element_disappear, - ssh_cmd -) -from pytest_bdd import ( - given, - scenario, - then, - when, - parsers -) -import pytest -pytestmark = [pytest.mark.debug_test] - - -@scenario('features/NAS-T1136.feature', 'Verify Dropbox Cloud Sync task works') -def test_verify_dropox_cloud_sync_task_works(): - """Verify Dropox Cloud Sync task works.""" - pass - - -@given('the browser is open on the TrueNAS URL and logged in') -def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_password): - """the browser is open on the TrueNAS URL and logged in.""" - if nas_ip not in driver.current_url: - driver.get(f"http://{nas_ip}") - assert wait_on_element(driver, 10, '//input[@placeholder="Username"]') - if not is_element_present(driver, '//mat-list-item[@ix-auto="option__Dashboard"]'): - assert wait_on_element(driver, 10, '//input[@placeholder="Username"]') - driver.find_element_by_xpath('//input[@placeholder="Username"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Username"]').send_keys('root') - driver.find_element_by_xpath('//input[@placeholder="Password"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Password"]').send_keys(root_password) - assert wait_on_element(driver, 5, '//button[@name="signin_button"]') - driver.find_element_by_xpath('//button[@name="signin_button"]').click() - if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() - - -@when('on the dashboard, click on Storage on the side menu, click on Pools') -def on_the_dashboard_click_on_storage_on_the_side_menu_click_on_pools(driver): - """on the dashboard, click on Storage on the side menu, click on Pools.""" - assert wait_on_element(driver, 10, '//li[contains(.,"Dashboard")]') - if wait_on_element(driver, 5, '//div[contains(.,"Looking for help?")]'): - assert wait_on_element(driver, 10, '//button[@ix-auto="button__CLOSE"]') - driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click() - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Storage"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Storage"]').click() - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Pools"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Pools"]').click() - - -@then('click on the system pool three dots button, select Add Dataset') -def click_on_the_system_pool_three_dots_button_select_add_dataset(driver): - """click on the system pool three dots button, select Add Dataset.""" - assert wait_on_element(driver, 5, '//div[contains(.,"Pools")]') - assert wait_on_element(driver, 5, '//mat-icon[@id="actions_menu_button__system"]', 'clickable') - driver.find_element_by_xpath('//mat-icon[@id="actions_menu_button__system"]').click() - assert wait_on_element(driver, 7, '//div[@class="title" and contains(.,"Dataset Actions")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="action__system_Create Snapshot"]', 'clickable') - assert wait_on_element(driver, 5, '//button[@ix-auto="action__system_Add Dataset"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="action__system_Add Dataset"]').click() - assert wait_on_element(driver, 5, '//h4[contains(.,"Name and Options")]') - - -@then('input dropbox_cloud for Name, select Generic as Share Type and click Submit') -def input_dropbox_cloud_for_name_select_generic_as_share_type_and_click_submit(driver): - """input dropbox_cloud for Name, select Generic as Share Type, and click Submit.""" - assert wait_on_element(driver, 5, '//input[@ix-auto="input__Name"]', 'inputable') - driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').clear() - driver.find_element_by_xpath('//input[@ix-auto="input__Name"]').send_keys('dropbox_cloud') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Share Type"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Share Type"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Share Type_Generic"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Share Type_Generic"]').click() - assert wait_on_element(driver, 5, xpaths.button.summit, 'clickable') - rsc.click_The_Summit_Button(driver) - - -@then('the dataset should be created without error') -def the_dataset_should_be_created_without_error(driver): - """the dataset should be created without error.""" - assert wait_on_element_disappear(driver, 30, '//h6[contains(.,"Please wait")]') - assert wait_on_element(driver, 10, '//span[contains(.,"dropbox_cloud")]') - - -@then('click Tasks on the left sidebar, then click on Cloud Sync Tasks') -def click_tasks_on_the_left_sidebar_then_click_on_cloud_sync_tasks(driver): - """click Tasks on the left sidebar, then click on Cloud Sync Tasks.""" - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Tasks"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Tasks"]').click() - assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Cloud Sync Tasks"]', 'clickable') - driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Cloud Sync Tasks"]').click() - - -@then('on the Cloud Sync Tasks, click ADD') -def on_the_cloud_sync_tasks_click_add(driver): - """on the Cloud Sync Tasks, click ADD.""" - assert wait_on_element(driver, 5, '//div[contains(.,"Cloud Sync Tasks")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__Cloud Sync Tasks_ADD"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__Cloud Sync Tasks_ADD"]').click() - - -@then('input a description and ensure PULL is selected as the Direction') -def input_a_description_and_ensure_pull_is_selected_as_the_direction(driver): - """input a description and ensure PULL is selected as the Direction.""" - assert wait_on_element(driver, 7, '//mat-checkbox[@ix-auto="checkbox__Follow Symlinks"]', 'clickable') - assert wait_on_element(driver, 5, '//input[@placeholder="Description"]', 'inputable') - driver.find_element_by_xpath('//input[@placeholder="Description"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Description"]').send_keys('My Dropbox task') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PULL")]') - - -@then(parsers.parse('select "{selection}" under the Credential drop-down')) -def select_selection_under_the_credential_dropdown(driver, selection): - """select "selection" under the Credential drop-down.""" - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Credential"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Credential"]').click() - assert wait_on_element(driver, 5, f'//mat-option[@ix-auto="option__Credential_{selection}"]', 'clickable') - driver.find_element_by_xpath(f'//mat-option[@ix-auto="option__Credential_{selection}"]').click() - time.sleep(0.5) - - -@then(parsers.parse('select {path} folder, then Under Directory/Files, choose dropbox_cloud')) -def select_the_path_folder_then_under_directoryfiles_choose_dropbox_cloud(driver, path): - """select {path} folder, then Under Directory/Files, choose dropbox_cloud.""" - assert wait_on_element(driver, 5, '//input[@placeholder="Folder"]') - driver.find_element_by_xpath('//input[@placeholder="Folder"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Folder"]').send_keys(path) - assert wait_on_element(driver, 5, '//input[@placeholder="Directory/Files"]') - driver.find_element_by_xpath('//input[@placeholder="Directory/Files"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Directory/Files"]').send_keys('/mnt/system/dropbox_cloud') - - -@then('under Transfer Mode, select COPY, click Save') -def under_transfer_mode_select_copy_click_save(driver): - """under Transfer Mode, select COPY, click Save.""" - assert wait_on_element(driver, 5, '//mat-select[contains(.,"COPY")]') - assert wait_on_element(driver, 5, xpaths.button.summit, 'clickable') - rsc.click_The_Summit_Button(driver) - assert wait_on_element_disappear(driver, 30, '//h6[contains(.,"Please wait")]') - - -@then('the Dropbox tasks should save without error') -def the_dropbox_tasks_should_save_without_error(driver): - """the Dropbox tasks should save without error.""" - assert wait_on_element(driver, 7, '//div[contains(.,"Cloud Sync Tasks")]') - assert wait_on_element(driver, 10, '//div[contains(text(),"My Dropbox task")]') - - -@then('expand the task on the NAS UI and click Run Now') -def expand_the_task_on_the_nas_ui_and_click_run_now(driver): - """expand the task on the NAS UI and click Run Now.""" - assert wait_on_element(driver, 5, '//a[@ix-auto="expander__My Dropbox task"]', 'clickable') - driver.find_element_by_xpath('//a[@ix-auto="expander__My Dropbox task"]').click() - time.sleep(0.5) - assert wait_on_element(driver, 5, '//button[@id="action_button___run_now"]', 'clickable') - driver.find_element_by_xpath('//button[@id="action_button___run_now"]').click() - assert wait_on_element(driver, 5, '//h1[text()="Run Now"]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CONTINUE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CONTINUE"]').click() - assert wait_on_element(driver, 7, '//h1[contains(text(),"Task Started")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CLOSE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click() - assert wait_on_element_disappear(driver, 30, '//h1[contains(text(),"Task Started")]') - time.sleep(1) - assert wait_on_element(driver, 180, '//button[@id="My Dropbox task_Status-button" and contains(.,"SUCCESS")]') - - -@then('verify all files are copied from Dropbox are into the dataset') -def verify_all_files_are_copied_from_dropbox_are_into_the_dataset(driver, nas_ip): - """verify all files are copied from Dropbox are into the dataset.""" - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - timeout = time.time() + 30 - while timeout > time.time(): - if ssh_cmd(cmd, 'root', 'testing', nas_ip)['result']: - break - cmd = 'test -f /mnt/system/dropbox_cloud/Gloomy_Forest_wallpaper_ForWallpapercom.jpg' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/Explaining_BSD.pdf' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - - -@then('on the NAS cloud sync task tab, click Edit') -def on_the_nas_cloud_sync_task_tab_click_edit(driver): - """on the NAS cloud sync task tab, click Edit.""" - driver.switch_to.window(driver.window_handles[0]) - time.sleep(2) - assert wait_on_element(driver, 7, '//div[contains(.,"Cloud Sync Tasks")]') - assert wait_on_element(driver, 10, '//div[contains(text(),"My Dropbox task")]') - assert wait_on_element(driver, 5, '//a[@ix-auto="expander__My Dropbox task"]', 'clickable') - if not wait_on_element(driver, 2, '//button[@ix-auto="button___edit"]'): - driver.find_element_by_xpath('//a[@ix-auto="expander__My Dropbox task"]').click() - assert wait_on_element(driver, 7, '//p[contains(text(),"dropboxcredentials")]') - assert wait_on_element(driver, 7, '//button[@ix-auto="button___edit"]') - time.sleep(2) - assert wait_on_element(driver, 7, '//button[@ix-auto="button___edit"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button___edit"]').click() - assert wait_on_element(driver, 5, '//h4[contains(.,"Transfer")]') - assert wait_on_element(driver, 5, '//h4[contains(.,"Advanced Options")]') - time.sleep(1) - - -@then('select PUSH as the Direction then under Transfer Mode, select COPY') -def select_push_as_the_direction_then_under_transfer_mode_select_copy(driver): - """select PUSH as the Direction then under Transfer Mode, select COPY.""" - assert wait_on_element(driver, 7, '//mat-checkbox[@ix-auto="checkbox__Follow Symlinks"]', 'clickable') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PULL")]') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"COPY")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Direction"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Direction"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Direction_PUSH"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Direction_PUSH"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PUSH")]') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"COPY")]') - - -@then(parsers.parse('select the {path} folder, and click save')) -def select_the_path_folder_and_click_save(driver, path): - """select the {path} folder, and click save.""" - assert wait_on_element(driver, 5, '//input[@placeholder="Folder"]', 'inputable') - driver.find_element_by_xpath('//input[@placeholder="Folder"]').clear() - driver.find_element_by_xpath('//input[@placeholder="Folder"]').send_keys(path) - assert wait_on_element(driver, 5, '//button[@id="save_button"]', 'clickable') - driver.find_element_by_xpath('//button[@id="save_button"]').click() - assert wait_on_element_disappear(driver, 30, '//h1[contains(.,"Please wait")]') - # give time to the system to handle changes - time.sleep(2) - - -@then(parsers.parse('open a new tab navigate to "{dropbox_url}"')) -def open_a_new_tab_navigate_to_dropbox_url_and_input_account_id(driver, dropbox_url): - """open a new tab navigate to and input .""" - driver.execute_script("window.open();") - driver.switch_to.window(driver.window_handles[1]) - driver.get(dropbox_url) - time.sleep(2) - - -@then(parsers.parse('input "{user_name}" and "{password}", click Sign in')) -def input_user_name_and_password_click_sign_in(driver, user_name, password): - """input and , click Sign in.""" - if wait_on_element(driver, 3, '//img[@class="dropbox-logo__type"]'): - assert wait_on_element(driver, 5, '//button[contains(.,"Sign in with Google")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Sign in with Google")]').click() - driver.switch_to.window(driver.window_handles[2]) - assert wait_on_element(driver, 10, '//div[text()="Sign in with Google"]') - assert wait_on_element(driver, 5, '//span[text()="Sign in"]') - assert wait_on_element(driver, 5, '//input[@id="identifierId"]', 'inputable') - driver.find_element_by_xpath('//input[@id="identifierId"]').send_keys(user_name) - time.sleep(1) - assert wait_on_element(driver, 5, '//button[contains(.,"Next")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Next")]').click() - assert wait_on_element(driver, 10, '//div[text()="Sign in with Google"]') - assert wait_on_element(driver, 5, '//span[text()="Welcome"]') - assert wait_on_element(driver, 5, '//input[@type="password"]', 'inputable') - driver.find_element_by_xpath('//input[@type="password"]').send_keys(password) - time.sleep(1) - assert wait_on_element(driver, 5, '//button[contains(.,"Next")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Next")]').click() - while len(driver.window_handles) != 2: - time.sleep(1) - driver.switch_to.window(driver.window_handles[1]) - assert wait_on_element(driver, 15, '//nav[contains(.,"Dropbox")]//span[text()="Dropbox"]') - time.sleep(2) - - -@then(parsers.parse('click on {folder1} then click on the test folder')) -def click_on_folder1_then_click_on_the_test_folder(driver, folder1): - """click on {folder1} then click on the test folder.""" - assert wait_on_element(driver, 5, f'//span[text()="{folder1}"]', 'clickable') - driver.find_element_by_xpath(f'//span[text()="{folder1}"]').click() - time.sleep(1) - assert wait_on_element(driver, 10, '//nav[contains(.,"Dropbox")]//span[text()="Dropbox"]', 'clickable') - assert wait_on_element(driver, 10, f'//nav[contains(.,"{folder1}")]//span[text()="{folder1}"]') - assert wait_on_element(driver, 10, '//span[text()="initial"]', 'clickable') - assert wait_on_element(driver, 15, '//span[text()="test"]', 'clickable') - time.sleep(1) - driver.find_element_by_xpath('//span[text()="test"]').click() - time.sleep(1.5) - - -@then('verify all files are in the test folder') -def verify_all_files_are_in_the_test_folder(driver): - """verify all files are in the test folder.""" - assert wait_on_element(driver, 10, '//nav[contains(.,"test")]//span[text()="test"]') - assert wait_on_element(driver, 10, '//span[text()="music"]', 'clickable') - assert wait_on_element(driver, 7, '//span[text()="Explaining_BSD.pdf"]', 'clickable') - assert wait_on_element(driver, 5, '//span[text()="Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]', 'clickable') - driver.find_element_by_xpath('//span[text()="music"]').click() - assert wait_on_element(driver, 7, '//nav[contains(.,"music")]//span[text()="music"]') - assert wait_on_element(driver, 7, '//span[text()="Mr_Smith_Pequeñas_Guitarras.mp3"]', 'clickable') - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//a[contains(.,"test")]', 'clickable') - driver.find_element_by_xpath('//nav[contains(.,"test")]//a[contains(.,"test")]').click() - - -@then('remove all files from the dataset') -def remove_all_files_from_the_dataset(driver, nas_ip): - """remove all files from the dataset.""" - cmd = 'rm -f /mnt/system/dropbox_cloud/Gloomy_Forest_wallpaper_ForWallpapercom.jpg' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'rm -f /mnt/system/dropbox_cloud/Explaining_BSD.pdf' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'rm -rf /mnt/system/dropbox_cloud/music' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - - -@then('select PULL as the Direction then under Transfer Mode, select MOVE') -def select_pull_as_the_direction_then_under_transfer_mode_select_move(driver): - """select PULL as the Direction then under Transfer Mode, select MOVE.""" - assert wait_on_element(driver, 7, '//mat-checkbox[@ix-auto="checkbox__Follow Symlinks"]', 'clickable') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PUSH")]') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"COPY")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Direction"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Direction"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Direction_PULL"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Direction_PULL"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PULL")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Transfer Mode"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Transfer Mode"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Transfer Mode_MOVE"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Transfer Mode_MOVE"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"MOVE")]') - - -@then('click Save, the Dropbox tasks should save without error') -def click_save_the_dropbox_tasks_should_save_without_error(driver): - """click Save, the Dropbox tasks should save without error.""" - assert wait_on_element(driver, 5, '//button[@id="save_button"]', 'clickable') - driver.find_element_by_xpath('//button[@id="save_button"]').click() - assert wait_on_element_disappear(driver, 30, '//h6[contains(.,"Please wait")]') - assert wait_on_element(driver, 7, '//div[contains(.,"Cloud Sync Tasks")]') - assert wait_on_element(driver, 10, '//div[contains(text(),"My Dropbox task")]') - # give time to the system to handle changes - time.sleep(2) - - -@then('verify all files are moved from the Dropbox test folder to the dataset') -def verify_all_files_are_moved_from_the_dropbox_test_folder_to_the_dataset(driver, nas_ip): - """verify all files are moved from the Dropbox test folder to the dataset.""" - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - timeout = time.time() + 30 - while timeout > time.time(): - if ssh_cmd(cmd, 'root', 'testing', nas_ip)['result']: - break - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/Explaining_BSD.pdf' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - driver.switch_to.window(driver.window_handles[1]) - time.sleep(0.5) - driver.refresh() - time.sleep(1) - assert wait_on_element(driver, 7, '//nav[contains(.,"test")]//span[text()="test"]') - assert wait_on_element(driver, 7, '//span[text()="music"]') - assert not is_element_present(driver, '//span[text()="Explaining_BSD.pdf"]') - assert not is_element_present(driver, '//span[text()="Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]') - driver.find_element_by_xpath('//span[text()="music"]').click() - assert wait_on_element(driver, 5, '//nav[contains(.,"music")]//span[text()="music"]') - assert not is_element_present(driver, '//span[text()="Mr_Smith_Pequeñas_Guitarras.mp3"]') - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//a[contains(.,"test")]', 'clickable') - driver.find_element_by_xpath('//nav[contains(.,"test")]//a[contains(.,"test")]').click() - cmd = 'test -f /mnt/system/dropbox_cloud/Gloomy_Forest_wallpaper_ForWallpapercom.jpg' - - -@then('select PUSH as the Direction then under Transfer Mode, select MOVE') -def select_push_as_the_direction_then_under_transfer_mode_select_move(driver): - """select PUSH as the Direction then under Transfer Mode, select MOVE.""" - assert wait_on_element(driver, 7, '//mat-checkbox[@ix-auto="checkbox__Follow Symlinks"]', 'clickable') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PULL")]') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"MOVE")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Direction"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Direction"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Direction_PUSH"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Direction_PUSH"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PUSH")]') - assert wait_on_element(driver, 5, '//h1[contains(.,"Transfer Mode Reset")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CLOSE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"COPY")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Transfer Mode"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Transfer Mode"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Transfer Mode_MOVE"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Transfer Mode_MOVE"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"MOVE")]') - - -@then('verify all files are moved from the dataset to the Dropbox test folder') -def verify_all_files_are_moved_from_the_dataset_to_the_dropbox_test_folder(driver, nas_ip): - """verify all files are moved from the dataset to the Dropbox test folder.""" - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - timeout = time.time() + 30 - while timeout > time.time(): - if not ssh_cmd(cmd, 'root', 'testing', nas_ip)['result']: - break - cmd = 'test -f /mnt/system/dropbox_cloud/Gloomy_Forest_wallpaper_ForWallpapercom.jpg' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is False, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/Explaining_BSD.pdf' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is False, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is False, results['output'] - driver.switch_to.window(driver.window_handles[1]) - time.sleep(2) - driver.refresh() - time.sleep(2) - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//span[text()="test"]') - assert wait_on_element(driver, 7, '//span[text()="Explaining_BSD.pdf"]') - assert wait_on_element(driver, 7, '//span[text()="Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]') - assert wait_on_element(driver, 7, '//span[text()="music"]', 'clickable') - driver.find_element_by_xpath('//span[text()="music"]').click() - assert wait_on_element(driver, 5, '//nav[contains(.,"music")]//span[text()="music"]') - assert wait_on_element(driver, 5, '//span[text()="Mr_Smith_Pequeñas_Guitarras.mp3"]') - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//a[contains(.,"test")]', 'clickable') - driver.find_element_by_xpath('//nav[contains(.,"test")]//a[contains(.,"test")]').click() - - -@then('select PULL as the Direction then under Transfer Mode, select SYNC') -def select_pull_as_the_direction_then_under_transfer_mode_select_sync(driver): - """select PULL as the Direction then under Transfer Mode, select SYNC.""" - assert wait_on_element(driver, 7, '//mat-checkbox[@ix-auto="checkbox__Follow Symlinks"]', 'clickable') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PUSH")]') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"MOVE")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Direction"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Direction"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Direction_PULL"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Direction_PULL"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PULL")]') - assert wait_on_element(driver, 5, '//h1[contains(.,"Transfer Mode Reset")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CLOSE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"COPY")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Transfer Mode"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Transfer Mode"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Transfer Mode_SYNC"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Transfer Mode_SYNC"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"SYNC")]') - - -@then('verify all files are sync to the dataset folder') -def verify_all_files_are_sync_to_the_dataset_folder(driver, nas_ip): - """verify all files are sync to the dataset folder.""" - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - timeout = time.time() + 30 - while timeout > time.time(): - if ssh_cmd(cmd, 'root', 'testing', nas_ip)['result']: - break - cmd = 'test -f /mnt/system/dropbox_cloud/Gloomy_Forest_wallpaper_ForWallpapercom.jpg' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/Explaining_BSD.pdf' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - - -@then('on the Dropbox test folder tab, delete one file') -def on_the_dropbox_test_folder_tab_delete_one_file(driver): - """on the Dropbox test folder tab, delete one file.""" - driver.switch_to.window(driver.window_handles[1]) - time.sleep(1) - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//span[text()="test"]') - assert wait_on_element(driver, 5, '//span[text()="Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]', 'clickable') - assert wait_on_element(driver, 5, '//span[text()="music"]', 'clickable') - assert wait_on_element(driver, 5, '//span[text()="Explaining_BSD.pdf"]', 'clickable') - action = ActionChains(driver) - action.move_to_element(driver.find_element_by_xpath('//tr[contains(.,"Gloomy_Forest_wallpaper_ForWallpapercom.jpg")]')).perform() - assert wait_on_element(driver, 5, '//button[@aria-label="More menu"]', 'clickable') - driver.find_element_by_xpath('//button[@aria-label="More menu"]').click() - assert wait_on_element(driver, 5, '//div[text()="Delete"]', 'clickable') - driver.find_element_by_xpath('//div[text()="Delete"]').click() - assert wait_on_element(driver, 5, '//h2[contains(.,"Delete file?")]') - assert wait_on_element(driver, 5, '//button[contains(.,"Delete")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Delete")]').click() - assert wait_on_element_disappear(driver, 10, '//span[text()="Gloomy_Forest_wallpaper_ForWallpapercom.jpg"]') - - -@then('on the NAS cloud sync task tab, click Run Now') -def on_the_nas_cloud_sync_task_tab_click_run_now(driver): - """on the NAS cloud sync task tab, click Run Now.""" - driver.switch_to.window(driver.window_handles[0]) - assert wait_on_element(driver, 7, '//div[contains(.,"Cloud Sync Tasks")]') - assert wait_on_element(driver, 10, '//div[contains(text(),"My Dropbox task")]') - assert wait_on_element(driver, 5, '//a[@ix-auto="expander__My Dropbox task"]', 'clickable') - time.sleep(0.5) - assert wait_on_element(driver, 5, '//button[@id="action_button___run_now"]', 'clickable') - driver.find_element_by_xpath('//button[@id="action_button___run_now"]').click() - assert wait_on_element(driver, 5, '//h1[text()="Run Now"]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CONTINUE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CONTINUE"]').click() - assert wait_on_element(driver, 7, '//h1[contains(text(),"Task Started")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CLOSE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click() - assert wait_on_element_disappear(driver, 30, '//h1[contains(text(),"Task Started")]') - time.sleep(1) - assert wait_on_element(driver, 180, '//button[@id="My Dropbox task_Status-button" and contains(.,"SUCCESS")]') - - -@then('verify the file is removed from the dataset folder') -def verify_the_file_is_removed_from_the_dataset_folder(driver, nas_ip): - """verify the file is removed from the dataset folder.""" - cmd = 'test -f /mnt/system/dropbox_cloud/Gloomy_Forest_wallpaper_ForWallpapercom.jpg' - timeout = time.time() + 30 - while timeout > time.time(): - if not ssh_cmd(cmd, 'root', 'testing', nas_ip)['result']: - break - cmd = 'test -f /mnt/system/dropbox_cloud/Gloomy_Forest_wallpaper_ForWallpapercom.jpg' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is False, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/Explaining_BSD.pdf' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - cmd = 'test -f /mnt/system/dropbox_cloud/music/Mr_Smith_Pequeñas_Guitarras.mp3' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - - -@then('on the Dropbox test folder tab, delete all file') -def on_the_dropbox_test_folder_tab_delete_all_file(driver): - """on the Dropbox test folder tab, delete all file.""" - driver.switch_to.window(driver.window_handles[1]) - time.sleep(1) - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//span[text()="test"]') - assert wait_on_element(driver, 5, '//span[text()="music"]', 'clickable') - assert wait_on_element(driver, 5, '//span[text()="Explaining_BSD.pdf"]', 'clickable') - action = ActionChains(driver) - action.move_to_element(driver.find_element_by_xpath('//tr[contains(.,"Explaining_BSD.pdf")]')).perform() - assert wait_on_element(driver, 5, '//button[@aria-label="More menu"]', 'clickable') - driver.find_element_by_xpath('//button[@aria-label="More menu"]').click() - assert wait_on_element(driver, 5, '//div[text()="Delete"]', 'clickable') - driver.find_element_by_xpath('//div[text()="Delete"]').click() - assert wait_on_element(driver, 5, '//h2[contains(.,"Delete file?")]') - assert wait_on_element(driver, 5, '//button[contains(.,"Delete")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Delete")]').click() - assert wait_on_element(driver, 5, '//span[text()="Explaining_BSD.pdf"]', 'clickable') - action = ActionChains(driver) - action.move_to_element(driver.find_element_by_xpath('//tr[contains(.,"music")]')).perform() - assert wait_on_element(driver, 5, '//button[@aria-label="More menu"]', 'clickable') - driver.find_element_by_xpath('//button[@aria-label="More menu"]').click() - assert wait_on_element(driver, 5, '//div[text()="Delete"]', 'clickable') - driver.find_element_by_xpath('//div[text()="Delete"]').click() - assert wait_on_element(driver, 5, '//h2[contains(.,"Delete folder?")]') - assert wait_on_element(driver, 5, '//button[contains(.,"Delete")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Delete")]').click() - assert wait_on_element_disappear(driver, 10, '//span[text()="music"]') - - -@then('select PUSH as the Direction then under Transfer Mode, select SYNC') -def select_push_as_the_direction_then_under_transfer_mode_select_sync(driver): - """select PUSH as the Direction then under Transfer Mode, select SYNC.""" - assert wait_on_element(driver, 7, '//mat-checkbox[@ix-auto="checkbox__Follow Symlinks"]', 'clickable') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PULL")]') - assert wait_on_element(driver, 5, '//mat-select[contains(.,"SYNC")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Direction"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Direction"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Direction_PUSH"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Direction_PUSH"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"PUSH")]') - assert wait_on_element(driver, 5, '//h1[contains(.,"Transfer Mode Reset")]') - assert wait_on_element(driver, 5, '//button[@ix-auto="button__CLOSE"]', 'clickable') - driver.find_element_by_xpath('//button[@ix-auto="button__CLOSE"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"COPY")]') - assert wait_on_element(driver, 5, '//mat-select[@ix-auto="select__Transfer Mode"]', 'clickable') - driver.find_element_by_xpath('//mat-select[@ix-auto="select__Transfer Mode"]').click() - assert wait_on_element(driver, 5, '//mat-option[@ix-auto="option__Transfer Mode_SYNC"]', 'clickable') - driver.find_element_by_xpath('//mat-option[@ix-auto="option__Transfer Mode_SYNC"]').click() - assert wait_on_element(driver, 5, '//mat-select[contains(.,"SYNC")]') - - -@then('verify all files are sync to the Dropbox test folder tab') -def verify_all_files_are_sync_to_the_Dropbox_test_folder_tab(driver): - """verify all files are sync to the Dropbox test folder tab.""" - driver.switch_to.window(driver.window_handles[1]) - time.sleep(0.5) - driver.refresh() - time.sleep(2) - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//span[text()="test"]') - assert wait_on_element(driver, 7, '//span[text()="Explaining_BSD.pdf"]', 'clickable') - assert wait_on_element(driver, 5, '//span[text()="music"]', 'clickable') - driver.find_element_by_xpath('//span[text()="music"]').click() - time.sleep(0.5) - assert wait_on_element(driver, 10, '//nav[contains(.,"music")]//span[text()="music"]') - assert wait_on_element(driver, 10, '//span[text()="Mr_Smith_Pequeñas_Guitarras.mp3"]', 'clickable') - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//a[contains(.,"test")]', 'clickable') - driver.find_element_by_xpath('//nav[contains(.,"test")]//a[contains(.,"test")]').click() - - -@then('on the dataset folder, delete a file') -def on_the_dataset_folder_delete_a_file(driver, nas_ip): - """on the dataset folder, delete a file.""" - cmd = 'rm -rf /mnt/system/dropbox_cloud/music' - results = ssh_cmd(cmd, 'root', 'testing', nas_ip) - assert results['result'] is True, results['output'] - - -@then('verify the file is removed from the Dropbox test folder tab') -def verify_the_file_is_removed_from_the_dropbox_test_folder_tab(driver): - """verify the file is removed from the Dropbox test folder tab.""" - driver.switch_to.window(driver.window_handles[1]) - time.sleep(1) - # loop for 15 second or until music disappear - timeout = time.time() + 15 - while timeout > time.time(): - driver.refresh() - time.sleep(1) - assert wait_on_element(driver, 5, '//nav[contains(.,"test")]//span[text()="test"]') - assert wait_on_element(driver, 7, '//span[text()="Explaining_BSD.pdf"]') - if not is_element_present(driver, '//span[text()="music"]'): - assert not is_element_present(driver, '//span[text()="music"]') - break - else: - assert not is_element_present(driver, '//span[text()="music"]') - # clean the test folder on box tab before closing the tab. - assert wait_on_element(driver, 5, '//span[text()="Explaining_BSD.pdf"]', 'clickable') - time.sleep(0.5) - action = ActionChains(driver) - action.move_to_element(driver.find_element_by_xpath('//span[text()="Explaining_BSD.pdf"]')).perform() - assert wait_on_element(driver, 5, '//button[@aria-label="More menu"]', 'clickable') - driver.find_element_by_xpath('//button[@aria-label="More menu"]').click() - assert wait_on_element(driver, 5, '//div[text()="Delete"]', 'clickable') - driver.find_element_by_xpath('//div[text()="Delete"]').click() - assert wait_on_element(driver, 5, '//h2[contains(.,"Delete file?")]') - assert wait_on_element(driver, 5, '//button[contains(.,"Delete")]', 'clickable') - driver.find_element_by_xpath('//button[contains(.,"Delete")]').click() - assert wait_on_element_disappear(driver, 10, '//span[text()="Explaining_BSD.pdf"]') - driver.close() - driver.switch_to.window(driver.window_handles[0]) diff --git a/tests/bdd/core/test_NAS_T1140.py b/tests/bdd/core/test_NAS_T1140.py index 6422e157780..ed9b8af4869 100644 --- a/tests/bdd/core/test_NAS_T1140.py +++ b/tests/bdd/core/test_NAS_T1140.py @@ -39,10 +39,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1141.py b/tests/bdd/core/test_NAS_T1141.py index 9e258d3d994..b4086f44b64 100644 --- a/tests/bdd/core/test_NAS_T1141.py +++ b/tests/bdd/core/test_NAS_T1141.py @@ -42,10 +42,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1142.py b/tests/bdd/core/test_NAS_T1142.py index ae22422c150..38d3e1c27da 100644 --- a/tests/bdd/core/test_NAS_T1142.py +++ b/tests/bdd/core/test_NAS_T1142.py @@ -41,10 +41,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1143.py b/tests/bdd/core/test_NAS_T1143.py index 1041386cb6a..84163ff9cea 100644 --- a/tests/bdd/core/test_NAS_T1143.py +++ b/tests/bdd/core/test_NAS_T1143.py @@ -42,10 +42,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1216.py b/tests/bdd/core/test_NAS_T1216.py index a3518782408..fb96e74874e 100644 --- a/tests/bdd/core/test_NAS_T1216.py +++ b/tests/bdd/core/test_NAS_T1216.py @@ -41,10 +41,7 @@ def the_browser_is_open_the_freenas_url_and_logged_in(driver, nas_ip, root_passw assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_NAS_T1222.py b/tests/bdd/core/test_NAS_T1222.py index 360dd3c9437..f22f825c4de 100644 --- a/tests/bdd/core/test_NAS_T1222.py +++ b/tests/bdd/core/test_NAS_T1222.py @@ -41,10 +41,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 5, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 5, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/core/test_last_NAS_T1047.py b/tests/bdd/core/test_last_NAS_T1047.py index 025c88e0316..33f7c5b78f4 100644 --- a/tests/bdd/core/test_last_NAS_T1047.py +++ b/tests/bdd/core/test_last_NAS_T1047.py @@ -43,10 +43,7 @@ def the_browser_is_open_on_the_truenas_url_and_logged_in(driver, nas_ip, root_pa assert wait_on_element(driver, 4, '//button[@name="signin_button"]') driver.find_element_by_xpath('//button[@name="signin_button"]').click() if not is_element_present(driver, '//li[contains(.,"Dashboard")]'): - assert wait_on_element(driver, 10, '//span[contains(.,"root")]') - element = driver.find_element_by_xpath('//span[contains(.,"root")]') - driver.execute_script("arguments[0].scrollIntoView();", element) - time.sleep(0.5) + rsc.scroll_To(driver, xpaths.sideMenu.root) assert wait_on_element(driver, 7, '//mat-list-item[@ix-auto="option__Dashboard"]', 'clickable') driver.find_element_by_xpath('//mat-list-item[@ix-auto="option__Dashboard"]').click() diff --git a/tests/bdd/reusableSeleniumCode.py b/tests/bdd/reusableSeleniumCode.py index 878a09f80e5..b168c6473e4 100644 --- a/tests/bdd/reusableSeleniumCode.py +++ b/tests/bdd/reusableSeleniumCode.py @@ -18,3 +18,10 @@ def wait_For_The_Tab_To_Close(driver): time.sleep(1) else: return False + + +def scroll_To(driver, xpath): + assert wait_on_element(driver, 5, xpath) + element = driver.find_element_by_xpath(xpath) + driver.execute_script("arguments[0].scrollIntoView();", element) + time.sleep(0.2) diff --git a/tests/bdd/xpaths.py b/tests/bdd/xpaths.py index 0987d9ff666..db742da6396 100644 --- a/tests/bdd/xpaths.py +++ b/tests/bdd/xpaths.py @@ -85,4 +85,5 @@ def aws_button(field): create_Folder_Button = aws_button('create-folder-button') delete_Button = aws_button('delete-objects-button') upload_Button = aws_button('upload-button') - check_All_Checkbox = '(//input[contains(@class,"awsui_native-input")])[1]' \ No newline at end of file + check_All_Checkbox = '//input[@type="checkbox" and @tabindex="-1"]' + create_The_Folder_Button = '//awsui-button[@class="createFolder-object-actions__actions-submit"]'