diff --git a/test/gui/features/activity/activity.feature b/test/gui/features/activity/activity.feature index 7f9db44c5..f8c550584 100644 --- a/test/gui/features/activity/activity.feature +++ b/test/gui/features/activity/activity.feature @@ -3,7 +3,7 @@ Feature: filter activity for user I want to filter activity So that I can view activity of specific user - @smoke @skip + @smoke Scenario: filter synced activities Given user "Alice" has been created in the server with default attributes And user "Brian" has been created in the server with default attributes diff --git a/test/gui/features/sync-resources/syncResources.feature b/test/gui/features/sync-resources/syncResources.feature index 8f96fd6f1..bd969dffc 100644 --- a/test/gui/features/sync-resources/syncResources.feature +++ b/test/gui/features/sync-resources/syncResources.feature @@ -220,7 +220,7 @@ Feature: Syncing files """ test content """ - And the user waits for folder "parent/subfolder5/test.txt" to be synced + And the user waits for file "parent/subfolder5/test.txt" to be synced Then as "Alice" folder "parent/subfolderEmpty1" should exist in the server And as "Alice" folder "parent/subfolderEmpty2" should exist in the server And as "Alice" folder "parent/subfolderEmpty3" should exist in the server diff --git a/test/gui/pageObjects/Activity.py b/test/gui/pageObjects/Activity.py index e4f2032bb..7abcc64f8 100644 --- a/test/gui/pageObjects/Activity.py +++ b/test/gui/pageObjects/Activity.py @@ -1,6 +1,7 @@ # from objectmaphelper import RegularExpression from types import SimpleNamespace from appium.webdriver.common.appiumby import AppiumBy as By +from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from helpers.FilesHelper import build_conflicted_regex @@ -17,7 +18,9 @@ class Activity: LOCAL_ACTIVITY_FILTER_BUTTON = SimpleNamespace(by=By.NAME, selector="Filter") LOCAL_ACTIVITY_FILTER_OPTION_SELECTOR = SimpleNamespace(by=By.NAME, selector=None) LOCAL_ACTIVITY_TABLE = SimpleNamespace(by=By.NAME, selector="Local activity table") - FILTER_BUTTON_SELECTED_STATE = SimpleNamespace(by=By.NAME, selector="1 Filter") + FILTER_BUTTON_SELECTED_STATE = SimpleNamespace( + by=By.XPATH, selector="//*[contains(@name, '1 Filter')]" + ) NOT_SYNCED_FILTER_BUTTON = SimpleNamespace(by=None, selector=None) NOT_SYNCED_FILTER_OPTION_SELECTOR = SimpleNamespace(by=None, selector=None) SYNCED_ACTIVITY_TABLE_HEADER_SELECTOR = SimpleNamespace(by=None, selector=None) @@ -91,23 +94,23 @@ def has_sync_status(filename, status): @staticmethod def select_synced_filter(sync_filter): - app().find_element( + menu = app().find_element( Activity.LOCAL_ACTIVITY_FILTER_BUTTON.by, Activity.LOCAL_ACTIVITY_FILTER_BUTTON.selector, - ).click() - container = app().find_element( - Activity.LOCAL_ACTIVITY_TABLE.by, Activity.LOCAL_ACTIVITY_TABLE.selector ) - # NOTE: clicking filter options does not work - container.find_element( - Activity.LOCAL_ACTIVITY_FILTER_OPTION_SELECTOR.by, sync_filter - ).click() - # FIXME: enable the check below once the filter options are clickable + menu.click() + + # NOTE: Filter options are not visible in the accessibility tree. + # As a workaround, select the second filter option (which is an account filter). + # This means we cannot select a specific account filter for now. + menu.send_keys(Keys.ARROW_DOWN) + menu.send_keys(Keys.ARROW_DOWN) + menu.send_keys(Keys.ENTER) # confirm filter is applied - # app().find_element( - # Activity.FILTER_BUTTON_SELECTED_STATE.by, - # Activity.FILTER_BUTTON_SELECTED_STATE.selector, - # ) + app().find_element( + Activity.FILTER_BUTTON_SELECTED_STATE.by, + Activity.FILTER_BUTTON_SELECTED_STATE.selector, + ) @staticmethod def get_synced_file_selector(resource): diff --git a/test/gui/pageObjects/Toolbar.py b/test/gui/pageObjects/Toolbar.py index 24967134c..23ba33bd0 100644 --- a/test/gui/pageObjects/Toolbar.py +++ b/test/gui/pageObjects/Toolbar.py @@ -1,10 +1,9 @@ from types import SimpleNamespace from urllib.parse import urlparse from appium.webdriver.common.appiumby import AppiumBy as By -from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException -from helpers.AppHelper import app, get_window_location +from helpers.AppHelper import app from helpers.ConfigHelper import get_config from helpers.UserHelper import get_displayname_for_user from helpers.SyncHelper import wait_for diff --git a/test/gui/steps/account_context.py b/test/gui/steps/account_context.py index 8b4d27a14..80b4155be 100644 --- a/test/gui/steps/account_context.py +++ b/test/gui/steps/account_context.py @@ -8,7 +8,6 @@ from pageObjects.AccountSetting import AccountSetting from pageObjects.Toolbar import Toolbar from pageObjects.EnterPassword import EnterPassword -from pageObjects.AccountSetting import AccountSetting from helpers.SetupClientHelper import ( start_client, setup_client, @@ -24,6 +23,7 @@ from helpers.UserHelper import get_displayname_for_user, get_password_for_user from helpers.ConfigHelper import get_config from helpers.TableParser import table_rows_hash +from helpers.AppHelper import close_and_kill_app @Given('the user has started the client') @@ -244,6 +244,7 @@ def step(context): @When('the user quits the client') def step(context): Toolbar.quit_opencloud() + close_and_kill_app() @Then('"{username}" account should be opened')