From 3a7bdcb0bf3533ba18437c415b3c97b10d88d46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:55:19 -0600 Subject: [PATCH 1/2] screenobject(update): fix tests failing on CI for accessibility --- .../settings/SettingsBaseScreen.ts | 30 +++++++++++-------- tests/specs/10-settings-accessibility.spec.ts | 6 ++-- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/screenobjects/settings/SettingsBaseScreen.ts b/tests/screenobjects/settings/SettingsBaseScreen.ts index ad73c5497a..0bc9f0efe8 100644 --- a/tests/screenobjects/settings/SettingsBaseScreen.ts +++ b/tests/screenobjects/settings/SettingsBaseScreen.ts @@ -22,6 +22,7 @@ const SELECTORS_WINDOWS: selectorContainer = { NOTIFICATIONS_BUTTON: '[name="notifications-button"]', PROFILE_BUTTON: '[name="profile-button"]', SETTINGS_SEARCH_INPUT: '[name="settings-search-input"]', + SIDEBAR_CHILDREN: '[name="sidebar-children"]', }; const SELECTORS_MACOS: selectorContainer = { @@ -37,6 +38,7 @@ const SELECTORS_MACOS: selectorContainer = { NOTIFICATIONS_BUTTON: "~notifications-button", PROFILE_BUTTON: "~profile-button", SETTINGS_SEARCH_INPUT: "~settings-search-input", + SIDEBAR_CHILDREN: "~sidebar-children", }; process.env.DRIVER === WINDOWS_DRIVER @@ -60,47 +62,47 @@ export default class SettingsBaseScreen extends UplinkMainScreen { } public get aboutButton() { - return $(SELECTORS.ABOUT_BUTTON); + return this.sidebarChildren.$(SELECTORS.ABOUT_BUTTON); } public get accessibilityButton() { - return $(SELECTORS.ACCESSIBILITY_BUTTON); + return this.sidebarChildren.$(SELECTORS.ACCESSIBILITY_BUTTON); } public get audioButton() { - return $(SELECTORS.AUDIO_BUTTON); + return this.sidebarChildren.$(SELECTORS.AUDIO_BUTTON); } public get developerButton() { - return $(SELECTORS.DEVELOPER_BUTTON); + return this.sidebarChildren.$(SELECTORS.DEVELOPER_BUTTON); } public get extensionsButton() { - return $(SELECTORS.EXTENSIONS_BUTTON); + return this.sidebarChildren.$(SELECTORS.EXTENSIONS_BUTTON); } public get generalButton() { - return $(SELECTORS.GENERAL_BUTTON); + return this.sidebarChildren.$(SELECTORS.GENERAL_BUTTON); } public get keyboardShortcutsButton() { - return $(SELECTORS.KEYBOARD_SHORTCUTS_BUTTON); + return this.sidebarChildren.$(SELECTORS.KEYBOARD_SHORTCUTS_BUTTON); } public get licensesButton() { - return $(SELECTORS.LICENSES_BUTTON); + return this.sidebarChildren.$(SELECTORS.LICENSES_BUTTON); } public get messagesButton() { - return $(SELECTORS.MESSAGES_BUTTON); + return this.sidebarChildren.$(SELECTORS.MESSAGES_BUTTON); } public get notificationsButton() { - return $(SELECTORS.NOTIFICATIONS_BUTTON); + return this.sidebarChildren.$(SELECTORS.NOTIFICATIONS_BUTTON); } public get profileButton() { - return $(SELECTORS.PROFILE_BUTTON); + return this.sidebarChildren.$(SELECTORS.PROFILE_BUTTON); } public get settingsLayout() { @@ -108,7 +110,11 @@ export default class SettingsBaseScreen extends UplinkMainScreen { } public get settingsSearchInput() { - return $(SELECTORS.SETTINGS_SEARCH_INPUT); + return this.settingsLayout.$(SELECTORS.SETTINGS_SEARCH_INPUT); + } + + public get sidebarChildren() { + return this.settingsLayout.$(SELECTORS.SIDEBAR_CHILDREN); } async goToAboutSettings() { diff --git a/tests/specs/10-settings-accessibility.spec.ts b/tests/specs/10-settings-accessibility.spec.ts index 9e75a2d9b3..08864e422f 100644 --- a/tests/specs/10-settings-accessibility.spec.ts +++ b/tests/specs/10-settings-accessibility.spec.ts @@ -27,8 +27,7 @@ export default async function settingsAccessibilityTests() { ); }); - // Skip test that needs rework because it is clicking on a switch slider from MacOS configuration instead of Uplink - Settings Accessibility Screen - xit("Settings Accessibility - Click on slider switch to enable Open Dyslexic option", async () => { + it("Settings Accessibility - Click on slider switch to enable Open Dyslexic option", async () => { // Click on the Open Dyslexic switch slider from the Settings Accessibility Screen await SettingsAccessibilityScreen.clickOnOpenDyslexic(); @@ -36,8 +35,7 @@ export default async function settingsAccessibilityTests() { await SettingsAccessibilityScreen.validateOpenDyslexicIsEnabled(); }); - // Skip test that needs rework because it is clicking on a switch slider from MacOS configuration instead of Uplink - Settings Accessibility Screen - xit("Settings Audio - Click on slider switches to disable the options", async () => { + it("Settings Audio - Click on slider switches to disable the options", async () => { // Click again on the switch slider from Open Dyslexic option in Settings Accessibility Screen await SettingsAccessibilityScreen.clickOnOpenDyslexic(); From 6c60c6369ae43d6e76d9a1ca4549479f0804ac8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Mon, 29 Apr 2024 12:18:36 -0600 Subject: [PATCH 2/2] screenobject(update): fix ui locators on settings base screen --- tests/helpers/commandsNewUser.ts | 1 - .../settings/SettingsBaseScreen.ts | 28 ++++++++----------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/tests/helpers/commandsNewUser.ts b/tests/helpers/commandsNewUser.ts index 151da8f740..7769663e69 100644 --- a/tests/helpers/commandsNewUser.ts +++ b/tests/helpers/commandsNewUser.ts @@ -7,7 +7,6 @@ import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; import { activateFirstApplication, - activateSecondApplication, getUserKey, launchSecondApplication, launchThirdApplication, diff --git a/tests/screenobjects/settings/SettingsBaseScreen.ts b/tests/screenobjects/settings/SettingsBaseScreen.ts index 0bc9f0efe8..780cf89d89 100644 --- a/tests/screenobjects/settings/SettingsBaseScreen.ts +++ b/tests/screenobjects/settings/SettingsBaseScreen.ts @@ -22,7 +22,6 @@ const SELECTORS_WINDOWS: selectorContainer = { NOTIFICATIONS_BUTTON: '[name="notifications-button"]', PROFILE_BUTTON: '[name="profile-button"]', SETTINGS_SEARCH_INPUT: '[name="settings-search-input"]', - SIDEBAR_CHILDREN: '[name="sidebar-children"]', }; const SELECTORS_MACOS: selectorContainer = { @@ -38,7 +37,6 @@ const SELECTORS_MACOS: selectorContainer = { NOTIFICATIONS_BUTTON: "~notifications-button", PROFILE_BUTTON: "~profile-button", SETTINGS_SEARCH_INPUT: "~settings-search-input", - SIDEBAR_CHILDREN: "~sidebar-children", }; process.env.DRIVER === WINDOWS_DRIVER @@ -62,47 +60,47 @@ export default class SettingsBaseScreen extends UplinkMainScreen { } public get aboutButton() { - return this.sidebarChildren.$(SELECTORS.ABOUT_BUTTON); + return $(SELECTORS.ABOUT_BUTTON); } public get accessibilityButton() { - return this.sidebarChildren.$(SELECTORS.ACCESSIBILITY_BUTTON); + return this.settingsLayout.$(SELECTORS.ACCESSIBILITY_BUTTON); } public get audioButton() { - return this.sidebarChildren.$(SELECTORS.AUDIO_BUTTON); + return $(SELECTORS.AUDIO_BUTTON); } public get developerButton() { - return this.sidebarChildren.$(SELECTORS.DEVELOPER_BUTTON); + return $(SELECTORS.DEVELOPER_BUTTON); } public get extensionsButton() { - return this.sidebarChildren.$(SELECTORS.EXTENSIONS_BUTTON); + return $(SELECTORS.EXTENSIONS_BUTTON); } public get generalButton() { - return this.sidebarChildren.$(SELECTORS.GENERAL_BUTTON); + return $(SELECTORS.GENERAL_BUTTON); } public get keyboardShortcutsButton() { - return this.sidebarChildren.$(SELECTORS.KEYBOARD_SHORTCUTS_BUTTON); + return $(SELECTORS.KEYBOARD_SHORTCUTS_BUTTON); } public get licensesButton() { - return this.sidebarChildren.$(SELECTORS.LICENSES_BUTTON); + return $(SELECTORS.LICENSES_BUTTON); } public get messagesButton() { - return this.sidebarChildren.$(SELECTORS.MESSAGES_BUTTON); + return $(SELECTORS.MESSAGES_BUTTON); } public get notificationsButton() { - return this.sidebarChildren.$(SELECTORS.NOTIFICATIONS_BUTTON); + return $(SELECTORS.NOTIFICATIONS_BUTTON); } public get profileButton() { - return this.sidebarChildren.$(SELECTORS.PROFILE_BUTTON); + return $(SELECTORS.PROFILE_BUTTON); } public get settingsLayout() { @@ -113,10 +111,6 @@ export default class SettingsBaseScreen extends UplinkMainScreen { return this.settingsLayout.$(SELECTORS.SETTINGS_SEARCH_INPUT); } - public get sidebarChildren() { - return this.settingsLayout.$(SELECTORS.SIDEBAR_CHILDREN); - } - async goToAboutSettings() { const aboutButton = await this.aboutButton; await aboutButton.click();