From 89ef8e7e2d2dde78943afa25b71595605c12b2ed Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 22:58:42 -0500 Subject: [PATCH 01/18] Explicit wait for all elements --- guiTests/guiTest.py | 97 ++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 55 deletions(-) diff --git a/guiTests/guiTest.py b/guiTests/guiTest.py index f90395d51..91907be7c 100644 --- a/guiTests/guiTest.py +++ b/guiTests/guiTest.py @@ -76,7 +76,9 @@ def sha1_folder(folder): def wait_for_text(time, xpath, text): WebDriverWait(driver, time).until(expected_conditions.text_to_be_present_in_element((By.XPATH, xpath), text)) - +def wait_for_load(time, by, target): + return WebDriverWait(driver, time).until(EC.presence_of_element_located(by, target)) + BACKUP_NAME = "BackupName" PASSWORD = "the_backup_password_is_really_long_and_safe" SOURCE_FOLDER = os.path.abspath("duplicati_gui_test_source") @@ -101,67 +103,57 @@ write_random_file(100 * 1024, SOURCE_FOLDER + os.sep + "subfolder" + os.sep + "1 sha1_source = sha1_folder(SOURCE_FOLDER) # Dismiss the password request -time.sleep(1) -driver.find_element_by_link_text("No, my machine has only a single account").click() +wait_for_load(10, By.LINK_TEXT, "No, my machine has only a single account").click() # Add new backup -time.sleep(1) -driver.find_element_by_link_text("Add backup").click() +wait_for_load(10, By.LINK_TEXT, "Add backup").click() # Choose the "add new" option -time.sleep(1) -driver.find_element_by_id("blank").click() -driver.find_element_by_xpath("//input[@class='submit next']").click() +wait_for_load(10, By.ID, "blank").click() +wait_for_load(10, By.XPATH, "//input[@class='submit next']").click() # Add new backup - General page -time.sleep(1) -driver.find_element_by_id("name").send_keys(BACKUP_NAME) -driver.find_element_by_id("passphrase").send_keys(PASSWORD) -driver.find_element_by_id("repeat-passphrase").send_keys(PASSWORD) -driver.find_element_by_id("nextStep1").click() +wait_for_load(10, By.ID, "name").send_keys(BACKUP_NAME) +wait_for_load(10, By.ID, "passphrase").send_keys(PASSWORD) +wait_for_load(10, By.ID, "repeat-passphrase").send_keys(PASSWORD) +wait_for_load(10, By.ID, "nextStep1").click() # Add new backup - Destination page -time.sleep(1) -driver.find_element_by_link_text("Manually type path").click() -driver.find_element_by_id("file_path").send_keys(DESTINATION_FOLDER) -driver.find_element_by_id("nextStep2").click() +wait_for_load(10, By.LINK_TEXT, "Manually type path").click() +wait_for_load(10, By.ID, "file_path").send_keys(DESTINATION_FOLDER) +wait_for_load(10, By.ID, "nextStep2").click() # Add new backup - Source Data page -time.sleep(1) -driver.find_element_by_id("sourcePath").send_keys(os.path.abspath(SOURCE_FOLDER) + os.sep) -driver.find_element_by_id("sourceFolderPathAdd").click() -driver.find_element_by_id("nextStep3").click() +wait_for_load(10, By.ID, "sourcePath").send_keys(os.path.abspath(SOURCE_FOLDER) + os.sep) +wait_for_load(10, By.ID, "sourceFolderPathAdd").click() +wait_for_load(10, By.ID, "nextStep3").click() # Add new backup - Schedule page -time.sleep(1) -useScheduleRun = driver.find_element_by_id("useScheduleRun") +useScheduleRun = wait_for_load(10, By.ID, "useScheduleRun") if useScheduleRun.is_selected(): useScheduleRun.click() -driver.find_element_by_id("nextStep4").click() +wait_for_load(10, By.ID, "nextStep4").click() # Add new backup - Options page -time.sleep(1) -driver.find_element_by_id("save").click() +wait_for_load(10, By.ID, "save").click() # Run the backup job and wait for finish -time.sleep(1) -driver.find_element_by_link_text(BACKUP_NAME).click() +wait_for_load(10, By.LINK_TEXT, BACKUP_NAME).click() [n for n in driver.find_elements_by_xpath("//dl[@class='taskmenu']/dd/p/span[contains(text(),'Run now')]") if n.is_displayed()][0].click() wait_for_text(60, "//div[@class='task ng-scope']/dl[2]/dd[1]", "(took ") # Restore if len([n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Restore files \u2026')]") if n.is_displayed()]) == 0: - driver.find_element_by_link_text(BACKUP_NAME).click() + wait_for_load(10, By.LINK_TEXT, BACKUP_NAME).click() [n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Restore files \u2026')]") if n.is_displayed()][0].click() -driver.find_element_by_xpath("//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist -time.sleep(1) -driver.find_element_by_xpath("//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox +wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist +wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox -driver.find_element_by_xpath("//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() -driver.find_element_by_id("restoretonewpath").click() -driver.find_element_by_id("restore_path").send_keys(RESTORE_FOLDER) -driver.find_element_by_xpath("//form[@id='restore']/div/div[@class='buttons']/a/span[contains(text(),'Restore')]").click() +wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() +wait_for_load(10, By.ID, "restoretonewpath").click() +wait_for_load(10, By.ID, "restore_path").send_keys(RESTORE_FOLDER) +wait_for_load(10, By.XPATH, "//form[@id='restore']/div/div[@class='buttons']/a/span[contains(text(),'Restore')]").click() # wait for restore to finish wait_for_text(60, "//form[@id='restore']/div[3]/h3/div[1]", "Your files and folders have been restored successfully.") @@ -177,30 +169,25 @@ if os.path.exists(RESTORE_FOLDER): os.rename(DESTINATION_FOLDER, DESTINATION_FOLDER_DIRECT_RESTORE) # direct restore -time.sleep(1) -driver.find_element_by_link_text("Restore").click() +wait_for_load(10, By.LINK_TEXT, "Restore").click() # Choose the "restore direct" option -time.sleep(1) -driver.find_element_by_id("direct").click() -driver.find_element_by_xpath("//input[@class='submit next']").click() +wait_for_load(10, By.ID, "direct").click() +wait_for_load(10, By.XPATH, "//input[@class='submit next']").click() -time.sleep(1) -driver.find_element_by_link_text("Manually type path").click() -driver.find_element_by_id("file_path").send_keys(DESTINATION_FOLDER_DIRECT_RESTORE) -driver.find_element_by_id("nextStep1").click() +wait_for_load(10, By.LINK_TEXT, "Manually type path").click() +wait_for_load(10, By.ID, "file_path").send_keys(DESTINATION_FOLDER_DIRECT_RESTORE) +wait_for_load(10, By.ID, "nextStep1").click() -driver.find_element_by_id("password").send_keys(PASSWORD) -driver.find_element_by_id("connect").click() -driver.find_element_by_xpath("//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist -time.sleep(1) -driver.find_element_by_xpath("//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox -time.sleep(1) -driver.find_element_by_xpath("//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() +wait_for_load(10, By.ID, "password").send_keys(PASSWORD) +wait_for_load(10, By.ID, "connect").click() +wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist +wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox +wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() -driver.find_element_by_id("restoretonewpath").click() -driver.find_element_by_id("restore_path").send_keys(DIRECT_RESTORE_FOLDER) -driver.find_element_by_xpath("//form[@id='restore']/div/div[@class='buttons']/a/span[contains(text(),'Restore')]").click() +wait_for_load(10, By.ID, "restoretonewpath").click() +wait_for_load(10, By.ID, "restore_path").send_keys(DIRECT_RESTORE_FOLDER) +wait_for_load(10, By.XPATH, "//form[@id='restore']/div/div[@class='buttons']/a/span[contains(text(),'Restore')]").click() # wait for restore to finish wait_for_text(60, "//form[@id='restore']/div[3]/h3/div[1]", "Your files and folders have been restored successfully.") From 020aeddc79eb4a96fdc32253a91ec3931329810f Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 22:58:53 -0500 Subject: [PATCH 02/18] Remove other tests --- .github/workflows/tests.yml | 46 ------------------------------------- 1 file changed, 46 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 046fa2aa1..242163de7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,52 +6,6 @@ env: build_directory: "Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release" jobs: - unit_tests: - name: Unit tests - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - - steps: - - name: Add msbuild to PATH (Windows) - if: matrix.os == 'windows-latest' - uses: microsoft/setup-msbuild@v1.0.2 - - - name: Install NuGet - uses: nuget/setup-nuget@v1.0.5 - - - name: Checkout Source - uses: actions/checkout@v2.3.4 - - - name: Restore NuGet Packages - run: nuget restore Duplicati.sln - - - name: Install Additional Dependencies - if: matrix.os == 'ubuntu-latest' - run: sudo apt-get install gtk-sharp2 - - - name: Build Duplicati (Linux and macOS) - if: matrix.os != 'windows-latest' - run: msbuild -p:Configuration=Release -p:DefineConstants=ENABLE_GTK Duplicati.sln - - - name: Build Duplicati (Windows) - if: matrix.os == 'windows-latest' - run: msbuild -p:Configuration=Release Duplicati.sln - - - name: Run Unit Tests (Linux and macOS) - if: matrix.os != 'windows-latest' - run: | - nuget install NUnit.Runners -Version 3.12.0 -OutputDirectory nunit - mono nunit/NUnit.ConsoleRunner.3.12.0/tools/nunit3-console.exe Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll - - - name: Run Unit Tests (Windows) - if: matrix.os == 'windows-latest' - run: | - nuget install NUnit.Runners -Version 3.12.0 -OutputDirectory nunit - nunit/NUnit.ConsoleRunner.3.12.0/tools/nunit3-console.exe Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll - ui_tests: name: UI tests runs-on: ubuntu-latest From b71f4c274d1d4c40b77e2d2fb01f0e3bf996c8a5 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:01:00 -0500 Subject: [PATCH 03/18] Copied code wrong --- guiTests/guiTest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guiTests/guiTest.py b/guiTests/guiTest.py index 91907be7c..a57ca001b 100644 --- a/guiTests/guiTest.py +++ b/guiTests/guiTest.py @@ -77,7 +77,7 @@ def wait_for_text(time, xpath, text): WebDriverWait(driver, time).until(expected_conditions.text_to_be_present_in_element((By.XPATH, xpath), text)) def wait_for_load(time, by, target): - return WebDriverWait(driver, time).until(EC.presence_of_element_located(by, target)) + return WebDriverWait(driver, time).until(expected_conditions.presence_of_element_located(by, target)) BACKUP_NAME = "BackupName" PASSWORD = "the_backup_password_is_really_long_and_safe" From 89bbb4d32fdb43fe66564933d90b6b35d2d2e57e Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:11:22 -0500 Subject: [PATCH 04/18] Fix --- guiTests/guiTest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guiTests/guiTest.py b/guiTests/guiTest.py index a57ca001b..92c794c7e 100644 --- a/guiTests/guiTest.py +++ b/guiTests/guiTest.py @@ -77,7 +77,7 @@ def wait_for_text(time, xpath, text): WebDriverWait(driver, time).until(expected_conditions.text_to_be_present_in_element((By.XPATH, xpath), text)) def wait_for_load(time, by, target): - return WebDriverWait(driver, time).until(expected_conditions.presence_of_element_located(by, target)) + return WebDriverWait(driver, time).until(expected_conditions.presence_of_element_located((by, target))) BACKUP_NAME = "BackupName" PASSWORD = "the_backup_password_is_really_long_and_safe" From e0cf18c639e4bf5969222dda20524178af2ac7ec Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:27:36 -0500 Subject: [PATCH 05/18] Add sleep before checkbox --- guiTests/guiTest.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/guiTests/guiTest.py b/guiTests/guiTest.py index 92c794c7e..af51a7c95 100644 --- a/guiTests/guiTest.py +++ b/guiTests/guiTest.py @@ -33,8 +33,8 @@ else: profile = webdriver.FirefoxProfile() profile.set_preference("intl.accept_languages", "en") options = Options() - options.set_headless(headless=True) - driver = webdriver.Firefox(profile, firefox_options=options) + options.headless = True + driver = webdriver.Firefox(profile, options=options) def write_random_file(size, filename): @@ -148,7 +148,8 @@ if len([n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Resto [n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Restore files \u2026')]") if n.is_displayed()][0].click() wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist -wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox +time.sleep(1) +wait_for_load(10, By.XPATH, "/html/body/div[1]/div[2]/div[2]/div/form/div[1]/div[3]/restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() wait_for_load(10, By.ID, "restoretonewpath").click() @@ -182,7 +183,8 @@ wait_for_load(10, By.ID, "nextStep1").click() wait_for_load(10, By.ID, "password").send_keys(PASSWORD) wait_for_load(10, By.ID, "connect").click() wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist -wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox +time.sleep(1) +wait_for_load(10, By.XPATH, "/html/body/div[1]/div[2]/div[2]/div/form/div[1]/div[3]/restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() wait_for_load(10, By.ID, "restoretonewpath").click() From ad9e39c0ec3c7170da2f4bb15fe1f160d44ef195 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:44 -0500 Subject: [PATCH 06/18] Trigger Build From e3605fb7a52232b2436d8de685e159d7c45361b3 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:46 -0500 Subject: [PATCH 07/18] Trigger Build From 9115f20d6a296293816842de4bbdb3909f958293 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:48 -0500 Subject: [PATCH 08/18] Trigger Build From 5194ea0ca082976c9b3ffd21d0c610d39681e284 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:49 -0500 Subject: [PATCH 09/18] Trigger Build From 84fea1fe913ea6ffefc891aea92403e9efcef800 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:51 -0500 Subject: [PATCH 10/18] Trigger Build From a508e1c34b721e6cd5e614339fcf433298a4aee7 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:52 -0500 Subject: [PATCH 11/18] Trigger Build From 2b9eca723f43fe8b5b0251856ef52b05f886cda4 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:54 -0500 Subject: [PATCH 12/18] Trigger Build From f36936df4eaf2896d4633d6196061c723e2b1d01 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:55 -0500 Subject: [PATCH 13/18] Trigger Build From c5e7e9c273b85352b0d5246a5add236517fb0680 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:57 -0500 Subject: [PATCH 14/18] Trigger Build From 04ff7945d52d11e6d57dc4fc8b3aab9f46a2d993 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:29:58 -0500 Subject: [PATCH 15/18] Trigger Build From 99f26dd24686d8b3bfff8ce9aa099797677b333c Mon Sep 17 00:00:00 2001 From: samuel-w Date: Fri, 24 Sep 2021 23:32:23 -0500 Subject: [PATCH 16/18] Revert "Remove other tests" This reverts commit 020aeddc79eb4a96fdc32253a91ec3931329810f. --- .github/workflows/tests.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 242163de7..046fa2aa1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,52 @@ env: build_directory: "Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release" jobs: + unit_tests: + name: Unit tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + + steps: + - name: Add msbuild to PATH (Windows) + if: matrix.os == 'windows-latest' + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Install NuGet + uses: nuget/setup-nuget@v1.0.5 + + - name: Checkout Source + uses: actions/checkout@v2.3.4 + + - name: Restore NuGet Packages + run: nuget restore Duplicati.sln + + - name: Install Additional Dependencies + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get install gtk-sharp2 + + - name: Build Duplicati (Linux and macOS) + if: matrix.os != 'windows-latest' + run: msbuild -p:Configuration=Release -p:DefineConstants=ENABLE_GTK Duplicati.sln + + - name: Build Duplicati (Windows) + if: matrix.os == 'windows-latest' + run: msbuild -p:Configuration=Release Duplicati.sln + + - name: Run Unit Tests (Linux and macOS) + if: matrix.os != 'windows-latest' + run: | + nuget install NUnit.Runners -Version 3.12.0 -OutputDirectory nunit + mono nunit/NUnit.ConsoleRunner.3.12.0/tools/nunit3-console.exe Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll + + - name: Run Unit Tests (Windows) + if: matrix.os == 'windows-latest' + run: | + nuget install NUnit.Runners -Version 3.12.0 -OutputDirectory nunit + nunit/NUnit.ConsoleRunner.3.12.0/tools/nunit3-console.exe Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll + ui_tests: name: UI tests runs-on: ubuntu-latest From 0ea2033961d80293deb267dc1546b6be0065aa96 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Sat, 25 Sep 2021 14:13:57 -0500 Subject: [PATCH 17/18] Shorten XPATH --- guiTests/guiTest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guiTests/guiTest.py b/guiTests/guiTest.py index af51a7c95..c0e012bc4 100644 --- a/guiTests/guiTest.py +++ b/guiTests/guiTest.py @@ -149,7 +149,7 @@ if len([n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Resto [n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Restore files \u2026')]") if n.is_displayed()][0].click() wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist time.sleep(1) -wait_for_load(10, By.XPATH, "/html/body/div[1]/div[2]/div[2]/div/form/div[1]/div[3]/restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox +wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() wait_for_load(10, By.ID, "restoretonewpath").click() @@ -184,7 +184,7 @@ wait_for_load(10, By.ID, "password").send_keys(PASSWORD) wait_for_load(10, By.ID, "connect").click() wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist time.sleep(1) -wait_for_load(10, By.XPATH, "/html/body/div[1]/div[2]/div[2]/div/form/div[1]/div[3]/restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox +wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() wait_for_load(10, By.ID, "restoretonewpath").click() From 5da43d89cf820debb5e27c89ee20ba4162700655 Mon Sep 17 00:00:00 2001 From: samuel-w Date: Sat, 25 Sep 2021 14:15:29 -0500 Subject: [PATCH 18/18] Add comment --- guiTests/guiTest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guiTests/guiTest.py b/guiTests/guiTest.py index c0e012bc4..629d410ce 100644 --- a/guiTests/guiTest.py +++ b/guiTests/guiTest.py @@ -148,7 +148,7 @@ if len([n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Resto [n for n in driver.find_elements_by_xpath(u"//span[contains(text(),'Restore files \u2026')]") if n.is_displayed()][0].click() wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist -time.sleep(1) +time.sleep(1) # Delay so page has time to load wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click() @@ -183,7 +183,7 @@ wait_for_load(10, By.ID, "nextStep1").click() wait_for_load(10, By.ID, "password").send_keys(PASSWORD) wait_for_load(10, By.ID, "connect").click() wait_for_load(10, By.XPATH, "//span[contains(text(),'" + SOURCE_FOLDER + "')]") # wait for filelist -time.sleep(1) +time.sleep(1) # Delay so page has time to load wait_for_load(10, By.XPATH, "//restore-file-picker/ul/li/div/a[2]").click() # select root folder checkbox wait_for_load(10, By.XPATH, "//form[@id='restore']/div[1]/div[@class='buttons']/a/span[contains(text(), 'Continue')]").click()