From 16d780a1be1e66be2dc0b08dab52ae64459df6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:42:10 -0600 Subject: [PATCH] chore(refactor): remove use of usera and user b instance --- config/wdio.mac.multiremote.conf.ts | 14 +- config/wdio.windows.multiremote.conf.ts | 5 +- tests/helpers/commands.ts | 180 ++---- tests/helpers/constants.ts | 2 - tests/helpers/debugging.ts | 11 +- tests/screenobjects/AppScreen.ts | 2 +- tests/screenobjects/UplinkMainScreen.ts | 48 +- .../account-creation/CreatePinScreen.ts | 32 +- .../account-creation/CreateUserScreen.ts | 10 +- tests/screenobjects/chats/ChatsLayout.ts | 6 +- tests/screenobjects/chats/ChatsSidebar.ts | 18 +- .../screenobjects/chats/ComposeAttachment.ts | 6 +- tests/screenobjects/chats/ContextMenu.ts | 6 +- .../screenobjects/chats/ContextMenuSidebar.ts | 12 +- tests/screenobjects/chats/CreateGroupChat.ts | 2 +- tests/screenobjects/chats/EditGroup.ts | 12 +- tests/screenobjects/chats/EmojiSelector.ts | 6 +- tests/screenobjects/chats/EmojiSuggestions.ts | 11 +- tests/screenobjects/chats/FavoritesSidebar.ts | 6 +- tests/screenobjects/chats/ImagePreview.ts | 2 +- tests/screenobjects/chats/InputBar.ts | 26 +- tests/screenobjects/chats/MessageGroup.ts | 30 +- tests/screenobjects/chats/Messages.ts | 34 +- .../screenobjects/chats/OutgoingCallModal.ts | 4 +- tests/screenobjects/chats/PinnedMessages.ts | 28 +- tests/screenobjects/chats/QuickProfile.ts | 6 +- tests/screenobjects/chats/ReplyPrompt.ts | 2 +- tests/screenobjects/chats/SendFiles.ts | 28 +- tests/screenobjects/chats/ShareDid.ts | 2 +- tests/screenobjects/chats/SidebarSearch.ts | 34 +- tests/screenobjects/chats/Topbar.ts | 30 +- tests/screenobjects/files/FilesScreen.ts | 76 +-- tests/screenobjects/friends/FriendsScreen.ts | 90 +-- .../settings/CropToolProfileModal.ts | 2 +- .../settings/SettingsAboutScreen.ts | 6 +- .../settings/SettingsAccessibilityScreen.ts | 2 +- .../settings/SettingsAudioScreen.ts | 2 +- .../settings/SettingsBaseScreen.ts | 26 +- .../settings/SettingsDeveloperScreen.ts | 12 +- .../settings/SettingsExtensionsScreen.ts | 18 +- .../settings/SettingsGeneralScreen.ts | 6 +- .../settings/SettingsMessagesScreen.ts | 2 +- .../settings/SettingsNotificationsScreen.ts | 2 +- .../settings/SettingsProfileScreen.ts | 44 +- .../welcome-screen/WelcomeScreen.ts | 6 +- tests/specs/01-create-account.spec.ts | 4 +- tests/specs/02-chats.spec.ts | 4 +- tests/specs/03-files.spec.ts | 2 +- tests/specs/04-friends.spec.ts | 2 +- tests/specs/05-settings-profile.spec.ts | 2 +- tests/specs/06-settings-general.spec.ts | 4 +- .../specs/14-create-reusable-accounts.spec.ts | 2 +- tests/specs/15-settings-messages.spec.ts | 2 +- .../01-create-accounts-and-friends.spec.ts | 590 +++++++++--------- .../reusable-accounts/01-replies.spec.ts | 144 +++++ .../reusable-accounts/02-chat-replies.spec.ts | 128 ---- .../05-message-attachments.spec.ts | 2 +- .../reusable-accounts/06-chat-topbar.spec.ts | 2 +- .../07-quick-profile.spec.ts | 6 +- .../08-sidebar-chats.spec.ts | 6 +- .../reusable-accounts/09-group-chats.spec.ts | 2 +- .../10-group-chats-edit.spec.ts | 2 +- .../11-group-chats-sidebar.spec.ts | 4 +- .../specs/scripts/01-multiple-logins.spec.ts | 5 +- tests/suites/Chats/01-Chats.suite.ts | 7 - 65 files changed, 894 insertions(+), 935 deletions(-) create mode 100644 tests/specs/reusable-accounts/01-replies.spec.ts delete mode 100644 tests/specs/reusable-accounts/02-chat-replies.spec.ts diff --git a/config/wdio.mac.multiremote.conf.ts b/config/wdio.mac.multiremote.conf.ts index f42d82b6429..ddaa19be8d6 100644 --- a/config/wdio.mac.multiremote.conf.ts +++ b/config/wdio.mac.multiremote.conf.ts @@ -6,7 +6,6 @@ const join = require("path").join; const MACOS_USER_A_BUNDLE_ID = require("@helpers/constants").MACOS_USER_A_BUNDLE_ID; const MACOS_USER_B_BUNDLE_ID = require("@helpers/constants").MACOS_USER_B_BUNDLE_ID; const MACOS_DRIVER = require("@helpers/constants").MACOS_DRIVER; -const USER_A_INSTANCE = require("@helpers/constants").USER_A_INSTANCE; const fsp = require("fs").promises; const { readFileSync, rmSync } = require("fs"); @@ -30,11 +29,12 @@ export const config: WebdriverIO.Config = { // then the current working directory is where your `package.json` resides, so `wdio` // will be called from there. // - specs: [join(process.cwd(), "./tests/suites/Chats/01-Chats.suite.ts")], + specs: [join(process.cwd(), "./tests/specs/reusable-accounts/01-*.spec.ts")], // Patterns to exclude. exclude: [ // 'path/to/excluded/files' ], + maxInstances: 1, // // ============ // Capabilities @@ -96,6 +96,8 @@ export const config: WebdriverIO.Config = { // methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got // resolved to continue. onPrepare: async function() { + const cacheFolderSourceA = join(process.cwd(), "./tests/fixtures/users/mac2/ChatUserA"); + const cacheFolderSourceB = join(process.cwd(), "./tests/fixtures/users/mac2/ChatUserB"); const cacheFolderUserA = homedir() + "/.uplink/.user"; const cacheFolderUserB = homedir() + "/.uplinkUserB/.user"; const allureResultsFolder = join(process.cwd(), "./allure-results"); @@ -114,7 +116,9 @@ export const config: WebdriverIO.Config = { try { await rmSync(cacheFolderUserA, { recursive: true, force: true }); await rmSync(cacheFolderUserB, { recursive: true, force: true }); - console.log("Deleted Cache Folder Successfully!"); + await fsp.cp(cacheFolderSourceA, cacheFolderUserA, { recursive: true }, { force: true }); + await fsp.cp(cacheFolderSourceB, cacheFolderUserB, { recursive: true }, { force: true }); + console.log("Deleted and Copied Cache Folder Successfully!"); } catch (error) { console.error( `Got an error trying to delete Cache Folder: ${error.message}` @@ -141,7 +145,7 @@ export const config: WebdriverIO.Config = { allureReporter.addAttachment(imageTitle, data, 'image/png') // Close second application if open - await driver[USER_A_INSTANCE].executeScript("macos: terminateApp", [ + await driver.executeScript("macos: terminateApp", [ { bundleId: MACOS_USER_B_BUNDLE_ID, }, @@ -152,7 +156,7 @@ export const config: WebdriverIO.Config = { afterSuite: async function (suite) { // Close second application if open - await driver[USER_A_INSTANCE].executeScript("macos: terminateApp", [ + await driver.executeScript("macos: terminateApp", [ { bundleId: MACOS_USER_B_BUNDLE_ID, }, diff --git a/config/wdio.windows.multiremote.conf.ts b/config/wdio.windows.multiremote.conf.ts index d577c112f50..c61307515fb 100644 --- a/config/wdio.windows.multiremote.conf.ts +++ b/config/wdio.windows.multiremote.conf.ts @@ -2,7 +2,6 @@ require("module-alias/register"); const allureReporter = require('@wdio/allure-reporter').default; const sharedConfig = require('@config/wdio.shared.conf.ts').config; const join = require("path").join; -const USER_A_INSTANCE = require("@helpers/constants").USER_A_INSTANCE; const fsp = require("fs").promises; const userACacheFolder = join(process.cwd(), "./apps/ChatUserA/.user") const userBCacheFolder = join(process.cwd(), "./apps/ChatUserB/.user") @@ -146,7 +145,7 @@ export const config: WebdriverIO.Config = { beforeTest: async function (test) { // Start video recording for each test and instance - await driver[USER_A_INSTANCE].executeScript("windows: startRecordingScreen", [ + await driver.executeScript("windows: startRecordingScreen", [ { deviceId: 1 }, @@ -160,7 +159,7 @@ export const config: WebdriverIO.Config = { imageFile = await driver.takeScreenshot(); // Stop video recording for both instances and save video into base64 format - base64VideoUserA = await driver[USER_A_INSTANCE].executeScript("windows: stopRecordingScreen", [ + base64VideoUserA = await driver.executeScript("windows: stopRecordingScreen", [ { remotePath: "" }, diff --git a/tests/helpers/commands.ts b/tests/helpers/commands.ts index 887ea9b582b..baca929782f 100644 --- a/tests/helpers/commands.ts +++ b/tests/helpers/commands.ts @@ -10,8 +10,6 @@ import { MACOS_DRIVER, MACOS_USER_A_BUNDLE_ID, MACOS_USER_B_BUNDLE_ID, - USER_A_INSTANCE, - USER_B_INSTANCE, WINDOWS_APP, WINDOWS_DRIVER, } from "./constants"; @@ -19,14 +17,14 @@ const { readFileSync, rmSync, writeFileSync } = require("fs"); const { execSync } = require("child_process"); const fsp = require("fs").promises; const { clipboard, mouse, Button } = require("@nut-tree/nut-js"); -let createPinFirstUser = new CreatePinScreen(USER_A_INSTANCE); -let createPinSecondUser = new CreatePinScreen(USER_B_INSTANCE); -let createUserFirstUser = new CreateUserScreen(USER_A_INSTANCE); -let createUserSecondUser = new CreateUserScreen(USER_B_INSTANCE); -let friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); -let friendsScreenSecondUser = new FriendsScreen(USER_B_INSTANCE); -let welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); -let welcomeScreenSecondUser = new WelcomeScreen(USER_B_INSTANCE); +let createPinFirstUser = new CreatePinScreen(); +let createPinSecondUser = new CreatePinScreen(); +let createUserFirstUser = new CreateUserScreen(); +let createUserSecondUser = new CreateUserScreen(); +let friendsScreenFirstUser = new FriendsScreen(); +let friendsScreenSecondUser = new FriendsScreen(); +let welcomeScreenFirstUser = new WelcomeScreen(); +let welcomeScreenSecondUser = new WelcomeScreen(); // Users cache helper functions @@ -42,9 +40,12 @@ export async function deleteCache() { } } -export async function grabCacheFolder(username: string, instance: string) { - const source = homedir() + "/.uplink"; - const currentDriver = await driver[instance].capabilities.automationName; +export async function grabCacheFolder( + username: string, + cacheDir: string = "./uplink", +) { + const source = homedir() + cacheDir; + const currentDriver = await driver.capabilities.automationName; const target = "./tests/fixtures/users/" + currentDriver + "/" + username; await fsp.mkdir(target, { recursive: true }); try { @@ -57,12 +58,15 @@ export async function grabCacheFolder(username: string, instance: string) { } } -export async function loadTestUserData(user: string, instance: string) { +export async function loadTestUserData( + user: string, + cacheDir: string = "./uplink", +) { // Move files - const currentDriver = await driver[instance].capabilities.automationName; + const currentDriver = await driver.capabilities.automationName; let source, target; source = "./tests/fixtures/users/" + currentDriver + "/" + user; - target = homedir() + "/.uplink"; + target = homedir() + cacheDir; await deleteCache(); try { await fsp.cp(source, target, { recursive: true }, { force: true }); @@ -76,9 +80,9 @@ export async function loadTestUserData(user: string, instance: string) { // DidKeys and username handling functions -export async function getUserKey(username: string, instance: string) { +export async function getUserKey(username: string) { // Read user data and store variable with DID Key from JSON file - const currentDriver = await driver[instance].capabilities.automationName; + const currentDriver = await driver.capabilities.automationName; const source = "./tests/fixtures/users/" + currentDriver + "/" + username + ".json"; const jsonFile = await readFileSync(source); @@ -87,13 +91,9 @@ export async function getUserKey(username: string, instance: string) { return didkey; } -export async function saveTestKeys( - username: string, - didkey: string, - instance: string, -) { +export async function saveTestKeys(username: string, didkey: string) { // Save JSON file with keys - const currentDriver = await driver[instance].capabilities.automationName; + const currentDriver = await driver.capabilities.automationName; const target = "./tests/fixtures/users/" + currentDriver; const filepath = target + "/" + username + ".json"; await fsp.mkdir(target, { recursive: true }); @@ -129,30 +129,6 @@ export async function createNewUser(username: string) { await friendsScreenFirstUser.friendsBody.waitForExist(); } -export async function createNewUserSecondInstance(username: string) { - // Reset Pin before creating new user - await createPinSecondUser.unlockLayout.waitForExist(); - await createPinSecondUser.openHelpButtonMenu(); - await createPinSecondUser.clickOnResetAccount(); - - // Enter pin for test user - await createPinSecondUser.enterPin("1234"); - await createPinSecondUser.createAccountButton.waitForEnabled(); - await createPinSecondUser.clickOnCreateAccount(); - - // Enter Username and click on Create Account - await createUserSecondUser.enterUsername(username); - await createUserSecondUser.createAccountButton.waitForEnabled(); - await createUserSecondUser.clickOnCreateAccount(); - - // Ensure Main Screen is displayed - await welcomeScreenSecondUser.welcomeLayout.waitForExist(); - - // Workaround to ensure that user clicks on Add Someone - await welcomeScreenSecondUser.clickAddSomeone(); - await friendsScreenSecondUser.friendsBody.waitForExist(); -} - export async function loginWithTestUser() { // Enter pin for test user const unlockScreen = await createPinFirstUser.unlockLayout; @@ -166,57 +142,39 @@ export async function loginWithTestUser() { // Only maximize if current driver is windows const currentDriver = await welcomeScreenFirstUser.getCurrentDriver(); if (currentDriver === WINDOWS_DRIVER) { - await maximizeWindow(USER_A_INSTANCE); - } -} - -export async function loginWithTestUserSecondInstance() { - // Enter pin for test user - const unlockLayout = await createPinSecondUser.unlockLayout; - await unlockLayout.waitForExist(); - await createPinSecondUser.enterPin("1234"); - - // Ensure Main Screen is displayed - const welcomeLayout = await welcomeScreenSecondUser.welcomeLayout; - await welcomeLayout.waitForExist(); - - // Only maximize if current driver is windows - const currentDriver = await welcomeScreenSecondUser.getCurrentDriver(); - if (currentDriver === WINDOWS_DRIVER) { - await maximizeWindow(USER_B_INSTANCE); + await maximizeWindow(); } } -export async function resetApp(instance: string) { - await closeApplication(instance); +export async function resetApp() { + await closeApplication(); await deleteCache(); - await launchApplication(instance, MACOS_BUNDLE_ID, WINDOWS_APP); + await launchApplication(MACOS_BUNDLE_ID, WINDOWS_APP); } export async function resetAndLoginWithCache(user: string) { - await closeApplication(USER_A_INSTANCE); + await closeApplication(); await deleteCache(); - await loadTestUserData(user, USER_A_INSTANCE); - await launchApplication(USER_A_INSTANCE, MACOS_BUNDLE_ID, WINDOWS_APP); + await loadTestUserData(user); + await launchApplication(MACOS_BUNDLE_ID, WINDOWS_APP); await loginWithTestUser(); } // Application Manage Functions export async function launchApplication( - instance: string = USER_A_INSTANCE, bundle: string = MACOS_BUNDLE_ID, appLocation: string = WINDOWS_APP, ) { - const currentOS = await driver[instance].capabilities.automationName; + const currentOS = await driver.capabilities.automationName; if (currentOS === WINDOWS_DRIVER) { - await driver[instance].executeScript("windows: launchApp", [ + await driver.executeScript("windows: launchApp", [ { app: join(process.cwd(), appLocation), }, ]); } else if (currentOS === MACOS_DRIVER) { - await driver[instance].executeScript("macos: launchApp", [ + await driver.executeScript("macos: launchApp", [ { bundleId: bundle, }, @@ -225,7 +183,7 @@ export async function launchApplication( } export async function launchSecondApplication() { - await driver[USER_A_INSTANCE].executeScript("macos: launchApp", [ + await driver.executeScript("macos: launchApp", [ { bundleId: MACOS_USER_B_BUNDLE_ID, arguments: ["--path", homedir() + "/.uplinkUserB"], @@ -234,18 +192,16 @@ export async function launchSecondApplication() { await browser.pause(5000); } -export async function activateFirstApplication( - instance: string = USER_A_INSTANCE, -) { - const currentOS = await driver[instance].capabilities.automationName; +export async function activateFirstApplication() { + const currentOS = await driver.capabilities.automationName; if (currentOS === WINDOWS_DRIVER) { - await driver[instance].executeScript("windows: activateApp", [ + await driver.executeScript("windows: activateApp", [ { app: join(process.cwd(), WINDOWS_APP), }, ]); } else if (currentOS === MACOS_DRIVER) { - await driver[instance].executeScript("macos: activateApp", [ + await driver.executeScript("macos: activateApp", [ { bundleId: MACOS_USER_A_BUNDLE_ID, }, @@ -253,18 +209,16 @@ export async function activateFirstApplication( } } -export async function activateSecondApplication( - instance: string = USER_A_INSTANCE, -) { - const currentOS = await driver[instance].capabilities.automationName; +export async function activateSecondApplication() { + const currentOS = await driver.capabilities.automationName; if (currentOS === WINDOWS_DRIVER) { - await driver[instance].executeScript("windows: activateApp", [ + await driver.executeScript("windows: activateApp", [ { app: join(process.cwd(), WINDOWS_APP), }, ]); } else if (currentOS === MACOS_DRIVER) { - await driver[instance].executeScript("macos: activateApp", [ + await driver.executeScript("macos: activateApp", [ { bundleId: MACOS_USER_B_BUNDLE_ID, }, @@ -272,16 +226,16 @@ export async function activateSecondApplication( } } -export async function closeApplication(instance: string) { - const currentOS = await driver[instance].capabilities.automationName; +export async function closeApplication() { + const currentOS = await driver.capabilities.automationName; if (currentOS === WINDOWS_DRIVER) { - await driver[instance].executeScript("windows: closeApp", [ + await driver.executeScript("windows: closeApp", [ { app: join(process.cwd(), WINDOWS_APP), }, ]); } else if (currentOS === MACOS_DRIVER) { - await driver[instance].executeScript("macos: terminateApp", [ + await driver.executeScript("macos: terminateApp", [ { bundleId: MACOS_BUNDLE_ID, }, @@ -289,8 +243,8 @@ export async function closeApplication(instance: string) { } } -export async function maximizeWindow(instance: string) { - const currentOS = await driver[instance].capabilities.automationName; +export async function maximizeWindow() { + const currentOS = await driver.capabilities.automationName; const currentInstance = await browser.getInstance(instance); if (currentOS === WINDOWS_DRIVER) { const button = await currentInstance.$('[name="square-button"]'); @@ -315,7 +269,7 @@ export async function clickOnSwitchMacOS( const elementY = await elementLocator.getLocation("y"); // Hover on X and Y coordinates previously retrieved - await driver[instance].executeScript("macos: click", [ + await driver.executeScript("macos: click", [ { x: elementX, y: elementY, @@ -338,7 +292,7 @@ export async function hoverOnMacOS( instance: string, ) { // Hover on X and Y coordinates previously retrieved - await driver[instance].executeScript("macos: hover", [ + await driver.executeScript("macos: hover", [ { elementId: locator, }, @@ -382,7 +336,7 @@ export async function selectFileOnMacos( await openPanel.waitForExist(); // Open Go To File - await driver[instance].executeScript("macos: keys", [ + await driver.executeScript("macos: keys", [ { keys: [ { @@ -415,7 +369,7 @@ export async function rightClickOnMacOS( locator: WebdriverIO.Element, instance: string, ) { - await driver[instance].executeScript("macos: rightClick", [ + await driver.executeScript("macos: rightClick", [ { elementId: locator, }, @@ -428,14 +382,14 @@ export async function hoverOnWindows( locator: WebdriverIO.Element, instance: string, ) { - await driver[instance].moveToElement(locator.elementId); + await driver.moveToElement(locator.elementId); } export async function rightClickOnWindows( locator: WebdriverIO.Element, instance: string, ) { - await driver[instance].moveToElement(locator.elementId); + await driver.moveToElement(locator.elementId); await mouse.click(Button.RIGHT); } @@ -449,28 +403,26 @@ export async function saveFileOnWindows( // Pause for 5 seconds until explorer window is displayed and switch to it await browser.pause(5000); - const windows = await driver[instance].getWindowHandles(); + const windows = await driver.getWindowHandles(); let explorerWindow; windows[0] === uplinkContext ? (explorerWindow = windows[1]) : (explorerWindow = windows[0]); - await driver[instance].switchToWindow(explorerWindow); + await driver.switchToWindow(explorerWindow); // Wait for Save Panel to be displayed - const titleBar = await driver[instance].$("~TitleBar"); + const titleBar = await driver.$("~TitleBar"); await titleBar.waitForExist(); // Type file location and hit enter - const editInput = await driver[instance].$( - "/Window/Pane[1]/ComboBox[1]/Edit", - ); + const editInput = await driver.$("/Window/Pane[1]/ComboBox[1]/Edit"); await editInput.clearValue(); await editInput.setValue(filename + "\uE007"); // Wait for Save Panel not to be displayed await titleBar.waitForExist({ reverse: true }); - await driver[instance].switchToWindow(uplinkContext); + await driver.switchToWindow(uplinkContext); } export async function selectFileOnWindows( @@ -481,32 +433,32 @@ export async function selectFileOnWindows( // Get the filepath to select on browser const filepath = join(process.cwd(), relativePath); await browser.pause(5000); - const windows = await driver[instance].getWindowHandles(); + const windows = await driver.getWindowHandles(); let explorerWindow; windows[0] === uplinkContext ? (explorerWindow = windows[1]) : (explorerWindow = windows[0]); - await driver[instance].switchToWindow(explorerWindow); + await driver.switchToWindow(explorerWindow); // Wait for Save Panel to be displayed - const listView = await driver[instance].$("~listview"); + const listView = await driver.$("~listview"); await listView.waitForExist({ timeout: 25000 }); // Type file location and hit enter - const editField = await driver[instance].$("//Window/ComboBox/Edit"); + const editField = await driver.$("//Window/ComboBox/Edit"); await editField.clearValue(); await editField.setValue(filepath + "\uE007"); // Wait for Save Panel not to be displayed await listView.waitForExist({ reverse: true }); - await driver[instance].switchToWindow(uplinkContext); + await driver.switchToWindow(uplinkContext); } export async function getUplinkWindowHandle(instance: string) { // Do a for loop that will try to do the next lines for 3 times for (let i = 0; i < 3; i++) { try { - const uplinkContext = await driver[instance].getWindowHandle(); + const uplinkContext = await driver.getWindowHandle(); if (typeof uplinkContext !== "undefined") { return uplinkContext.toString(); } diff --git a/tests/helpers/constants.ts b/tests/helpers/constants.ts index c0cb584491a..b3cd4e2a690 100644 --- a/tests/helpers/constants.ts +++ b/tests/helpers/constants.ts @@ -8,7 +8,5 @@ export const MACOS_BUNDLE_ID = "im.satellite.uplink"; export const MACOS_USER_A_BUNDLE_ID = "im.satellite.uplinkChatUserA"; export const MACOS_USER_B_BUNDLE_ID = "im.satellite.uplinkChatUserB"; export const MACOS_DRIVER = "mac2"; -export const USER_A_INSTANCE = "userA"; -export const USER_B_INSTANCE = "userB"; export const WINDOWS_APP = "\\apps\\uplink.exe"; export const WINDOWS_DRIVER = "windows"; diff --git a/tests/helpers/debugging.ts b/tests/helpers/debugging.ts index b687c55479f..4ea12e682aa 100644 --- a/tests/helpers/debugging.ts +++ b/tests/helpers/debugging.ts @@ -7,7 +7,6 @@ import { launchSecondApplication, saveTestKeys, } from "./commands"; -import { USER_A_INSTANCE } from "./constants"; import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; import FriendsScreen from "@screenobjects/friends/FriendsScreen"; import Topbar from "@screenobjects/chats/Topbar"; @@ -15,14 +14,14 @@ import SettingsGeneralScreen from "@screenobjects/settings/SettingsGeneralScreen import SettingsNotificationsScreen from "@screenobjects/settings/SettingsNotificationsScreen"; import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; -let chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); -let createPinFirstUser = new CreatePinScreen(USER_A_INSTANCE); -let friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); -let settingsGeneralFirstUser = new SettingsGeneralScreen(USER_A_INSTANCE); +let chatsTopbarFirstUser = new Topbar(); +let createPinFirstUser = new CreatePinScreen(); +let friendsScreenFirstUser = new FriendsScreen(); +let settingsGeneralFirstUser = new SettingsGeneralScreen(); let settingsNotificationsFirstUser = new SettingsNotificationsScreen( USER_A_INSTANCE, ); -let settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); +let settingsProfileFirstUser = new SettingsProfileScreen(); let welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); export async function setupBeforeCreateGroupTests() { diff --git a/tests/screenobjects/AppScreen.ts b/tests/screenobjects/AppScreen.ts index cde4d1d28a8..9547f74ecce 100644 --- a/tests/screenobjects/AppScreen.ts +++ b/tests/screenobjects/AppScreen.ts @@ -19,7 +19,7 @@ export default class AppScreen { } async waitForIsShown(isShown = true): Promise { - const locator = await this.instance.$(this.locator); + const locator = await this.$(this.locator); return locator.waitForDisplayed({ reverse: !isShown, }); diff --git a/tests/screenobjects/UplinkMainScreen.ts b/tests/screenobjects/UplinkMainScreen.ts index f26f0afe495..03639471741 100644 --- a/tests/screenobjects/UplinkMainScreen.ts +++ b/tests/screenobjects/UplinkMainScreen.ts @@ -80,15 +80,15 @@ export default class UplinkMainScreen extends AppScreen { } get backButton() { - return this.instance.$(SELECTORS.BACK_BUTTON); + return SELECTORS.BACK_BUTTON; } get buttonNav() { - return this.instance.$(SELECTORS.BUTTON_NAV); + return SELECTORS.BUTTON_NAV; } get buttonNavBarButtonBadge() { - return this.instance.$(SELECTORS.BUTTON_NAV).$(SELECTORS.BUTTON_BADGE); + return SELECTORS.BUTTON_NAV.$(SELECTORS.BUTTON_BADGE); } get buttonNavBarButtonBadgeText() { @@ -99,11 +99,11 @@ export default class UplinkMainScreen extends AppScreen { } get chatsButton() { - return this.instance.$(SELECTORS.CHATS_BUTTON); + return SELECTORS.CHATS_BUTTON; } get chatsButtonTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return SELECTORS.TOOLTIP; } get chatsButtonTooltipText() { @@ -113,15 +113,15 @@ export default class UplinkMainScreen extends AppScreen { } get contextMenu() { - return this.instance.$(SELECTORS.CONTEXT_MENU); + return SELECTORS.CONTEXT_MENU; } get filesButton() { - return this.instance.$(SELECTORS.FILES_BUTTON); + return SELECTORS.FILES_BUTTON; } get filesButtonTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return SELECTORS.TOOLTIP; } get filesButtonTooltipText() { @@ -131,11 +131,11 @@ export default class UplinkMainScreen extends AppScreen { } get friendsButton() { - return this.instance.$(SELECTORS.FRIENDS_BUTTON); + return SELECTORS.FRIENDS_BUTTON; } get friendsButtonTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return SELECTORS.TOOLTIP; } get friendsButtonTooltipText() { @@ -145,11 +145,11 @@ export default class UplinkMainScreen extends AppScreen { } get hamburgerButton() { - return this.instance.$(SELECTORS.HAMBURGER_BUTTON); + return SELECTORS.HAMBURGER_BUTTON; } get prereleaseIndicator() { - return this.instance.$(SELECTORS.PRE_RELEASE_INDICATOR); + return SELECTORS.PRE_RELEASE_INDICATOR; } get prereleaseIndicatorText() { @@ -159,11 +159,11 @@ export default class UplinkMainScreen extends AppScreen { } get settingsButton() { - return this.instance.$(SELECTORS.SETTINGS_BUTTON); + return SELECTORS.SETTINGS_BUTTON; } get settingsButtonTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return SELECTORS.TOOLTIP; } get settingsButtonTooltipText() { @@ -173,15 +173,15 @@ export default class UplinkMainScreen extends AppScreen { } get skeletalUser() { - return this.instance.$$(SELECTORS.SKELETAL_USER)[0]; + return$(SELECTORS.SKELETAL_USER)[0]; } get toastNotifications() { - return this.instance.$$(SELECTORS.TOAST_NOTIFICATION); + return$(SELECTORS.TOAST_NOTIFICATION); } get toastNotification() { - return this.instance.$(SELECTORS.TOAST_NOTIFICATION); + return SELECTORS.TOAST_NOTIFICATION; } get toastNotificationClose() { @@ -197,7 +197,7 @@ export default class UplinkMainScreen extends AppScreen { } get updateAvailable() { - return this.instance.$(SELECTORS.UPDATE_AVAILABLE); + return SELECTORS.UPDATE_AVAILABLE; } get updateAvailableText() { @@ -207,15 +207,15 @@ export default class UplinkMainScreen extends AppScreen { } get updateMenuDismiss() { - return this.instance.$(SELECTORS.UPDATE_MENU_DISMISS); + return SELECTORS.UPDATE_MENU_DISMISS; } get updateMenuDownload() { - return this.instance.$(SELECTORS.UPDATE_MENU_DOWNLOAD); + return SELECTORS.UPDATE_MENU_DOWNLOAD; } get window() { - return this.instance.$(SELECTORS.WINDOW); + return SELECTORS.WINDOW; } // Toast Notifications methods @@ -314,12 +314,12 @@ export default class UplinkMainScreen extends AppScreen { // Multiremote functions async switchToOtherUserWindow() { - const currentInstance = await this.instance.getWindowHandle(); - await this.instance.switchToWindow(currentInstance); + const currentInstance = await this.getWindowHandle(); + await this.switchToWindow(currentInstance); } async showUplinkWindow() { - const window = await this.instance.window; + const window = await this.window; await window.click(); await window.waitForExist(); } diff --git a/tests/screenobjects/account-creation/CreatePinScreen.ts b/tests/screenobjects/account-creation/CreatePinScreen.ts index ea0cfd285d6..b76f53c41ec 100644 --- a/tests/screenobjects/account-creation/CreatePinScreen.ts +++ b/tests/screenobjects/account-creation/CreatePinScreen.ts @@ -1,13 +1,9 @@ require("module-alias/register"); import UplinkMainScreen from "@screenobjects/UplinkMainScreen"; -import { - USER_A_INSTANCE, - MACOS_DRIVER, - WINDOWS_DRIVER, -} from "@helpers/constants"; +import { MACOS_DRIVER, WINDOWS_DRIVER } from "@helpers/constants"; import { rightClickOnMacOS, rightClickOnWindows } from "@helpers/commands"; -const currentOS = driver[USER_A_INSTANCE].capabilities.automationName; +const currentOS = driver.capabilities.automationName; let SELECTORS = {}; const SELECTORS_COMMON = { @@ -49,48 +45,48 @@ currentOS === WINDOWS_DRIVER : (SELECTORS = { ...SELECTORS_MACOS, ...SELECTORS_COMMON }); export default class CreatePinScreen extends UplinkMainScreen { - constructor(executor: string) { - super(executor, SELECTORS.UNLOCK_LAYOUT); + constructor() { + super(SELECTORS.UNLOCK_LAYOUT); } get accountResetButton() { - return this.instance.$(SELECTORS.ACCOUNT_RESET_BUTTON); + return $(SELECTORS.ACCOUNT_RESET_BUTTON); } get createAccountButton() { - return this.instance.$(SELECTORS.CREATE_ACCOUNT_BUTTON); + return $(SELECTORS.CREATE_ACCOUNT_BUTTON); } get helpButton() { - return this.instance.$(SELECTORS.HELP_BUTTON); + return $(SELECTORS.HELP_BUTTON); } get helpButtonTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return $(SELECTORS.TOOLTIP); } get helpButtonTooltipText() { - return this.instance.$(SELECTORS.TOOLTIP).$(SELECTORS.TOOLTIP_TEXT); + return $(SELECTORS.TOOLTIP).$(SELECTORS.TOOLTIP_TEXT); } get inputError() { - return this.instance.$(SELECTORS.INPUT_ERROR); + return $(SELECTORS.INPUT_ERROR); } get inputErrorText() { - return this.inputError.$(SELECTORS.INPUT_ERROR_TEXT); + return $(SELECTORS.INPUT_ERROR_TEXT); } get pinInput() { - return this.instance.$(SELECTORS.PIN_INPUT); + return SELECTORS.PIN_INPUT; } get unlockLayout() { - return this.instance.$(SELECTORS.UNLOCK_LAYOUT); + return SELECTORS.UNLOCK_LAYOUT; } get unlockImage() { - return this.instance.$(SELECTORS.UNLOCK_LAYOUT).$(SELECTORS.UNLOCK_IMAGE); + return SELECTORS.UNLOCK_LAYOUT.$(SELECTORS.UNLOCK_IMAGE); } get unlockWarningHeader() { diff --git a/tests/screenobjects/account-creation/CreateUserScreen.ts b/tests/screenobjects/account-creation/CreateUserScreen.ts index da7fc1f7f19..306b02b6165 100644 --- a/tests/screenobjects/account-creation/CreateUserScreen.ts +++ b/tests/screenobjects/account-creation/CreateUserScreen.ts @@ -36,23 +36,23 @@ export default class CreateUserScreen extends UplinkMainScreen { } get createAccountButton() { - return this.instance.$(SELECTORS.CREATE_ACCOUNT_BUTTON); + return SELECTORS.CREATE_ACCOUNT_BUTTON; } get inputError() { - return this.instance.$(SELECTORS.INPUT_ERROR); + return SELECTORS.INPUT_ERROR; } get inputErrorText() { - return this.instance.$(SELECTORS.INPUT_ERROR).$(SELECTORS.INPUT_ERROR_TEXT); + return SELECTORS.INPUT_ERROR.$(SELECTORS.INPUT_ERROR_TEXT); } get unlockLayout() { - return this.instance.$(SELECTORS.UNLOCK_LAYOUT); + return SELECTORS.UNLOCK_LAYOUT; } get usernameInput() { - return this.instance.$(SELECTORS.USERNAME_INPUT); + return SELECTORS.USERNAME_INPUT; } async enterUsername(username: string) { diff --git a/tests/screenobjects/chats/ChatsLayout.ts b/tests/screenobjects/chats/ChatsLayout.ts index 04f570c6b3c..4d5c4a84b7e 100644 --- a/tests/screenobjects/chats/ChatsLayout.ts +++ b/tests/screenobjects/chats/ChatsLayout.ts @@ -38,11 +38,11 @@ export default class ChatsLayout extends UplinkMainScreen { } get chatLayout() { - return this.instance.$(SELECTORS.CHAT_LAYOUT); + return SELECTORS.CHAT_LAYOUT; } get encryptedMessages() { - return this.instance.$(SELECTORS.ENCRYPTED_MESSAGES); + return SELECTORS.ENCRYPTED_MESSAGES; } get encryptedMessagesText() { @@ -52,7 +52,7 @@ export default class ChatsLayout extends UplinkMainScreen { } get typingIndicator() { - return this.instance.$(SELECTORS.CHAT_LAYOUT).$(SELECTORS.TYPING_INDICATOR); + return SELECTORS.CHAT_LAYOUT.$(SELECTORS.TYPING_INDICATOR); } get typingIndicatorText() { diff --git a/tests/screenobjects/chats/ChatsSidebar.ts b/tests/screenobjects/chats/ChatsSidebar.ts index 08df8456ea6..5e5d405a481 100644 --- a/tests/screenobjects/chats/ChatsSidebar.ts +++ b/tests/screenobjects/chats/ChatsSidebar.ts @@ -113,15 +113,15 @@ export default class ChatsSidebar extends UplinkMainScreen { } get sidebar() { - return this.instance.$(SELECTORS.SIDEBAR); + return SELECTORS.SIDEBAR; } get sidebarChatsSection() { - return this.instance.$(SELECTORS.SIDEBAR_CHATS_SECTION); + return SELECTORS.SIDEBAR_CHATS_SECTION; } get sidebarChildren() { - return this.instance.$(SELECTORS.SIDEBAR_CHILDREN); + return SELECTORS.SIDEBAR_CHILDREN; } get sidebarChatsUser() { @@ -262,15 +262,15 @@ export default class ChatsSidebar extends UplinkMainScreen { } get sidebarCreateGroupChatTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return SELECTORS.TOOLTIP; } get sidebarCreateGroupChatTooltipText() { - return this.instance.$(SELECTORS.TOOLTIP).$(SELECTORS.TOOLTIP_TEXT); + return SELECTORS.TOOLTIP.$(SELECTORS.TOOLTIP_TEXT); } get sidebarGroupChatImage() { - return this.instance.$(SELECTORS.SIDEBAR_GROUP_CHAT_IMAGE); + return SELECTORS.SIDEBAR_GROUP_CHAT_IMAGE; } get sidebarGroupChatPlusSome() { @@ -314,7 +314,7 @@ export default class ChatsSidebar extends UplinkMainScreen { } get sidebarSearch() { - return this.instance.$(SELECTORS.SIDEBAR_SEARCH); + return SELECTORS.SIDEBAR_SEARCH; } // Validations or assertions @@ -431,7 +431,7 @@ export default class ChatsSidebar extends UplinkMainScreen { const currentDriver = await this.getCurrentDriver(); let locator; if (currentDriver === macDriver) { - locator = await this.instance.$(SELECTORS.SIDEBAR).$("~" + username); + locator = await this.$(SELECTORS.SIDEBAR).$("~" + username); } else if (currentDriver === windowsDriver) { locator = await this.instance .$(SELECTORS.SIDEBAR) @@ -453,7 +453,7 @@ export default class ChatsSidebar extends UplinkMainScreen { async waitForGroupToBeCreated(groupname: string) { const element = await this.getExistingElementByAriaLabel(groupname); - await this.instance.$(SELECTORS.SIDEBAR).$(element).waitForExist(); + await this.$(SELECTORS.SIDEBAR).$(element).waitForExist(); } async waitForGroupToBeDeleted(groupname: string) { diff --git a/tests/screenobjects/chats/ComposeAttachment.ts b/tests/screenobjects/chats/ComposeAttachment.ts index ff7dbc4631c..5f42a21ff0e 100644 --- a/tests/screenobjects/chats/ComposeAttachment.ts +++ b/tests/screenobjects/chats/ComposeAttachment.ts @@ -55,7 +55,7 @@ export default class ComposeAttachments extends UplinkMainScreen { } get composeAttachments() { - return this.instance.$(SELECTORS.COMPOSE_ATTACHMENTS); + return SELECTORS.COMPOSE_ATTACHMENTS; } get composeAttachmentsButton() { @@ -132,7 +132,7 @@ export default class ComposeAttachments extends UplinkMainScreen { async clickOnDeleteAttachment(attachment: number) { // Get the locator of attachment to delete by passing the index - const attachmentToDelete = await this.instance.$$( + const attachmentToDelete = await this.$$( SELECTORS.COMPOSE_ATTACHMENTS_FILE_EMBED, )[attachment]; await this.hoverOnElement(attachmentToDelete); @@ -150,7 +150,7 @@ export default class ComposeAttachments extends UplinkMainScreen { async getListOfAttachmentsEmbed() { const composeAttachments = await this.composeAttachments; await composeAttachments.waitForExist(); - const filesAttached = await this.instance.$$( + const filesAttached = await this.$$( SELECTORS.COMPOSE_ATTACHMENTS_FILE_EMBED, ); let results = []; diff --git a/tests/screenobjects/chats/ContextMenu.ts b/tests/screenobjects/chats/ContextMenu.ts index 478128509ee..66d265a40e9 100644 --- a/tests/screenobjects/chats/ContextMenu.ts +++ b/tests/screenobjects/chats/ContextMenu.ts @@ -47,7 +47,7 @@ export default class ContextMenu extends UplinkMainScreen { } get contextMenu() { - return this.instance.$(SELECTORS.CONTEXT_MENU); + return SELECTORS.CONTEXT_MENU; } get contextMessagesCancelEdit() { @@ -157,13 +157,13 @@ export default class ContextMenu extends UplinkMainScreen { const currentDriver = await this.getCurrentDriver(); let locator; if (currentDriver === MACOS_DRIVER) { - locator = await this.instance.$( + locator = await this.$( '//XCUIElementTypeGroup[@label="Context Menu"]/XCUIElementTypeButton[@Value="' + reaction + '"]', ); } else if (currentDriver === WINDOWS_DRIVER) { - locator = await this.instance.$( + locator = await this.$( '//Group[@Name="Context Menu"]/Button[@Name="' + reaction + '"]', ); } diff --git a/tests/screenobjects/chats/ContextMenuSidebar.ts b/tests/screenobjects/chats/ContextMenuSidebar.ts index 0663fb2e91b..96ad74df7fc 100644 --- a/tests/screenobjects/chats/ContextMenuSidebar.ts +++ b/tests/screenobjects/chats/ContextMenuSidebar.ts @@ -36,27 +36,27 @@ export default class ContextMenuSidebar extends UplinkMainScreen { } get contextMenu() { - return this.instance.$(SELECTORS.CONTEXT_MENU); + return SELECTORS.CONTEXT_MENU; } get sidebarChatsContextClearUnreads() { - return this.instance.$(SELECTORS.SIDEBAR_CHATS_CONTEXT_CLEAR); + return SELECTORS.SIDEBAR_CHATS_CONTEXT_CLEAR; } get sidebarChatsContextHideChat() { - return this.instance.$(SELECTORS.SIDEBAR_CHATS_CONTEXT_HIDE); + return SELECTORS.SIDEBAR_CHATS_CONTEXT_HIDE; } get sidebarChatsContextDeleteConversation() { - return this.instance.$(SELECTORS.SIDEBAR_CHATS_CONTEXT_DELETE_CONVERSATION); + return SELECTORS.SIDEBAR_CHATS_CONTEXT_DELETE_CONVERSATION; } get sidebarChatsContextDeleteGroup() { - return this.instance.$(SELECTORS.SIDEBAR_CHATS_CONTEXT_DELETE_GROUP); + return SELECTORS.SIDEBAR_CHATS_CONTEXT_DELETE_GROUP; } get sidebarChatsContextLeaveGroup() { - return this.instance.$(SELECTORS.SIDEBAR_CHATS_CONTEXT_LEAVE); + return SELECTORS.SIDEBAR_CHATS_CONTEXT_LEAVE; } async selectChatsClearUnreads() { diff --git a/tests/screenobjects/chats/CreateGroupChat.ts b/tests/screenobjects/chats/CreateGroupChat.ts index 2b89c86b629..c0d5ed517e7 100644 --- a/tests/screenobjects/chats/CreateGroupChat.ts +++ b/tests/screenobjects/chats/CreateGroupChat.ts @@ -72,7 +72,7 @@ export default class CreateGroupChat extends UplinkMainScreen { } get createGroupChatSection() { - return this.instance.$(SELECTORS.CREATE_GROUP_CHAT_SECTION); + return SELECTORS.CREATE_GROUP_CHAT_SECTION; } get createGroupInputError() { diff --git a/tests/screenobjects/chats/EditGroup.ts b/tests/screenobjects/chats/EditGroup.ts index b5f7948861b..63daf76df3b 100644 --- a/tests/screenobjects/chats/EditGroup.ts +++ b/tests/screenobjects/chats/EditGroup.ts @@ -96,7 +96,7 @@ export default class EditGroup extends UplinkMainScreen { } get editGroupModal() { - return this.instance.$(SELECTORS.EDIT_GROUP_MODAL); + return SELECTORS.EDIT_GROUP_MODAL; } get editGroupSection() { @@ -117,11 +117,11 @@ export default class EditGroup extends UplinkMainScreen { } get groupNameInput() { - return this.instance.$(SELECTORS.GROUP_NAME_INPUT); + return SELECTORS.GROUP_NAME_INPUT; } get groupNameInputError() { - return this.instance.$(SELECTORS.GROUP_NAME_INPUT_ERROR); + return SELECTORS.GROUP_NAME_INPUT_ERROR; } get groupNameInputErrorText() { @@ -252,9 +252,7 @@ export default class EditGroup extends UplinkMainScreen { } async clickOnFirstAddButton() { - const firstAddButton = await this.instance.$$( - SELECTORS.ADD_PARTICIPANT_BUTTON, - )[0]; + const firstAddButton = await this.$$(SELECTORS.ADD_PARTICIPANT_BUTTON)[0]; await driver[this.executor].waitUntil( async () => { return await firstAddButton; @@ -269,7 +267,7 @@ export default class EditGroup extends UplinkMainScreen { } async clickOnFirstRemoveButton() { - const removeParticipantButton = await this.instance.$$( + const removeParticipantButton = await this.$$( SELECTORS.REMOVE_PARTICIPANT_BUTTON, )[0]; await driver[this.executor].waitUntil( diff --git a/tests/screenobjects/chats/EmojiSelector.ts b/tests/screenobjects/chats/EmojiSelector.ts index f8aa1fbfbfc..3fc048de8a1 100644 --- a/tests/screenobjects/chats/EmojiSelector.ts +++ b/tests/screenobjects/chats/EmojiSelector.ts @@ -36,7 +36,7 @@ export default class EmojiSelector extends UplinkMainScreen { } get emoji() { - return this.instance.$(SELECTORS.EMOJI_SELECTOR).$$(SELECTORS.EMOJI); + return SELECTORS.EMOJI_SELECTOR.$$(SELECTORS.EMOJI); } get emojiValue() { @@ -47,7 +47,7 @@ export default class EmojiSelector extends UplinkMainScreen { } get emojiSelector() { - return this.instance.$(SELECTORS.EMOJI_SELECTOR); + return SELECTORS.EMOJI_SELECTOR; } get emojisContainer() { @@ -67,7 +67,7 @@ export default class EmojiSelector extends UplinkMainScreen { .$(SELECTORS.EMOJI_SELECTOR) .$(emojiLocator); } else if (currentDriver === WINDOWS_DRIVER) { - emojiLocator = await this.instance.findElement("name", emojiToClick); + emojiLocator = await this.findElement("name", emojiToClick); emojiElement = await this.instance .$(SELECTORS.EMOJI_SELECTOR) .$(emojiLocator); diff --git a/tests/screenobjects/chats/EmojiSuggestions.ts b/tests/screenobjects/chats/EmojiSuggestions.ts index 625bc262343..dceca97befe 100644 --- a/tests/screenobjects/chats/EmojiSuggestions.ts +++ b/tests/screenobjects/chats/EmojiSuggestions.ts @@ -45,7 +45,7 @@ export default class EmojiSuggestions extends UplinkMainScreen { } get emojiSuggestionsContainer() { - return this.instance.$(SELECTORS.EMOJI_SUGGESTIONS_CONTAINER); + return SELECTORS.EMOJI_SUGGESTIONS_CONTAINER; } get emojiSuggestionsHeader() { @@ -66,15 +66,12 @@ export default class EmojiSuggestions extends UplinkMainScreen { let emojiLocator, emojiElement; if (currentDriver === MACOS_DRIVER) { emojiLocator = "~emoji-suggested-" + emojiToClick; - emojiElement = await this.instance.$(emojiLocator); + emojiElement = await this.$(emojiLocator); } else if (currentDriver === WINDOWS_DRIVER) { const emojiLocatorWindows = '[name="emoji-suggested-"' + emojiToClick + '"]'; - emojiLocator = await this.instance.findElement( - "name", - emojiLocatorWindows, - ); - emojiElement = await this.instance.$(emojiLocator); + emojiLocator = await this.findElement("name", emojiLocatorWindows); + emojiElement = await this.$(emojiLocator); } await this.hoverOnElement(emojiElement); await emojiElement.click(); diff --git a/tests/screenobjects/chats/FavoritesSidebar.ts b/tests/screenobjects/chats/FavoritesSidebar.ts index 8cd373a1172..124a5447bf9 100644 --- a/tests/screenobjects/chats/FavoritesSidebar.ts +++ b/tests/screenobjects/chats/FavoritesSidebar.ts @@ -68,7 +68,7 @@ export default class FavoritesSidebar extends UplinkMainScreen { } get favorites() { - return this.instance.$(SELECTORS.SLIMBAR).$(SELECTORS.FAVORITES); + return SELECTORS.SLIMBAR.$(SELECTORS.FAVORITES); } get favoritesChat() { @@ -140,7 +140,7 @@ export default class FavoritesSidebar extends UplinkMainScreen { } get slimbar() { - return this.instance.$(SELECTORS.SLIMBAR); + return SELECTORS.SLIMBAR; } get slimbarButtonNav() { @@ -185,7 +185,7 @@ export default class FavoritesSidebar extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(SELECTORS.SLIMBAR).$(favoritesLocator); + return await this.$(SELECTORS.SLIMBAR).$(favoritesLocator); }, { timeout: 15000, diff --git a/tests/screenobjects/chats/ImagePreview.ts b/tests/screenobjects/chats/ImagePreview.ts index cdb02c7e9b1..aa77d5965e4 100644 --- a/tests/screenobjects/chats/ImagePreview.ts +++ b/tests/screenobjects/chats/ImagePreview.ts @@ -35,7 +35,7 @@ export default class ImagePreview extends UplinkMainScreen { } get previewModal() { - return this.instance.$(SELECTORS.PREVIEW_MODAL); + return SELECTORS.PREVIEW_MODAL; } get previewModalCloseButton() { diff --git a/tests/screenobjects/chats/InputBar.ts b/tests/screenobjects/chats/InputBar.ts index bfe2b495d56..0298d49d4c1 100644 --- a/tests/screenobjects/chats/InputBar.ts +++ b/tests/screenobjects/chats/InputBar.ts @@ -63,15 +63,15 @@ export default class InputBar extends UplinkMainScreen { } get editMessageInput() { - return this.instance.$(SELECTORS.EDIT_MESSAGE_INPUT); + return SELECTORS.EDIT_MESSAGE_INPUT; } get emojiButton() { - return this.instance.$(SELECTORS.EMOJI_BUTTON); + return SELECTORS.EMOJI_BUTTON; } get inputCharCounter() { - return this.instance.$(SELECTORS.INPUT_CHAR_COUNTER); + return SELECTORS.INPUT_CHAR_COUNTER; } get inputCharCounterText() { @@ -81,11 +81,11 @@ export default class InputBar extends UplinkMainScreen { } get inputCharMaxText() { - return this.instance.$(SELECTORS.INPUT_CHAR_MAX_TEXT); + return SELECTORS.INPUT_CHAR_MAX_TEXT; } get inputGroup() { - return this.instance.$(SELECTORS.CHAT_LAYOUT).$(SELECTORS.INPUT_GROUP); + return SELECTORS.CHAT_LAYOUT.$(SELECTORS.INPUT_GROUP); } get inputText() { @@ -96,35 +96,35 @@ export default class InputBar extends UplinkMainScreen { } get sendMessageButton() { - return this.instance.$(SELECTORS.SEND_MESSAGE_BUTTON); + return SELECTORS.SEND_MESSAGE_BUTTON; } get sendMessageTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return SELECTORS.TOOLTIP; } get sendMessageTooltipText() { - return this.instance.$(SELECTORS.TOOLTIP).$(SELECTORS.TOOLTIP_TEXT); + return SELECTORS.TOOLTIP.$(SELECTORS.TOOLTIP_TEXT); } get uploadButton() { - return this.instance.$(SELECTORS.UPLOAD_BUTTON); + return SELECTORS.UPLOAD_BUTTON; } get uploadTooltip() { - return this.instance.$(SELECTORS.TOOLTIP); + return SELECTORS.TOOLTIP; } get uploadTooltipText() { - return this.instance.$(SELECTORS.TOOLTIP).$(SELECTORS.TOOLTIP_TEXT); + return SELECTORS.TOOLTIP.$(SELECTORS.TOOLTIP_TEXT); } get uploadButtonStorage() { - return this.instance.$(SELECTORS.UPLOAD_BUTTON_STORAGE); + return SELECTORS.UPLOAD_BUTTON_STORAGE; } get uploadButtonLocalDisk() { - return this.instance.$(SELECTORS.UPLOAD_BUTTON_LOCAL_DISK); + return SELECTORS.UPLOAD_BUTTON_LOCAL_DISK; } async clearInputBar() { diff --git a/tests/screenobjects/chats/MessageGroup.ts b/tests/screenobjects/chats/MessageGroup.ts index c7b75731a4b..37855180472 100644 --- a/tests/screenobjects/chats/MessageGroup.ts +++ b/tests/screenobjects/chats/MessageGroup.ts @@ -83,27 +83,27 @@ export default class MessageGroup extends UplinkMainScreen { } get chatMessageLocalFirst() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_LOCAL_FIRST); + return SELECTORS.CHAT_MESSAGE_LOCAL_FIRST; } get chatMessageLocalLast() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_LOCAL_LAST); + return SELECTORS.CHAT_MESSAGE_LOCAL_LAST; } get chatMessageLocalMiddle() { - return this.instance.$$(SELECTORS.CHAT_MESSAGE_LOCAL_MIDDLE); + return$(SELECTORS.CHAT_MESSAGE_LOCAL_MIDDLE); } get chatMessageRemoteFirst() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_REMOTE_FIRST); + return SELECTORS.CHAT_MESSAGE_REMOTE_FIRST; } get chatMessageRemoteLast() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_REMOTE_LAST); + return SELECTORS.CHAT_MESSAGE_REMOTE_LAST; } get chatMessageRemoteMiddle() { - return this.instance.$$(SELECTORS.CHAT_MESSAGE_REMOTE_MIDDLE); + return$(SELECTORS.CHAT_MESSAGE_REMOTE_MIDDLE); } get chatMessageTextValue() { @@ -113,7 +113,7 @@ export default class MessageGroup extends UplinkMainScreen { } get chatMessageTextGroup() { - return this.instance.$$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); + return$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); } get emojiReactionRemote() { @@ -143,19 +143,19 @@ export default class MessageGroup extends UplinkMainScreen { } get messageGroupReceived() { - return this.instance.$$(SELECTORS.MESSAGE_GROUP_REMOTE); + return$(SELECTORS.MESSAGE_GROUP_REMOTE); } get messageGroupSent() { - return this.instance.$$(SELECTORS.MESSAGE_GROUP_SENT); + return$(SELECTORS.MESSAGE_GROUP_SENT); } get messageGroupWrapLocal() { - return this.instance.$$(SELECTORS.MESSAGE_GROUP_WRAP_LOCAL); + return$(SELECTORS.MESSAGE_GROUP_WRAP_LOCAL); } get messageGroupWrapRemote() { - return this.instance.$$(SELECTORS.MESSAGE_GROUP_WRAP_REMOTE); + return$(SELECTORS.MESSAGE_GROUP_WRAP_REMOTE); } get messageGroupTimeAgo() { @@ -212,11 +212,11 @@ export default class MessageGroup extends UplinkMainScreen { } get messageReactionContainer() { - return this.instance.$$(SELECTORS.MESSAGE_REACTION_CONTAINER); + return$(SELECTORS.MESSAGE_REACTION_CONTAINER); } get pinIndicator() { - return this.instance.$$(SELECTORS.PIN_INDICATOR); + return$(SELECTORS.PIN_INDICATOR); } // Message Group Wraps Received Methods @@ -468,7 +468,7 @@ export default class MessageGroup extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(emojiReactionLocator); + return await this.$(emojiReactionLocator); }, { timeout: 15000, @@ -494,7 +494,7 @@ export default class MessageGroup extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(emojiReactionLocator); + return await this.$(emojiReactionLocator); }, { timeout: 15000, diff --git a/tests/screenobjects/chats/Messages.ts b/tests/screenobjects/chats/Messages.ts index 6d34d6e90b4..31de2973543 100644 --- a/tests/screenobjects/chats/Messages.ts +++ b/tests/screenobjects/chats/Messages.ts @@ -137,11 +137,11 @@ export default class Messages extends UplinkMainScreen { } get chatMessageFileEmbedLocal() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_FILE_EMBED); + return SELECTORS.CHAT_MESSAGE_FILE_EMBED; } get chatMessageFileEmbedRemote() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_FILE_EMBED_REMOTE); + return SELECTORS.CHAT_MESSAGE_FILE_EMBED_REMOTE; } get chatMessageFileIconLocal() { @@ -221,7 +221,7 @@ export default class Messages extends UplinkMainScreen { } get chatMessageImageContainer() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_IMAGE_CONTAINER); + return SELECTORS.CHAT_MESSAGE_IMAGE_CONTAINER; } get chatMessageImageFile() { @@ -231,7 +231,7 @@ export default class Messages extends UplinkMainScreen { } get chatMessageImageModal() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_IMAGE_MODAL); + return SELECTORS.CHAT_MESSAGE_IMAGE_MODAL; } get chatMessageImageModalFile() { @@ -241,7 +241,7 @@ export default class Messages extends UplinkMainScreen { } get chatMessageLinkEmbed() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_LINK_EMBED); + return SELECTORS.CHAT_MESSAGE_LINK_EMBED; } get chatMessageLinkEmbedDetails() { @@ -263,15 +263,15 @@ export default class Messages extends UplinkMainScreen { } get chatMessageLocal() { - return this.instance.$$(SELECTORS.CHAT_MESSAGE_LOCAL); + return$(SELECTORS.CHAT_MESSAGE_LOCAL); } get chatMessageRemote() { - return this.instance.$$(SELECTORS.CHAT_MESSAGE_REMOTE); + return$(SELECTORS.CHAT_MESSAGE_REMOTE); } get chatMessageReply() { - return this.instance.$(SELECTORS.CHAT_MESSAGE_REPLY); + return SELECTORS.CHAT_MESSAGE_REPLY; } get chatMessageReplyText() { @@ -287,7 +287,7 @@ export default class Messages extends UplinkMainScreen { } get chatMessageTextGroup() { - return this.instance.$$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); + return$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); } // Messages Received Methods @@ -350,7 +350,7 @@ export default class Messages extends UplinkMainScreen { expectedMessage + '")]/../..'; } - const messageReceived = await this.instance.$(locator); + const messageReceived = await this.$(locator); await messageReceived.waitForExist(); return messageReceived; } @@ -400,7 +400,7 @@ export default class Messages extends UplinkMainScreen { expectedLanguage + '")]'; } - const codeMessage = await this.instance.$(codeMessageLocator); + const codeMessage = await this.$(codeMessageLocator); await codeMessage.waitForExist(); } @@ -445,7 +445,7 @@ export default class Messages extends UplinkMainScreen { linkSentLocator = '//HyperLink[contains(@Name, "' + expectedMessage + '")]'; } - const link = await this.instance.$(linkSentLocator); + const link = await this.$(linkSentLocator); await link.waitForExist(); } @@ -463,7 +463,7 @@ export default class Messages extends UplinkMainScreen { expectedMessage + '")]'; } - const messageSent = await this.instance.$(messageSentLocator); + const messageSent = await this.$(messageSentLocator); await messageSent.waitForExist(); } @@ -482,7 +482,7 @@ export default class Messages extends UplinkMainScreen { '")]'; } - const codeMessage = await this.instance.$(codeMessageReceivedLocator); + const codeMessage = await this.$(codeMessageReceivedLocator); await codeMessage.waitForExist(); } @@ -498,7 +498,7 @@ export default class Messages extends UplinkMainScreen { linkReceivedLocator = '//HyperLink[contains(@Name, "' + expectedMessage + '")]'; } - const link = await this.instance.$(linkReceivedLocator); + const link = await this.$(linkReceivedLocator); await link.waitForExist(); } @@ -516,7 +516,7 @@ export default class Messages extends UplinkMainScreen { expectedMessage + '")]'; } - const messageReceived = await this.instance.$(receivedMessageLocator); + const messageReceived = await this.$(receivedMessageLocator); await messageReceived.waitForExist(); } @@ -583,7 +583,7 @@ export default class Messages extends UplinkMainScreen { expectedMessage + '")]/../..'; } - const messageSent = await this.instance.$(messageSentLocator); + const messageSent = await this.$(messageSentLocator); await messageSent.waitForExist(); return messageSent; } diff --git a/tests/screenobjects/chats/OutgoingCallModal.ts b/tests/screenobjects/chats/OutgoingCallModal.ts index a7c1fc94bb5..712cea55cac 100644 --- a/tests/screenobjects/chats/OutgoingCallModal.ts +++ b/tests/screenobjects/chats/OutgoingCallModal.ts @@ -97,7 +97,7 @@ export default class OutgoingCallModal extends UplinkMainScreen { } get outgoingCallLabel() { - return this.instance.$(SELECTORS.OUTGOING_CALL_LABEL); + return SELECTORS.OUTGOING_CALL_LABEL; } get outgoingCallLabelText() { @@ -109,7 +109,7 @@ export default class OutgoingCallModal extends UplinkMainScreen { } get remoteControls() { - return this.instance.$(SELECTORS.REMOTE_CONTROLS); + return SELECTORS.REMOTE_CONTROLS; } get userImageGroupWrap() { diff --git a/tests/screenobjects/chats/PinnedMessages.ts b/tests/screenobjects/chats/PinnedMessages.ts index 22ad54b5460..1cd9771fe89 100644 --- a/tests/screenobjects/chats/PinnedMessages.ts +++ b/tests/screenobjects/chats/PinnedMessages.ts @@ -84,7 +84,7 @@ export default class PinnedMessages extends UplinkMainScreen { } get pinnedMessageAttachments() { - return this.instance.$$(SELECTORS.PINNED_MESSAGE_ATTACHMENTS); + return$(SELECTORS.PINNED_MESSAGE_ATTACHMENTS); } get pinnedMessageAttachmentsFileEmbed() { @@ -136,19 +136,19 @@ export default class PinnedMessages extends UplinkMainScreen { } get pinnedMessageButtonContainer() { - return this.instance.$(SELECTORS.PINNED_MESSAGE_BUTTON_CONTAINER); + return SELECTORS.PINNED_MESSAGE_BUTTON_CONTAINER; } get pinnedMessageButtonGoTo() { - return this.instance.$(SELECTORS.PINNED_MESSAGE_BUTTON_GO_TO); + return SELECTORS.PINNED_MESSAGE_BUTTON_GO_TO; } get pinnedMessageButtonUnpin() { - return this.instance.$(SELECTORS.PINNED_MESSAGE_BUTTON_UNPIN); + return SELECTORS.PINNED_MESSAGE_BUTTON_UNPIN; } get pinnedMessageSender() { - return this.instance.$(SELECTORS.PINNED_MESSAGE_SENDER); + return SELECTORS.PINNED_MESSAGE_SENDER; } get pinnedMessageSenderText() { @@ -156,11 +156,11 @@ export default class PinnedMessages extends UplinkMainScreen { } get pinnedMessageSingleContainer() { - return this.instance.$$(SELECTORS.PINNED_MESSAGE_SINGLE_CONTAINER); + return$(SELECTORS.PINNED_MESSAGE_SINGLE_CONTAINER); } get pinnedMessageTimestamp() { - return this.instance.$(SELECTORS.PINNED_MESSAGE_TIMESTAMP); + return SELECTORS.PINNED_MESSAGE_TIMESTAMP; } get pinnedMessageTimestampText() { @@ -182,11 +182,11 @@ export default class PinnedMessages extends UplinkMainScreen { } get pinnedMessageUserImageWrap() { - return this.instance.$(SELECTORS.PINNED_MESSAGE_USER_IMAGE_WRAP); + return SELECTORS.PINNED_MESSAGE_USER_IMAGE_WRAP; } get pinnedMessageValue() { - return this.instance.$(SELECTORS.PINNED_MESSAGE_VALUE); + return SELECTORS.PINNED_MESSAGE_VALUE; } get pinnedMessageValueText() { @@ -194,19 +194,19 @@ export default class PinnedMessages extends UplinkMainScreen { } get pinnedMessageWrap() { - return this.instance.$$(SELECTORS.PINNED_MESSAGE_WRAP); + return$(SELECTORS.PINNED_MESSAGE_WRAP); } get pinContainer() { - return this.instance.$(SELECTORS.PIN_CONTAINER); + return SELECTORS.PIN_CONTAINER; } get pinContainerLabel() { - return this.instance.$(SELECTORS.PIN_CONTAINER_LABEL); + return SELECTORS.PIN_CONTAINER_LABEL; } get pinEmpty() { - return this.instance.$(SELECTORS.PIN_EMPTY); + return SELECTORS.PIN_EMPTY; } get pinModalLabel() { @@ -214,7 +214,7 @@ export default class PinnedMessages extends UplinkMainScreen { } get pinModalMain() { - return this.instance.$(SELECTORS.PIN_MODAL_MAIN); + return SELECTORS.PIN_MODAL_MAIN; } // Clicking methods diff --git a/tests/screenobjects/chats/QuickProfile.ts b/tests/screenobjects/chats/QuickProfile.ts index 755042b69e5..dc62122e2aa 100644 --- a/tests/screenobjects/chats/QuickProfile.ts +++ b/tests/screenobjects/chats/QuickProfile.ts @@ -68,7 +68,7 @@ export default class QuickProfile extends UplinkMainScreen { } get quickProfile() { - return this.instance.$(SELECTORS.CHAT_LAYOUT).$(SELECTORS.QUICK_PROFILE); + return SELECTORS.CHAT_LAYOUT.$(SELECTORS.QUICK_PROFILE); } get quickProfileBannerImage() { @@ -170,7 +170,7 @@ export default class QuickProfile extends UplinkMainScreen { } get quickProfileUserVolumeLabel() { - return this.instance.$(SELECTORS.QUICK_PROFILE_USER_VOLUME_LABEL); + return SELECTORS.QUICK_PROFILE_USER_VOLUME_LABEL; } get quickProfileUserVolumeLabelText() { @@ -180,7 +180,7 @@ export default class QuickProfile extends UplinkMainScreen { } get quickProfileUserVolumeRange() { - return this.instance.$(SELECTORS.QUICK_PROFILE_USER_VOLUME_RANGE); + return SELECTORS.QUICK_PROFILE_USER_VOLUME_RANGE; } get quickProfileUserVolumeRangeInput() { diff --git a/tests/screenobjects/chats/ReplyPrompt.ts b/tests/screenobjects/chats/ReplyPrompt.ts index cbb6121a6ee..c1ccbdfdc33 100644 --- a/tests/screenobjects/chats/ReplyPrompt.ts +++ b/tests/screenobjects/chats/ReplyPrompt.ts @@ -54,7 +54,7 @@ export default class ReplyPrompt extends UplinkMainScreen { } get replyPopUp() { - return this.instance.$(SELECTORS.REPLY_POPUP); + return SELECTORS.REPLY_POPUP; } get replyPopUpCloseButton() { diff --git a/tests/screenobjects/chats/SendFiles.ts b/tests/screenobjects/chats/SendFiles.ts index 87cf5d879c1..61f1fdfdd12 100644 --- a/tests/screenobjects/chats/SendFiles.ts +++ b/tests/screenobjects/chats/SendFiles.ts @@ -81,23 +81,23 @@ export default class SendFiles extends UplinkMainScreen { } get closeButtonModal() { - return this.instance.$(SELECTORS.CLOSE_BUTTON_MODAL); + return SELECTORS.CLOSE_BUTTON_MODAL; } get contextMenu() { - return this.instance.$(SELECTORS.CONTEXT_MENU); + return SELECTORS.CONTEXT_MENU; } get contextMenuFilesRename() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FILES_RENAME); + return SELECTORS.CONTEXT_MENU_FILES_RENAME; } get contextMenuFolderDelete() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FOLDER_DELETE); + return SELECTORS.CONTEXT_MENU_FOLDER_DELETE; } get contextMenuFolderRename() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FOLDER_RENAME); + return SELECTORS.CONTEXT_MENU_FOLDER_RENAME; } get fileFolderNameText() { @@ -145,11 +145,11 @@ export default class SendFiles extends UplinkMainScreen { } get inputFileName() { - return this.instance.$(SELECTORS.INPUT_FILE_NAME); + return SELECTORS.INPUT_FILE_NAME; } get inputFolderName() { - return this.instance.$(SELECTORS.INPUT_FOLDER_NAME); + return SELECTORS.INPUT_FOLDER_NAME; } get noFilesAvailable() { @@ -161,7 +161,7 @@ export default class SendFiles extends UplinkMainScreen { } get sendFilesLayout() { - return this.instance.$(SELECTORS.SEND_FILES_LAYOUT); + return SELECTORS.SEND_FILES_LAYOUT; } get sendFilesModalSendButton() { @@ -183,7 +183,7 @@ export default class SendFiles extends UplinkMainScreen { async clickOnFolder(locator: string) { const folderLocator = await this.getLocatorOfFolderFile(locator); - const folderElement = await this.instance.$(folderLocator); + const folderElement = await this.$(folderLocator); await folderElement.click(); } @@ -280,7 +280,7 @@ export default class SendFiles extends UplinkMainScreen { await inputFileName.waitForExist(); await inputFileName.setValue(newName); const newFile = await this.getLocatorOfFolderFile(newName + extension); - const newFileElement = await this.instance.$(newFile); + const newFileElement = await this.$(newFile); await newFileElement.waitForExist(); } @@ -289,19 +289,19 @@ export default class SendFiles extends UplinkMainScreen { await inputFolderName.waitForExist(); await inputFolderName.setValue(newName); const newFolder = await this.getLocatorOfFolderFile(newName); - const newFolderElement = await this.instance.$(newFolder); + const newFolderElement = await this.$(newFolder); await newFolderElement.waitForExist(); } async validateFileOrFolderExist(locator: string) { const fileFolderElementLocator = await this.getLocatorOfFolderFile(locator); - const fileFolderElement = await this.instance.$(fileFolderElementLocator); + const fileFolderElement = await this.$(fileFolderElementLocator); await fileFolderElement.waitForExist(); } async validateFileOrFolderNotExist(locator: string) { const fileFolderLocator = await this.getLocatorOfDeletedElement(locator); - await this.instance.$(fileFolderLocator).waitForExist({ reverse: true }); + await this.$(fileFolderLocator).waitForExist({ reverse: true }); } async validateNoFilesAvailableIsShown() { @@ -326,7 +326,7 @@ export default class SendFiles extends UplinkMainScreen { async validateThumbnailIsShown(name: string) { const fileElementLocator = await this.getLocatorOfFolderFile(name); - const fileElement = await this.instance.$(fileElementLocator); + const fileElement = await this.$(fileElementLocator); const fileThumbnail = await fileElement.$(SELECTORS.FILE_THUMBNAIL); await fileThumbnail.waitForExist(); } diff --git a/tests/screenobjects/chats/ShareDid.ts b/tests/screenobjects/chats/ShareDid.ts index bc4bd1f32a5..695eeaf6152 100644 --- a/tests/screenobjects/chats/ShareDid.ts +++ b/tests/screenobjects/chats/ShareDid.ts @@ -53,7 +53,7 @@ export default class ShareDidModal extends UplinkMainScreen { } get shareDidModal() { - return this.instance.$(SELECTORS.SHARE_DID_MODAL); + return SELECTORS.SHARE_DID_MODAL; } get shareDidModalButton() { diff --git a/tests/screenobjects/chats/SidebarSearch.ts b/tests/screenobjects/chats/SidebarSearch.ts index 957fba4172b..7edbcf9ad6e 100644 --- a/tests/screenobjects/chats/SidebarSearch.ts +++ b/tests/screenobjects/chats/SidebarSearch.ts @@ -78,7 +78,7 @@ export default class SidebarSearch extends UplinkMainScreen { } get sidebarResultDropdownName() { - return this.instance.$$(SELECTORS.SIDEBAR_RESULT_DROPDOWN_NAME); + return$(SELECTORS.SIDEBAR_RESULT_DROPDOWN_NAME); } get sidebarResultHighlightedTypedChars() { @@ -108,11 +108,11 @@ export default class SidebarSearch extends UplinkMainScreen { } get sidebarSearchContainerResults() { - return this.instance.$(SELECTORS.SIDEBAR_SEARCH_CONTAINER_RESULTS); + return SELECTORS.SIDEBAR_SEARCH_CONTAINER_RESULTS; } get sidebarSearchGroupResult() { - return this.instance.$$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT); + return$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT); } get sidebarSearchGroupIndicator() { @@ -188,7 +188,7 @@ export default class SidebarSearch extends UplinkMainScreen { } get sidebarSearchHeader() { - return this.instance.$$(SELECTORS.SIDEBAR_SEARCH_HEADER); + return$(SELECTORS.SIDEBAR_SEARCH_HEADER); } get sidebarSearchHeaderText() { @@ -198,7 +198,7 @@ export default class SidebarSearch extends UplinkMainScreen { } get sidebarSearchMembersLabel() { - return this.instance.$$(SELECTORS.SIDEBAR_SEARCH_MEMBERS_LABEL); + return$(SELECTORS.SIDEBAR_SEARCH_MEMBERS_LABEL); } get sidebarSearchMembersLabelText() { return this.instance @@ -207,9 +207,7 @@ export default class SidebarSearch extends UplinkMainScreen { } get sidebarSearchParticipantInGroupResult() { - return this.instance.$$( - SELECTORS.SIDEBAR_SEARCH_PARTICIPANT_IN_GROUP_RESULT, - ); + return$(SELECTORS.SIDEBAR_SEARCH_PARTICIPANT_IN_GROUP_RESULT); } get sidebarSearchParticipantInGroupIndicator() { @@ -258,7 +256,7 @@ export default class SidebarSearch extends UplinkMainScreen { } get sidebarSearchUserResult() { - return this.instance.$$(SELECTORS.SIDEBAR_SEARCH_USER_RESULT); + return$(SELECTORS.SIDEBAR_SEARCH_USER_RESULT); } get sidebarSearchUserResultIndicator() { @@ -326,7 +324,7 @@ export default class SidebarSearch extends UplinkMainScreen { } async getSidebarSearchResultsGroupsNotMatchingName() { - const list = await this.instance.$$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT); + const list = await this.$$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT); let results = []; for (let item of list) { const result = await item @@ -339,7 +337,7 @@ export default class SidebarSearch extends UplinkMainScreen { } async getSidebarSearchResultsGroupsMatchingName() { - const list = await this.instance.$$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT); + const list = await this.$$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT); let results = []; for (let item of list) { const resultHighlighted = await item @@ -358,7 +356,7 @@ export default class SidebarSearch extends UplinkMainScreen { } async getSidebarSearchResultsUsers() { - const list = await this.instance.$$(SELECTORS.SIDEBAR_SEARCH_USER_RESULT); + const list = await this.$$(SELECTORS.SIDEBAR_SEARCH_USER_RESULT); let results = []; for (let item of list) { const resultHighlighted = await item @@ -377,7 +375,7 @@ export default class SidebarSearch extends UplinkMainScreen { } async getSidebarSearchResultsParticipantsInGroups() { - const list = await this.instance.$$( + const list = await this.$$( SELECTORS.SIDEBAR_SEARCH_PARTICIPANT_IN_GROUP_RESULT, ); let results = []; @@ -398,23 +396,19 @@ export default class SidebarSearch extends UplinkMainScreen { } async getSidebarSearchGroupResultLocator(result: number) { - let element = await this.instance.$$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT)[ - result - ]; + let element = await this.$$(SELECTORS.SIDEBAR_SEARCH_GROUP_RESULT)[result]; return element; } async getSidebarSearchParticipantInGroupResultLocator(result: number) { - let element = await this.instance.$$( + let element = await this.$$( SELECTORS.SIDEBAR_SEARCH_PARTICIPANT_IN_GROUP_RESULT, )[result]; return element; } async getSidebarSearchUserResultLocator(result: number) { - let element = await this.instance.$$(SELECTORS.SIDEBAR_SEARCH_USER_RESULT)[ - result - ]; + let element = await this.$$(SELECTORS.SIDEBAR_SEARCH_USER_RESULT)[result]; return element; } } diff --git a/tests/screenobjects/chats/Topbar.ts b/tests/screenobjects/chats/Topbar.ts index 689c178d862..46420f41cde 100644 --- a/tests/screenobjects/chats/Topbar.ts +++ b/tests/screenobjects/chats/Topbar.ts @@ -69,7 +69,7 @@ export default class Topbar extends UplinkMainScreen { } get topbar() { - return this.instance.$(SELECTORS.TOPBAR); + return SELECTORS.TOPBAR; } get topbarAddToFavorites() { @@ -79,7 +79,7 @@ export default class Topbar extends UplinkMainScreen { } get topbarAddToFavoritesTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get topbarAddToFavoritesTooltipText() { @@ -90,11 +90,11 @@ export default class Topbar extends UplinkMainScreen { } get topbarCall() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOPBAR_CALL); + return SELECTORS.TOPBAR.$(SELECTORS.TOPBAR_CALL); } get topbarCallTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get topbarCallTooltipText() { @@ -105,11 +105,11 @@ export default class Topbar extends UplinkMainScreen { } get topbarEditGroup() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOPBAR_EDIT_GROUP); + return SELECTORS.TOPBAR.$(SELECTORS.TOPBAR_EDIT_GROUP); } get topbarEditGroupTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get topbarEditGroupTooltipText() { @@ -120,7 +120,7 @@ export default class Topbar extends UplinkMainScreen { } get topbarIndicator() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOPBAR_INDICATOR); + return SELECTORS.TOPBAR.$(SELECTORS.TOPBAR_INDICATOR); } get topbarIndicatorOffline() { @@ -142,7 +142,7 @@ export default class Topbar extends UplinkMainScreen { } get topbarPinnedMessagesTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get topbarPinnedMessagesTooltipText() { @@ -159,7 +159,7 @@ export default class Topbar extends UplinkMainScreen { } get topbarUserImage() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOPBAR_USER_IMAGE); + return SELECTORS.TOPBAR.$(SELECTORS.TOPBAR_USER_IMAGE); } get topbarUserImageProfile() { @@ -175,11 +175,11 @@ export default class Topbar extends UplinkMainScreen { } get topbarUserInfo() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOPBAR_USER_INFO); + return SELECTORS.TOPBAR.$(SELECTORS.TOPBAR_USER_INFO); } get topbarUserName() { - return this.instance.$(SELECTORS.TOPBAR_USER_NAME); + return SELECTORS.TOPBAR_USER_NAME; } get topbarUserNameValue() { @@ -189,7 +189,7 @@ export default class Topbar extends UplinkMainScreen { } get topbarUserStatus() { - return this.instance.$(SELECTORS.TOPBAR_USER_STATUS); + return SELECTORS.TOPBAR_USER_STATUS; } get topbarUserStatusValue() { @@ -199,11 +199,11 @@ export default class Topbar extends UplinkMainScreen { } get topbarVideocall() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOPBAR_VIDEOCALL); + return SELECTORS.TOPBAR.$(SELECTORS.TOPBAR_VIDEOCALL); } get topbarVideocallTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get topbarVideocallTooltipText() { @@ -214,7 +214,7 @@ export default class Topbar extends UplinkMainScreen { } get viewGroupTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get viewGroupTooltipText() { diff --git a/tests/screenobjects/files/FilesScreen.ts b/tests/screenobjects/files/FilesScreen.ts index 7d83631c0b3..60adb80fb2b 100644 --- a/tests/screenobjects/files/FilesScreen.ts +++ b/tests/screenobjects/files/FilesScreen.ts @@ -127,11 +127,11 @@ export default class FilesScreen extends UplinkMainScreen { } get addFolderButton() { - return this.instance.$(SELECTORS.ADD_FOLDER_BUTTON); + return SELECTORS.ADD_FOLDER_BUTTON; } get addFolderTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get addFolderTooltipText() { @@ -142,63 +142,63 @@ export default class FilesScreen extends UplinkMainScreen { } get contextMenu() { - return this.instance.$(SELECTORS.CONTEXT_MENU); + return SELECTORS.CONTEXT_MENU; } get contextMenuFilesDelete() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FILES_DELETE); + return SELECTORS.CONTEXT_MENU_FILES_DELETE; } get contextMenuFilesDownload() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FILES_DOWNLOAD); + return SELECTORS.CONTEXT_MENU_FILES_DOWNLOAD; } get contextMenuFilesRename() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FILES_RENAME); + return SELECTORS.CONTEXT_MENU_FILES_RENAME; } get contextMenuFilesShare() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FILES_SHARE); + return SELECTORS.CONTEXT_MENU_FILES_SHARE; } get contextMenuFolderDelete() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FOLDER_DELETE); + return SELECTORS.CONTEXT_MENU_FOLDER_DELETE; } get contextMenuFolderRename() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FOLDER_RENAME); + return SELECTORS.CONTEXT_MENU_FOLDER_RENAME; } get crumb() { - return this.instance.$$(SELECTORS.CRUMB); + return$(SELECTORS.CRUMB); } get crumbHomeDir() { - return this.instance.$(SELECTORS.CRUMB_HOME_FOLDER); + return SELECTORS.CRUMB_HOME_FOLDER; } get crumbText() { - return this.instance.$$(SELECTORS.CRUMB).$(SELECTORS.CRUMB_TEXT); + return$(SELECTORS.CRUMB).$(SELECTORS.CRUMB_TEXT); } get fileFolderNameText() { - return this.instance.$(SELECTORS.FILE_FOLDER_NAME_TEXT); + return SELECTORS.FILE_FOLDER_NAME_TEXT; } get filesBody() { - return this.instance.$(SELECTORS.FILES_BODY); + return SELECTORS.FILES_BODY; } get filesBreadcrumbs() { - return this.instance.$(SELECTORS.FILES_BREADCRUMBS); + return SELECTORS.FILES_BREADCRUMBS; } get filesInfo() { - return this.instance.$(SELECTORS.FILES_INFO); + return SELECTORS.FILES_INFO; } get filesInfoCurrentSize() { - return this.instance.$(SELECTORS.FILES_INFO_CURRENT_SIZE); + return SELECTORS.FILES_INFO_CURRENT_SIZE; } get filesInfoCurrentSizeLabel() { @@ -214,7 +214,7 @@ export default class FilesScreen extends UplinkMainScreen { } get filesInfoMaxSize() { - return this.instance.$(SELECTORS.FILES_INFO_MAX_SIZE); + return SELECTORS.FILES_INFO_MAX_SIZE; } get filesInfoMaxSizeLabel() { @@ -230,43 +230,43 @@ export default class FilesScreen extends UplinkMainScreen { } get filesLayout() { - return this.instance.$(SELECTORS.FILES_LAYOUT); + return SELECTORS.FILES_LAYOUT; } get filesList() { - return this.instance.$(SELECTORS.FILES_LIST); + return SELECTORS.FILES_LIST; } get inputError() { - return this.instance.$(SELECTORS.INPUT_ERROR); + return SELECTORS.INPUT_ERROR; } get inputErrorText() { - return this.instance.$(SELECTORS.INPUT_ERROR).$(SELECTORS.INPUT_ERROR_TEXT); + return SELECTORS.INPUT_ERROR.$(SELECTORS.INPUT_ERROR_TEXT); } get inputFileName() { - return this.instance.$(SELECTORS.INPUT_FILE_NAME); + return SELECTORS.INPUT_FILE_NAME; } get inputFolderName() { - return this.instance.$(SELECTORS.INPUT_FOLDER_NAME); + return SELECTORS.INPUT_FOLDER_NAME; } get showSidebar() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.SHOW_SIDEBAR); + return SELECTORS.TOPBAR.$(SELECTORS.SHOW_SIDEBAR); } get topbar() { - return this.instance.$(SELECTORS.TOPBAR); + return SELECTORS.TOPBAR; } get uploadFileButton() { - return this.instance.$(SELECTORS.UPLOAD_FILE_BUTTON); + return SELECTORS.UPLOAD_FILE_BUTTON; } get uploadFileTooltip() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.TOOLTIP); + return SELECTORS.TOPBAR.$(SELECTORS.TOOLTIP); } get uploadFileTooltipText() { @@ -277,15 +277,15 @@ export default class FilesScreen extends UplinkMainScreen { } get uploadFileIndicatorFilename() { - return this.instance.$(SELECTORS.UPLOAD_FILE_INDICATOR_FILENAME); + return SELECTORS.UPLOAD_FILE_INDICATOR_FILENAME; } get uploadFileIndicatorProgress() { - return this.instance.$(SELECTORS.UPLOAD_FILE_INDICATOR_PROGRESS); + return SELECTORS.UPLOAD_FILE_INDICATOR_PROGRESS; } get uploadProgressBar() { - return this.instance.$(SELECTORS.UPLOAD_PROGRESS_BAR); + return SELECTORS.UPLOAD_PROGRESS_BAR; } get uploadProgressBarContentsFilename() { @@ -330,7 +330,7 @@ export default class FilesScreen extends UplinkMainScreen { async clickOnFileOrFolder(locator: string) { const fileOrFolderLocator = await this.getLocatorOfFolderFile(locator); - const fileOrFolderElement = await this.instance.$(fileOrFolderLocator); + const fileOrFolderElement = await this.$(fileOrFolderLocator); await fileOrFolderElement.click(); } @@ -346,7 +346,7 @@ export default class FilesScreen extends UplinkMainScreen { } async clickOnHomeFolderCrumb() { - const homeFolder = await this.instance.$(SELECTORS.CRUMB_HOME_FOLDER); + const homeFolder = await this.$(SELECTORS.CRUMB_HOME_FOLDER); await homeFolder.click(); } @@ -385,7 +385,7 @@ export default class FilesScreen extends UplinkMainScreen { // If name was typed correctly, continue with method execution await filesInfoCurrentSizeLabel.click(); const newFolder = await this.getLocatorOfFolderFile(name); - const newFolderElement = await this.instance.$(newFolder); + const newFolderElement = await this.$(newFolder); await newFolderElement.waitForExist(); } @@ -496,7 +496,7 @@ export default class FilesScreen extends UplinkMainScreen { const filesInfoCurrentSizeLabel = await this.filesInfoCurrentSizeLabel; await filesInfoCurrentSizeLabel.click(); const newFile = await this.getLocatorOfFolderFile(newName + extension); - const newFileElement = await this.instance.$(newFile); + const newFileElement = await this.$(newFile); await newFileElement.waitForExist(); } @@ -507,7 +507,7 @@ export default class FilesScreen extends UplinkMainScreen { const filesInfoCurrentSizeLabel = await this.filesInfoCurrentSizeLabel; await filesInfoCurrentSizeLabel.click(); const newFolder = await this.getLocatorOfFolderFile(newName); - const newFolderElement = await this.instance.$(newFolder); + const newFolderElement = await this.$(newFolder); await newFolderElement.waitForExist(); } @@ -526,13 +526,13 @@ export default class FilesScreen extends UplinkMainScreen { async validateFileOrFolderExist(locator: string, timeout: number = 30000) { const fileFolderElementLocator = await this.getLocatorOfFolderFile(locator); - const fileFolderElement = await this.instance.$(fileFolderElementLocator); + const fileFolderElement = await this.$(fileFolderElementLocator); await fileFolderElement.waitForExist({ timeout: timeout }); } async validateFileOrFolderNotExist(locator: string) { const fileFolderLocator = await this.getLocatorOfDeletedElement(locator); - await this.instance.$(fileFolderLocator).waitForExist({ reverse: true }); + await this.$(fileFolderLocator).waitForExist({ reverse: true }); } async validateFilesScreenIsShown() { diff --git a/tests/screenobjects/friends/FriendsScreen.ts b/tests/screenobjects/friends/FriendsScreen.ts index 33397f4a8ad..dc6acbb5fa6 100644 --- a/tests/screenobjects/friends/FriendsScreen.ts +++ b/tests/screenobjects/friends/FriendsScreen.ts @@ -153,27 +153,27 @@ export default class FriendsScreen extends UplinkMainScreen { } get acceptFriendRequestButton() { - return this.instance.$(SELECTORS.ACCEPT_FRIEND_REQUEST_BUTTON); + return SELECTORS.ACCEPT_FRIEND_REQUEST_BUTTON; } get addSomeoneButton() { - return this.instance.$(SELECTORS.ADD_SOMEONE_BUTTON); + return SELECTORS.ADD_SOMEONE_BUTTON; } get addSomeoneInput() { - return this.instance.$(SELECTORS.ADD_SOMEONE_INPUT); + return SELECTORS.ADD_SOMEONE_INPUT; } get addSomeoneLabel() { - return this.instance.$(SELECTORS.ADD_SOMEONE_LABEL); + return SELECTORS.ADD_SOMEONE_LABEL; } get allFriendsButton() { - return this.instance.$(SELECTORS.ALL_FRIENDS_BUTTON); + return SELECTORS.ALL_FRIENDS_BUTTON; } get allFriendsFriends() { - return this.instance.$(SELECTORS.FRIENDS_LIST).$$(SELECTORS.FRIEND); + return SELECTORS.FRIENDS_LIST.$$(SELECTORS.FRIEND); } get allFriendsFriendsImages() { @@ -197,79 +197,79 @@ export default class FriendsScreen extends UplinkMainScreen { } get blockFriendButton() { - return this.instance.$(SELECTORS.BLOCK_FRIEND_BUTTON); + return SELECTORS.BLOCK_FRIEND_BUTTON; } get blockedListButton() { - return this.instance.$(SELECTORS.BLOCKED_LIST_BUTTON); + return SELECTORS.BLOCKED_LIST_BUTTON; } get blockedList() { - return this.instance.$(SELECTORS.BLOCKED_LIST); + return SELECTORS.BLOCKED_LIST; } get blockedListLabel() { - return this.instance.$(SELECTORS.BLOCKED_LIST_LABEL); + return SELECTORS.BLOCKED_LIST_LABEL; } get chatWithFriendButton() { - return this.instance.$(SELECTORS.CHAT_WITH_FRIEND_BUTTON); + return SELECTORS.CHAT_WITH_FRIEND_BUTTON; } get contextMenu() { - return this.instance.$(SELECTORS.CONTEXT_MENU); + return SELECTORS.CONTEXT_MENU; } get contextMenuBlock() { - return this.instance.$(SELECTORS.CONTEXT_MENU_BLOCK); + return SELECTORS.CONTEXT_MENU_BLOCK; } get contextMenuChat() { - return this.instance.$(SELECTORS.CONTEXT_MENU_CHAT); + return SELECTORS.CONTEXT_MENU_CHAT; } get contextMenuCopyDidKey() { - return this.instance.$(SELECTORS.CONTEXT_MENU_COPY_DID_KEY); + return SELECTORS.CONTEXT_MENU_COPY_DID_KEY; } get contextMenuCopyId() { - return this.instance.$(SELECTORS.CONTEXT_MENU_COPY_ID); + return SELECTORS.CONTEXT_MENU_COPY_ID; } get contextMenuFavoritesAdd() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FAVORITES_ADD); + return SELECTORS.CONTEXT_MENU_FAVORITES_ADD; } get contextMenuFavoritesRemove() { - return this.instance.$(SELECTORS.CONTEXT_MENU_FAVORITES_REMOVE); + return SELECTORS.CONTEXT_MENU_FAVORITES_REMOVE; } get contextMenuIncomingAccept() { - return this.instance.$(SELECTORS.CONTEXT_MENU_INCOMING_ACCEPT); + return SELECTORS.CONTEXT_MENU_INCOMING_ACCEPT; } get contextMenuIncomingDeny() { - return this.instance.$(SELECTORS.CONTEXT_MENU_INCOMING_DENY); + return SELECTORS.CONTEXT_MENU_INCOMING_DENY; } get contextMenuOutgoingCancel() { - return this.instance.$(SELECTORS.CONTEXT_MENU_OUTGOING_CANCEL); + return SELECTORS.CONTEXT_MENU_OUTGOING_CANCEL; } get contextMenuRemove() { - return this.instance.$(SELECTORS.CONTEXT_MENU_REMOVE); + return SELECTORS.CONTEXT_MENU_REMOVE; } get contextMenuUnblock() { - return this.instance.$(SELECTORS.CONTEXT_MENU_UNBLOCK); + return SELECTORS.CONTEXT_MENU_UNBLOCK; } get copyIdButton() { - return this.instance.$(SELECTORS.FRIENDS_BODY).$(SELECTORS.COPY_ID_BUTTON); + return SELECTORS.FRIENDS_BODY.$(SELECTORS.COPY_ID_BUTTON); } get friendInfo() { - return this.instance.$(SELECTORS.FRIEND_INFO); + return SELECTORS.FRIEND_INFO; } get friendInfoCurrentStatus() { @@ -285,7 +285,7 @@ export default class FriendsScreen extends UplinkMainScreen { } get friendInfoUsername() { - return this.instance.$$(SELECTORS.FRIEND_INFO_USERNAME); + return$(SELECTORS.FRIEND_INFO_USERNAME); } get friendInfoUsernameCode() { @@ -301,15 +301,15 @@ export default class FriendsScreen extends UplinkMainScreen { } get friendRecords() { - return this.instance.$$(SELECTORS.FRIEND_RECORD); + return$(SELECTORS.FRIEND_RECORD); } get friendsBody() { - return this.instance.$(SELECTORS.FRIENDS_BODY); + return SELECTORS.FRIENDS_BODY; } get friendsButtonBadge() { - return this.instance.$(SELECTORS.TOPBAR).$(SELECTORS.FRIENDS_BUTTON_BADGE); + return SELECTORS.TOPBAR.$(SELECTORS.FRIENDS_BUTTON_BADGE); } get friendsButtonBadgeText() { @@ -320,35 +320,35 @@ export default class FriendsScreen extends UplinkMainScreen { } get friendsControls() { - return this.instance.$(SELECTORS.FRIENDS_CONTROLS); + return SELECTORS.FRIENDS_CONTROLS; } get friendsLayout() { - return this.instance.$(SELECTORS.FRIENDS_LAYOUT); + return SELECTORS.FRIENDS_LAYOUT; } get friendsList() { - return this.instance.$(SELECTORS.FRIENDS_LIST); + return SELECTORS.FRIENDS_LIST; } get friendsListLabel() { - return this.instance.$(SELECTORS.FRIENDS_LIST_LABEL); + return SELECTORS.FRIENDS_LIST_LABEL; } get incomingRequestsList() { - return this.instance.$(SELECTORS.INCOMING_REQUESTS_LIST); + return SELECTORS.INCOMING_REQUESTS_LIST; } get incomingRequestsListLabel() { - return this.instance.$(SELECTORS.INCOMING_REQUESTS_LIST_LABEL); + return SELECTORS.INCOMING_REQUESTS_LIST_LABEL; } get inputError() { - return this.instance.$(SELECTORS.INPUT_ERROR); + return SELECTORS.INPUT_ERROR; } get inputErrorText() { - return this.instance.$(SELECTORS.INPUT_ERROR).$(SELECTORS.INPUT_ERROR_TEXT); + return SELECTORS.INPUT_ERROR.$(SELECTORS.INPUT_ERROR_TEXT); } get noRequests() { @@ -360,23 +360,23 @@ export default class FriendsScreen extends UplinkMainScreen { } get outgoingRequestsList() { - return this.instance.$(SELECTORS.OUTGOING_REQUESTS_LIST); + return SELECTORS.OUTGOING_REQUESTS_LIST; } get outgoingRequestsListLabel() { - return this.instance.$(SELECTORS.OUTGOING_REQUESTS_LIST_LABEL); + return SELECTORS.OUTGOING_REQUESTS_LIST_LABEL; } get pendingFriendsButton() { - return this.instance.$(SELECTORS.PENDING_FRIENDS_BUTTON); + return SELECTORS.PENDING_FRIENDS_BUTTON; } get removeOrDenyFriendButton() { - return this.instance.$(SELECTORS.REMOVE_OR_DENY_FRIEND_BUTTON); + return SELECTORS.REMOVE_OR_DENY_FRIEND_BUTTON; } get topbar() { - return this.instance.$(SELECTORS.TOPBAR); + return SELECTORS.TOPBAR; } async acceptIncomingRequest(name: string) { @@ -460,7 +460,7 @@ export default class FriendsScreen extends UplinkMainScreen { async getAllFriendsList() { const friendsList = await this.friendsList; await friendsList.waitForExist(); - const friends = await this.instance.$$(SELECTORS.FRIEND_INFO_USERNAME); + const friends = await this.$$(SELECTORS.FRIEND_INFO_USERNAME); let results = []; for (let friend of friends) { const friendName = await friend.$(SELECTORS.FRIEND_INFO_USERNAME_NAME); @@ -473,7 +473,7 @@ export default class FriendsScreen extends UplinkMainScreen { async getBlockedList() { const blockedList = await this.blockedList; await blockedList.waitForExist(); - const friends = await this.instance.$$(SELECTORS.FRIEND_INFO_USERNAME); + const friends = await this.$$(SELECTORS.FRIEND_INFO_USERNAME); let results = []; for (let friend of friends) { const friendName = await friend.$(SELECTORS.FRIEND_INFO_USERNAME_NAME); @@ -487,7 +487,7 @@ export default class FriendsScreen extends UplinkMainScreen { const currentDriver = await this.getCurrentDriver(); let locator; if (currentDriver === MACOS_DRIVER) { - locator = await this.instance.$(SELECTORS.FRIENDS_BODY).$("~" + username); + locator = await this.$(SELECTORS.FRIENDS_BODY).$("~" + username); } else if (currentDriver === WINDOWS_DRIVER) { locator = await this.instance .$(SELECTORS.FRIENDS_BODY) diff --git a/tests/screenobjects/settings/CropToolProfileModal.ts b/tests/screenobjects/settings/CropToolProfileModal.ts index 6f7bb0ccdef..0b4ed5b7699 100644 --- a/tests/screenobjects/settings/CropToolProfileModal.ts +++ b/tests/screenobjects/settings/CropToolProfileModal.ts @@ -55,7 +55,7 @@ export default class CropImageProfileModal extends UplinkMainScreen { // Getters from UI Locators get cropImageModal() { - return this.instance.$(SELECTORS.CROP_IMAGE_MODAL); + return SELECTORS.CROP_IMAGE_MODAL; } get cropImagePreview() { diff --git a/tests/screenobjects/settings/SettingsAboutScreen.ts b/tests/screenobjects/settings/SettingsAboutScreen.ts index f1d46861716..3acdbc2276f 100644 --- a/tests/screenobjects/settings/SettingsAboutScreen.ts +++ b/tests/screenobjects/settings/SettingsAboutScreen.ts @@ -66,11 +66,11 @@ export default class SettingsAboutScreen extends SettingsBaseScreen { } get checkForUpdatesButton() { - return this.instance.$(SELECTORS.CHECK_FOR_UPDATES_BUTTON); + return SELECTORS.CHECK_FOR_UPDATES_BUTTON; } get openSourceCodeButton() { - return this.instance.$(SELECTORS.OPEN_SOURCE_CODE_BUTTON); + return SELECTORS.OPEN_SOURCE_CODE_BUTTON; } get openSourceDescription() { @@ -88,7 +88,7 @@ export default class SettingsAboutScreen extends SettingsBaseScreen { } get openWebsiteButton() { - return this.instance.$(SELECTORS.OPEN_WEBSITE_BUTTON); + return SELECTORS.OPEN_WEBSITE_BUTTON; } get openWebsiteDescription() { diff --git a/tests/screenobjects/settings/SettingsAccessibilityScreen.ts b/tests/screenobjects/settings/SettingsAccessibilityScreen.ts index 54f51cc44d9..7e7fab67fa3 100644 --- a/tests/screenobjects/settings/SettingsAccessibilityScreen.ts +++ b/tests/screenobjects/settings/SettingsAccessibilityScreen.ts @@ -71,7 +71,7 @@ export default class SettingsAccessibilityScreen extends SettingsBaseScreen { } get settingsAccessibility() { - return this.instance.$(SELECTORS.SETTINGS_ACCESSIBILITY); + return SELECTORS.SETTINGS_ACCESSIBILITY; } async clickOnOpenDyslexic() { diff --git a/tests/screenobjects/settings/SettingsAudioScreen.ts b/tests/screenobjects/settings/SettingsAudioScreen.ts index 868d407ed6f..a280ed1cf6c 100644 --- a/tests/screenobjects/settings/SettingsAudioScreen.ts +++ b/tests/screenobjects/settings/SettingsAudioScreen.ts @@ -240,7 +240,7 @@ export default class SettingsAudioScreen extends SettingsBaseScreen { } get settingsAudio() { - return this.instance.$(SELECTORS.SETTINGS_AUDIO); + return SELECTORS.SETTINGS_AUDIO; } // Click on dropdowns and sliders methods diff --git a/tests/screenobjects/settings/SettingsBaseScreen.ts b/tests/screenobjects/settings/SettingsBaseScreen.ts index 1c66bc8c007..3e042acbe64 100644 --- a/tests/screenobjects/settings/SettingsBaseScreen.ts +++ b/tests/screenobjects/settings/SettingsBaseScreen.ts @@ -61,57 +61,57 @@ export default class SettingsBaseScreen extends UplinkMainScreen { } async waitForIsShown(isShown = true): Promise { - return this.instance.$(SELECTORS.SETTINGS_LAYOUT).waitForDisplayed({ + return SELECTORS.SETTINGS_LAYOUT.waitForDisplayed({ reverse: !isShown, }); } get aboutButton() { - return this.instance.$(SELECTORS.ABOUT_BUTTON); + return SELECTORS.ABOUT_BUTTON; } get accessibilityButton() { - return this.instance.$(SELECTORS.ACCESSIBILITY_BUTTON); + return SELECTORS.ACCESSIBILITY_BUTTON; } get audioButton() { - return this.instance.$(SELECTORS.AUDIO_BUTTON); + return SELECTORS.AUDIO_BUTTON; } get developerButton() { - return this.instance.$(SELECTORS.DEVELOPER_BUTTON); + return SELECTORS.DEVELOPER_BUTTON; } get extensionsButton() { - return this.instance.$(SELECTORS.EXTENSIONS_BUTTON); + return SELECTORS.EXTENSIONS_BUTTON; } get generalButton() { - return this.instance.$(SELECTORS.GENERAL_BUTTON); + return SELECTORS.GENERAL_BUTTON; } get licensesButton() { - return this.instance.$(SELECTORS.LICENSES_BUTTON); + return SELECTORS.LICENSES_BUTTON; } get messagesButton() { - return this.instance.$(SELECTORS.MESSAGES_BUTTON); + return SELECTORS.MESSAGES_BUTTON; } get notificationsButton() { - return this.instance.$(SELECTORS.NOTIFICATIONS_BUTTON); + return SELECTORS.NOTIFICATIONS_BUTTON; } get profileButton() { - return this.instance.$(SELECTORS.PROFILE_BUTTON); + return SELECTORS.PROFILE_BUTTON; } get settingsLayout() { - return this.instance.$(SELECTORS.SETTINGS_LAYOUT); + return SELECTORS.SETTINGS_LAYOUT; } get settingsSearchInput() { - return this.instance.$(SELECTORS.SETTINGS_SEARCH_INPUT); + return SELECTORS.SETTINGS_SEARCH_INPUT; } async goToAboutSettings() { diff --git a/tests/screenobjects/settings/SettingsDeveloperScreen.ts b/tests/screenobjects/settings/SettingsDeveloperScreen.ts index 932a9d11eee..bb442453cd1 100644 --- a/tests/screenobjects/settings/SettingsDeveloperScreen.ts +++ b/tests/screenobjects/settings/SettingsDeveloperScreen.ts @@ -56,7 +56,7 @@ export default class SettingsDeveloperScreen extends SettingsBaseScreen { } get clearCacheButton() { - return this.instance.$(SELECTORS.CLEAR_CACHE_BUTTON); + return SELECTORS.CLEAR_CACHE_BUTTON; } get clearCacheDescription() { @@ -74,7 +74,7 @@ export default class SettingsDeveloperScreen extends SettingsBaseScreen { } get compressAndDownloadCacheButton() { - return this.instance.$(SELECTORS.COMPRESS_BUTTON); + return SELECTORS.COMPRESS_BUTTON; } get compressAndDownloadCacheDescription() { @@ -144,7 +144,7 @@ export default class SettingsDeveloperScreen extends SettingsBaseScreen { } get openCacheButton() { - return this.instance.$(SELECTORS.OPEN_CACHE_FOLDER_BUTTON); + return SELECTORS.OPEN_CACHE_FOLDER_BUTTON; } get openCacheDescription() { @@ -162,7 +162,7 @@ export default class SettingsDeveloperScreen extends SettingsBaseScreen { } get printStateButton() { - return this.instance.$(SELECTORS.PRINT_STATE_BUTTON); + return SELECTORS.PRINT_STATE_BUTTON; } get printStateDescription() { @@ -206,11 +206,11 @@ export default class SettingsDeveloperScreen extends SettingsBaseScreen { } get settingsDeveloper() { - return this.instance.$(SELECTORS.SETTINGS_DEVELOPER); + return SELECTORS.SETTINGS_DEVELOPER; } get testNotificationButton() { - return this.instance.$(SELECTORS.TEST_NOTIFICATIONS_BUTTON); + return SELECTORS.TEST_NOTIFICATIONS_BUTTON; } get testNotificationDescription() { diff --git a/tests/screenobjects/settings/SettingsExtensionsScreen.ts b/tests/screenobjects/settings/SettingsExtensionsScreen.ts index 01f064a2fc2..98ec3088713 100644 --- a/tests/screenobjects/settings/SettingsExtensionsScreen.ts +++ b/tests/screenobjects/settings/SettingsExtensionsScreen.ts @@ -141,27 +141,27 @@ export default class SettingsExtensionsScreen extends SettingsBaseScreen { } get exploreButton() { - return this.instance.$(SELECTORS.EXPLORE_BUTTON); + return SELECTORS.EXPLORE_BUTTON; } get extensionsBrowser() { - return this.instance.$(SELECTORS.EXTENSIONS_BROWSER); + return SELECTORS.EXTENSIONS_BROWSER; } get extensionsExplore() { - return this.instance.$(SELECTORS.EXTENSIONS_EXPLORE_SECTION); + return SELECTORS.EXTENSIONS_EXPLORE_SECTION; } get extensionsExploreBanner() { - return this.instance.$(SELECTORS.EXTENSIONS_EXPLORE_BANNER); + return SELECTORS.EXTENSIONS_EXPLORE_BANNER; } get extensionsSearchHeader() { - return this.instance.$(SELECTORS.EXTENSIONS_SEARCH_HEADER); + return SELECTORS.EXTENSIONS_SEARCH_HEADER; } get extensionsSearchInput() { - return this.instance.$(SELECTORS.EXTENSIONS_SEARCH_INPUT); + return SELECTORS.EXTENSIONS_SEARCH_INPUT; } get extensionsSettingsButton() { @@ -177,7 +177,7 @@ export default class SettingsExtensionsScreen extends SettingsBaseScreen { } get installedButton() { - return this.instance.$(SELECTORS.INSTALLED_BUTTON); + return SELECTORS.INSTALLED_BUTTON; } get openExtensionsDescriptionText() { @@ -195,11 +195,11 @@ export default class SettingsExtensionsScreen extends SettingsBaseScreen { } get openExtensionsFolderButton() { - return this.instance.$(SELECTORS.OPEN_EXTENSIONS_FOLDER_BUTTON); + return SELECTORS.OPEN_EXTENSIONS_FOLDER_BUTTON; } get settingsExtensions() { - return this.instance.$(SELECTORS.SETTINGS_EXTENSIONS); + return SELECTORS.SETTINGS_EXTENSIONS; } async clickOnEmojiSelectorCheckbox() { diff --git a/tests/screenobjects/settings/SettingsGeneralScreen.ts b/tests/screenobjects/settings/SettingsGeneralScreen.ts index d90ae61d24d..1ee1ac4632a 100644 --- a/tests/screenobjects/settings/SettingsGeneralScreen.ts +++ b/tests/screenobjects/settings/SettingsGeneralScreen.ts @@ -233,11 +233,11 @@ export default class SettingsGeneralScreen extends SettingsBaseScreen { } get settingsGeneral() { - return this.instance.$(SELECTORS.SETTINGS_GENERAL); + return SELECTORS.SETTINGS_GENERAL; } get settingsGeneralElementTooltip() { - return this.instance.$(SELECTORS.SETTINGS_GENERAL).$(SELECTORS.TOOLTIP); + return SELECTORS.SETTINGS_GENERAL.$(SELECTORS.TOOLTIP); } get settingsGeneralElementTooltipText() { @@ -248,7 +248,7 @@ export default class SettingsGeneralScreen extends SettingsBaseScreen { } get slideSelector() { - return this.instance.$(SELECTORS.SLIDE_SELECTOR); + return SELECTORS.SLIDE_SELECTOR; } get slideSelectorButtonMinus() { diff --git a/tests/screenobjects/settings/SettingsMessagesScreen.ts b/tests/screenobjects/settings/SettingsMessagesScreen.ts index e9a4405cbb2..99069803711 100644 --- a/tests/screenobjects/settings/SettingsMessagesScreen.ts +++ b/tests/screenobjects/settings/SettingsMessagesScreen.ts @@ -97,7 +97,7 @@ export default class SettingsMessagesScreen extends SettingsBaseScreen { } get settingsMessages() { - return this.instance.$(SELECTORS.SETTINGS_MESSAGES); + return SELECTORS.SETTINGS_MESSAGES; } async clickOnConvertEmoji() { diff --git a/tests/screenobjects/settings/SettingsNotificationsScreen.ts b/tests/screenobjects/settings/SettingsNotificationsScreen.ts index fb4bb780167..54e403a0c00 100644 --- a/tests/screenobjects/settings/SettingsNotificationsScreen.ts +++ b/tests/screenobjects/settings/SettingsNotificationsScreen.ts @@ -149,7 +149,7 @@ export default class SettingsNotificationsScreen extends SettingsBaseScreen { } get settingsNotifications() { - return this.instance.$(SELECTORS.SETTINGS_NOTIFICATIONS); + return SELECTORS.SETTINGS_NOTIFICATIONS; } async clickOnEnabledNotifications() { diff --git a/tests/screenobjects/settings/SettingsProfileScreen.ts b/tests/screenobjects/settings/SettingsProfileScreen.ts index c2260c48dff..7dbb9266fe7 100644 --- a/tests/screenobjects/settings/SettingsProfileScreen.ts +++ b/tests/screenobjects/settings/SettingsProfileScreen.ts @@ -107,14 +107,14 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get addPictureButton() { - return this.instance.$(SELECTORS.ADD_PICTURE_BUTTON); + return SELECTORS.ADD_PICTURE_BUTTON; } get clearAvatarButton() { - return this.instance.$(SELECTORS.CLEAR_AVATAR_BUTTON); + return SELECTORS.CLEAR_AVATAR_BUTTON; } get clearBannerButton() { - return this.instance.$(SELECTORS.CLEAR_BANNER_BUTTON); + return SELECTORS.CLEAR_BANNER_BUTTON; } get contextMenuProfile() { @@ -122,11 +122,11 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get contextMenuCopyDidKey() { - return this.instance.$(SELECTORS.CONTEXT_MENU_COPY_DID_KEY); + return SELECTORS.CONTEXT_MENU_COPY_DID_KEY; } get contextMenuCopyId() { - return this.instance.$(SELECTORS.CONTEXT_MENU_COPY_ID); + return SELECTORS.CONTEXT_MENU_COPY_ID; } get copyIDButton() { @@ -136,7 +136,7 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get copyIDTooltip() { - return this.instance.$(SELECTORS.PROFILE_CONTENT).$(SELECTORS.TOOLTIP); + return SELECTORS.PROFILE_CONTENT.$(SELECTORS.TOOLTIP); } get copyIDTooltipText() { @@ -147,11 +147,11 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get dismissButton() { - return this.instance.$(SELECTORS.DISMISS_BUTTON); + return SELECTORS.DISMISS_BUTTON; } get inputError() { - return this.instance.$(SELECTORS.INPUT_ERROR); + return SELECTORS.INPUT_ERROR; } get inputErrorMessage() { @@ -161,11 +161,11 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get profileBanner() { - return this.instance.$(SELECTORS.PROFILE_BANNER); + return SELECTORS.PROFILE_BANNER; } get profileBannerClear() { - return this.instance.$(SELECTORS.PROFILE_BANNER_CLEAR); + return SELECTORS.PROFILE_BANNER_CLEAR; } get profileBannerTooltip() { @@ -175,35 +175,35 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get profileContent() { - return this.instance.$(SELECTORS.PROFILE_CONTENT); + return SELECTORS.PROFILE_CONTENT; } get profileHeader() { - return this.instance.$(SELECTORS.PROFILE_HEADER); + return SELECTORS.PROFILE_HEADER; } get profilePicture() { - return this.instance.$(SELECTORS.PROFILE_PICTURE); + return SELECTORS.PROFILE_PICTURE; } get profilePictureClear() { - return this.instance.$(SELECTORS.PROFILE_PICTURE_CLEAR); + return SELECTORS.PROFILE_PICTURE_CLEAR; } get settingsProfile() { - return this.instance.$(SELECTORS.SETTINGS_PROFILE); + return SELECTORS.SETTINGS_PROFILE; } get statusInput() { - return this.instance.$(SELECTORS.STATUS_INPUT); + return SELECTORS.STATUS_INPUT; } get statusLabel() { - return this.instance.$(SELECTORS.PROFILE_CONTENT).$(SELECTORS.STATUS_LABEL); + return SELECTORS.PROFILE_CONTENT.$(SELECTORS.STATUS_LABEL); } get usernameInput() { - return this.instance.$(SELECTORS.USERNAME_INPUT); + return SELECTORS.USERNAME_INPUT; } get usernameLabel() { @@ -213,11 +213,11 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get yourNewProfile() { - return this.instance.$(SELECTORS.YOUR_NEW_PROFILE); + return SELECTORS.YOUR_NEW_PROFILE; } get yourNewProfileDescriptionTextOne() { - return this.instance.$(SELECTORS.YOUR_NEW_PROFILE_DESCRIPTION_TEXT_ONE); + return SELECTORS.YOUR_NEW_PROFILE_DESCRIPTION_TEXT_ONE; } get yourNewProfileDescriptionTextOneValue() { @@ -227,7 +227,7 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get yourNewProfileDescriptionTextTwo() { - return this.instance.$(SELECTORS.YOUR_NEW_PROFILE_DESCRIPTION_TEXT_TWO); + return SELECTORS.YOUR_NEW_PROFILE_DESCRIPTION_TEXT_TWO; } get yourNewProfileDescriptionTextTwoValue() { @@ -237,7 +237,7 @@ export default class SettingsProfileScreen extends SettingsBaseScreen { } get yourNewProfileHeaderText() { - return this.instance.$(SELECTORS.YOUR_NEW_PROFILE_HEADER_TEXT); + return SELECTORS.YOUR_NEW_PROFILE_HEADER_TEXT; } get yourNewProfileHeaderTextValue() { diff --git a/tests/screenobjects/welcome-screen/WelcomeScreen.ts b/tests/screenobjects/welcome-screen/WelcomeScreen.ts index b8645d8f73e..093df3b3d47 100644 --- a/tests/screenobjects/welcome-screen/WelcomeScreen.ts +++ b/tests/screenobjects/welcome-screen/WelcomeScreen.ts @@ -31,7 +31,7 @@ export default class WelcomeScreen extends UplinkMainScreen { } get addFriendsButton() { - return this.instance.$(SELECTORS.ADD_FRIENDS_BUTTON); + return SELECTORS.ADD_FRIENDS_BUTTON; } get addSomeoneText() { @@ -41,11 +41,11 @@ export default class WelcomeScreen extends UplinkMainScreen { } get welcomeImage() { - return this.instance.$(SELECTORS.WELCOME_LAYOUT).$(SELECTORS.WELCOME_IMAGE); + return SELECTORS.WELCOME_LAYOUT.$(SELECTORS.WELCOME_IMAGE); } get welcomeLayout() { - return this.instance.$(SELECTORS.WELCOME_LAYOUT); + return SELECTORS.WELCOME_LAYOUT; } async clickAddSomeone() { diff --git a/tests/specs/01-create-account.spec.ts b/tests/specs/01-create-account.spec.ts index 23632c27cce..d7054f23936 100644 --- a/tests/specs/01-create-account.spec.ts +++ b/tests/specs/01-create-account.spec.ts @@ -4,8 +4,8 @@ import { USER_A_INSTANCE } from "@helpers/constants"; import CreatePinScreen from "@screenobjects/account-creation/CreatePinScreen"; import CreateUserScreen from "@screenobjects/account-creation/CreateUserScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; -const createPinFirstUser = new CreatePinScreen(USER_A_INSTANCE); -const createUserFirstUser = new CreateUserScreen(USER_A_INSTANCE); +const createPinFirstUser = new CreatePinScreen(); +const createUserFirstUser = new CreateUserScreen(); const welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); export default async function createAccount() { diff --git a/tests/specs/02-chats.spec.ts b/tests/specs/02-chats.spec.ts index 090691d05f1..5c092b82471 100644 --- a/tests/specs/02-chats.spec.ts +++ b/tests/specs/02-chats.spec.ts @@ -7,9 +7,9 @@ import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; import { USER_A_INSTANCE } from "@helpers/constants"; const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); -const friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); +const friendsScreenFirstUser = new FriendsScreen(); const chatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); -const settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); +const settingsProfileFirstUser = new SettingsProfileScreen(); const slimbarFirstUser = new FavoritesSidebar(USER_A_INSTANCE); const welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); diff --git a/tests/specs/03-files.spec.ts b/tests/specs/03-files.spec.ts index ae2dbe19a85..7898dd2c6cb 100644 --- a/tests/specs/03-files.spec.ts +++ b/tests/specs/03-files.spec.ts @@ -5,7 +5,7 @@ import FriendsScreen from "@screenobjects/friends/FriendsScreen"; import { USER_A_INSTANCE } from "@helpers/constants"; const chatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); -const friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); +const friendsScreenFirstUser = new FriendsScreen(); export default async function files() { it("Validate Pre Release Indicator is displayed and has correct text", async () => { diff --git a/tests/specs/04-friends.spec.ts b/tests/specs/04-friends.spec.ts index 6cb18314855..38e553b3fbc 100644 --- a/tests/specs/04-friends.spec.ts +++ b/tests/specs/04-friends.spec.ts @@ -16,7 +16,7 @@ const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsLayoutFirstUser = new ChatsLayout(USER_A_INSTANCE); const chatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); const favoritesSidebarFirstUser = new FavoritesSidebar(USER_A_INSTANCE); -const friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); +const friendsScreenFirstUser = new FriendsScreen(); const uplinkMainFirstUser = new UplinkMainScreen(USER_A_INSTANCE); const users = ["ChatUserB", "ChatUserC", "ChatUserD"]; diff --git a/tests/specs/05-settings-profile.spec.ts b/tests/specs/05-settings-profile.spec.ts index 3f649bddd89..517137ba7ba 100644 --- a/tests/specs/05-settings-profile.spec.ts +++ b/tests/specs/05-settings-profile.spec.ts @@ -5,7 +5,7 @@ import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen import { USER_A_INSTANCE, MACOS_DRIVER } from "@helpers/constants"; const cropProfileFirstUser = new CropImageProfileModal(USER_A_INSTANCE); const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); -const settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); +const settingsProfileFirstUser = new SettingsProfileScreen(); export default async function settingsProfile() { it("Validate Pre Release Indicator is displayed and has correct text", async () => { diff --git a/tests/specs/06-settings-general.spec.ts b/tests/specs/06-settings-general.spec.ts index e707d21ae5f..7e4eac948a9 100644 --- a/tests/specs/06-settings-general.spec.ts +++ b/tests/specs/06-settings-general.spec.ts @@ -6,8 +6,8 @@ import { MACOS_DRIVER, WINDOWS_DRIVER, } from "@helpers/constants"; -const settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); -const settingsGeneralFirstUser = new SettingsGeneralScreen(USER_A_INSTANCE); +const settingsProfileFirstUser = new SettingsProfileScreen(); +const settingsGeneralFirstUser = new SettingsGeneralScreen(); export default async function settingsGeneral() { it("Settings General - Validate header and description texts are correct", async () => { diff --git a/tests/specs/14-create-reusable-accounts.spec.ts b/tests/specs/14-create-reusable-accounts.spec.ts index 906d8665306..1177d3e146c 100644 --- a/tests/specs/14-create-reusable-accounts.spec.ts +++ b/tests/specs/14-create-reusable-accounts.spec.ts @@ -10,7 +10,7 @@ import CropImageProfileModal from "@screenobjects/settings/CropToolProfileModal" import SettingsProfileScreen from "@screenobjects/settings/SettingsProfileScreen"; import WelcomeScreen from "@screenobjects/welcome-screen/WelcomeScreen"; const cropProfileFirstUser = new CropImageProfileModal(USER_A_INSTANCE); -const settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); +const settingsProfileFirstUser = new SettingsProfileScreen(); const welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); export default async function createReusableAccounts() { diff --git a/tests/specs/15-settings-messages.spec.ts b/tests/specs/15-settings-messages.spec.ts index 9f8afeb21a7..fd9a0a1da40 100644 --- a/tests/specs/15-settings-messages.spec.ts +++ b/tests/specs/15-settings-messages.spec.ts @@ -2,7 +2,7 @@ require("module-alias/register"); import SettingsGeneralScreen from "@screenobjects/settings/SettingsGeneralScreen"; import SettingsMessagesScreen from "@screenobjects/settings/SettingsMessagesScreen"; import { USER_A_INSTANCE } from "@helpers/constants"; -const settingsGeneralFirstUser = new SettingsGeneralScreen(USER_A_INSTANCE); +const settingsGeneralFirstUser = new SettingsGeneralScreen(); const settingsMessagesFirstUser = new SettingsMessagesScreen(USER_A_INSTANCE); export default async function settingsMessages() { diff --git a/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts b/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts index 199ef5d6319..1e4aa4f0ec2 100644 --- a/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts +++ b/tests/specs/reusable-accounts/01-create-accounts-and-friends.spec.ts @@ -4,6 +4,7 @@ import { activateSecondApplication, createNewUser, getUserKey, + grabCacheFolder, launchSecondApplication, saveTestKeys, } from "@helpers/commands"; @@ -25,298 +26,311 @@ const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsLayoutFirstUser = new ChatsLayout(USER_A_INSTANCE); const chatsMessageGroupsFirstUser = new MessageGroup(USER_A_INSTANCE); const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); -const createPinFirstUser = new CreatePinScreen(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); +const createPinFirstUser = new CreatePinScreen(); const emojiSelectorFirstUser = new EmojiSelector(USER_A_INSTANCE); const favoritesSidebarFirstUser = new FavoritesSidebar(USER_A_INSTANCE); -const friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); -const settingsGeneralFirstUser = new SettingsGeneralScreen(USER_A_INSTANCE); +const friendsScreenFirstUser = new FriendsScreen(); +const settingsGeneralFirstUser = new SettingsGeneralScreen(); const settingsNotificationsFirstUser = new SettingsNotificationsScreen( USER_A_INSTANCE, ); -const settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); +const settingsProfileFirstUser = new SettingsProfileScreen(); const welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); -export default async function createChatAccountsTests() { - it("Chat User A - Create Account", async () => { - // Create a new account and go to Settings Profile - await createPinFirstUser.waitForIsShown(true); - const username = "ChatUserA"; - await createNewUser(username); - await welcomeScreenFirstUser.goToSettings(); - await settingsProfileFirstUser.validateSettingsProfileIsShown(); - - // Click on Copy ID button and assert Toast Notification is displayed - await settingsProfileFirstUser.openCopyIDContextMenu(); - await settingsProfileFirstUser.clickOnContextMenuCopyDidKey(); - - // Wait for toast notification to be closed - await settingsProfileFirstUser.waitUntilNotificationIsClosed(); - - // Paste copied DID Key into Status Input - await settingsProfileFirstUser.pasteUserKeyInStatus(); - const didkey = await settingsProfileFirstUser.getCopiedDidFromStatusInput(); - - // Grab cache folder and restart - await saveTestKeys(username, didkey, USER_A_INSTANCE); - }); - - it("Chat User A - Settings General - Reduce font size", async () => { - // Go to General Settings and reduce Font Size by 0.5 - await settingsProfileFirstUser.goToGeneralSettings(); - - // Wait for toast notification of Profile Updated to not exist - await settingsGeneralFirstUser.waitUntilNotificationIsClosed(); - - // Click on font scaling minus button - await settingsGeneralFirstUser.settingsGeneral.waitForExist(); - await settingsGeneralFirstUser.clickOnFontScalingMinus(); - }); - - it("Chat User A - Settings Notifications - Disable notifications", async () => { - // Go to Notifications Settings and disable all notifications - await settingsGeneralFirstUser.goToNotificationsSettings(); - await settingsNotificationsFirstUser.validateSettingsNotificationsIsShown(); - await settingsNotificationsFirstUser.clickOnFriendsNotifications(); - await settingsNotificationsFirstUser.clickOnMessagesNotifications(); - - // Go to Friends Screen - await settingsNotificationsFirstUser.goToFriends(); - await friendsScreenFirstUser.validateFriendsScreenIsShown(); - }); - - it("Chat User B - Create Account", async () => { - // Launch second application - await launchSecondApplication(); - - // Create a new account and go to Settings Profile - await createPinFirstUser.waitForIsShown(true); - const username = "ChatUserB"; - await createNewUser(username); - await welcomeScreenFirstUser.goToSettings(); - await settingsProfileFirstUser.validateSettingsProfileIsShown(); - - // Click on Copy ID button and assert Toast Notification is displayed - await settingsProfileFirstUser.openCopyIDContextMenu(); - await settingsProfileFirstUser.clickOnContextMenuCopyDidKey(); - - // Wait for toast notification of Copied To Clipboard to not exist - await settingsProfileFirstUser.waitUntilNotificationIsClosed(); - - // Paste copied DID Key into Status Input - await settingsProfileFirstUser.pasteUserKeyInStatus(); - const didkey = await settingsProfileFirstUser.getCopiedDidFromStatusInput(); - - // Grab cache folder and restart - await saveTestKeys(username, didkey, USER_A_INSTANCE); - }); - - it("Chat User B - Settings General - Reduce font size", async () => { - // Go to General Settings and reduce Font Size by 0.5 - await settingsProfileFirstUser.goToGeneralSettings(); - - // Wait for toast notification of Profile Updated to not exist - await settingsGeneralFirstUser.waitUntilNotificationIsClosed(); - - // Click on font scaling minus - await settingsGeneralFirstUser.validateSettingsGeneralIsShown(); - await settingsGeneralFirstUser.clickOnFontScalingMinus(); - }); - - it("Chat User B - Settings Notifications - Disable notifications", async () => { - // Go to Notifications Settings and disable all notifications - await settingsGeneralFirstUser.goToNotificationsSettings(); - await settingsNotificationsFirstUser.validateSettingsNotificationsIsShown(); - await settingsNotificationsFirstUser.clickOnFriendsNotifications(); - await settingsNotificationsFirstUser.clickOnMessagesNotifications(); - - // Go to Friends Screen - await settingsNotificationsFirstUser.goToFriends(); - await friendsScreenFirstUser.validateFriendsScreenIsShown(); - }); - - it("Chat User B - Send friend request to User A", async () => { - // Obtain did key from Chat User B - const friendDidKey = await getUserKey("ChatUserA", USER_A_INSTANCE); - await friendsScreenFirstUser.sendFriendRequest(friendDidKey, "ChatUserA"); - - // Go to All Friends List - await friendsScreenFirstUser.goToAllFriendsList(); - await friendsScreenFirstUser.validateAllFriendsListIsShown(); - }); - - it("Chat User A - Accept friend request from User A and go to chat button", async () => { - // Switch control to User A - await activateFirstApplication(); - - // With User A - Go to pending requests list, wait for receiving the friend request and accept it - await friendsScreenFirstUser.hoverOnPendingListButton(); - await friendsScreenFirstUser.goToPendingFriendsList(); - await friendsScreenFirstUser.validateIncomingListIsShown(); - await friendsScreenFirstUser.waitUntilFriendRequestIsReceived(); - await friendsScreenFirstUser.acceptIncomingRequest("ChatUserB"); - - // Validate friend is now on all friends list - await friendsScreenFirstUser.goToAllFriendsList(); - await friendsScreenFirstUser.validateAllFriendsListIsShown(); - await friendsScreenFirstUser.validateAllFriendsListIsNotEmpty(); - - // Go to Chat with User B - await friendsScreenFirstUser.chatWithFriendButton.click(); - }); - - it("Chat User B - Validate friend request was accepted", async () => { - // Switch control to User B - await activateSecondApplication(); - - // With User B - Go to pending requests list, wait for receiving the friend request and accept it - await friendsScreenFirstUser.waitUntilUserAcceptedFriendRequest(); - - // Validate friend is now on all friends list - await friendsScreenFirstUser.goToAllFriendsList(); - await friendsScreenFirstUser.validateAllFriendsListIsShown(); - await friendsScreenFirstUser.validateAllFriendsListIsNotEmpty(); - }); - - it("Chat User A - Chat screen displays Messages secured text displayed on top of conversation", async () => { - // Switch control to User A - await activateFirstApplication(); - await chatsTopbarFirstUser.validateTopbarExists(); - - // Validate E2E message is displayed on top of chat - const encryptedMessagesText = - await chatsLayoutFirstUser.encryptedMessagesText; - await encryptedMessagesText.waitForExist(); - await expect(encryptedMessagesText).toHaveTextContaining( - "Messages are secured by end-to-end encryption and sent over a peer-to-peer network.", - ); - }); - - it("Input Bar - Chars Counter on Input Bar displays 0/1024 before typing a text", async () => { - // Validate Char counter is displayed on Input Bar and it displays 0/1024 - const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; - const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; - await expect(inputCharCounter).toHaveTextContaining("0"); - await expect(inputCharMaxText).toHaveTextContaining("/1024"); - }); - - it("Input Bar - Chars Counter on Input Bar displays the number of chars of text entered", async () => { - // Validate Char counter increases after typing a text - const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; - const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; - await chatsInputFirstUser.typeMessageOnInput("Testing..."); - await expect(inputCharCounter).toHaveTextContaining("10"); - await expect(inputCharMaxText).toHaveTextContaining("/1024"); - }); - - it("Input Bar - Add emoji to the message to be sent", async () => { - // Add emoji to the message to be sent - await chatsInputFirstUser.clickOnEmojiButton(); - await emojiSelectorFirstUser.clickOnEmoji("😀"); - - // Validate Char counter increases after adding an emoji to input bar - const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; - const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; - await expect(inputCharCounter).toHaveTextContaining("11"); - await expect(inputCharMaxText).toHaveTextContaining("/1024"); - }); - - it("Input Bar - Click on send button will send the message to the other user", async () => { - // Send message to the other user - await chatsInputFirstUser.clickOnSendMessage(); - await chatsMessagesFirstUser.waitForMessageSentToExist("Testing...😀"); - - const textFromMessage = - await chatsMessagesFirstUser.getFirstMessageSentText(); - await expect(textFromMessage).toHaveTextContaining("Testing...😀"); - }); - - it("Input Bar - Chars Counter on Input Bar displays 0/1024 after sending a message", async () => { - // Validate Char counter is displayed on Input Bar and it displays 0/1024 - const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; - const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; - await expect(inputCharCounter).toHaveTextContaining("0"); - await expect(inputCharMaxText).toHaveTextContaining("/1024"); - }); - - it("Chat User A - Validate Chat Message displays timestamp and user who sent it", async () => { - //Timestamp from last message sent should be displayed - const timeAgo = - await chatsMessageGroupsFirstUser.getLastMessageSentTimeAgo(); - await expect(timeAgo).toHaveTextContaining( - /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, - ); - await expect(timeAgo).toHaveTextContaining("ChatUserA"); - }); - - it("Chat User A - Validate Chat Message sent contents", async () => { - //Any message you sent yourself should appear within a colored message bubble - const messageText = await chatsMessagesFirstUser.getFirstMessageSentText(); - await expect(messageText).toHaveTextContaining("Testing...😀"); - }); - - it("Chat User A - Validate Chat Message Group displays username picture", async () => { - //Your user image should be displayed next to the message - const userImage = - await chatsMessageGroupsFirstUser.getLastGroupWrapSentImage(); - await userImage.waitForExist(); - }); - - it("Chat User A - Topbar information", async () => { - // Validate user image, username is displayed on Chat Topbar - await chatsTopbarFirstUser.validateTopbarUserImage(); - await chatsTopbarFirstUser.validateTopbarUserName("ChatUserB"); - }); - - it("Chat User A - Add user with active chat to Favorites", async () => { - // Add user to favorites - await chatsTopbarFirstUser.addToFavorites(); - await favoritesSidebarFirstUser.validateFavoritesAreShown(); - - // Favorites Sidebar User bubble should be displayed with image - await favoritesSidebarFirstUser.validateFavoritesUserImage("ChatUserB"); - }); - - it("Chat User A - Remove user with active chat from Favorites", async () => { - // Remove user from favorites - await chatsTopbarFirstUser.removeFromFavorites(); - }); - - it("Chat User B - Wait until the other user is connected", async () => { - // Switch control to User B - await activateSecondApplication(); - - // Go to the current list of All friends and then open a Chat conversation with ChatUserA - await friendsScreenFirstUser.chatWithFriendButton.waitForExist(); - await friendsScreenFirstUser.hoverOnChatWithFriendButton("ChatUserA"); - await friendsScreenFirstUser.chatWithFriendButton.click(); - await chatsTopbarFirstUser.validateTopbarExists(); - }); - - it("Chat User B - Assert message received from Chat User A", async () => { - // Validate message received from Chat User A - await chatsMessagesFirstUser.waitForReceivingMessage("Testing...😀"); - - //Any message you sent yourself should appear within a colored message bubble - const textFromMessage = - await chatsMessagesFirstUser.getLastMessageReceivedText(); - await expect(textFromMessage).toHaveTextContaining("Testing...😀"); - }); - - it("Chat User B - Validate Chat Message Group from remote user displays username picture", async () => { - //Your user image should be displayed next to the message - const userImage = - await chatsMessageGroupsFirstUser.getLastGroupWrapReceivedImage(); - await userImage.waitForExist(); - }); - - it("Chat User B - Validate Chat Message received displays timestamp and user who sent it", async () => { - //Timestamp should be displayed when you send a message - const timeAgo = - await chatsMessageGroupsFirstUser.getLastMessageReceivedTimeAgo(); - await expect(timeAgo).toHaveTextContaining( - /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, - ); - await expect(timeAgo).toHaveTextContaining("ChatUserA"); - }); -} +describe("Chats Tests - Main tests for Chats"), + async () => { + it("Chat User A - Create Account", async () => { + // Create a new account and go to Settings Profile + await createPinFirstUser.waitForIsShown(true); + const username = "ChatUserA"; + await createNewUser(username); + await welcomeScreenFirstUser.goToSettings(); + await settingsProfileFirstUser.validateSettingsProfileIsShown(); + + // Click on Copy ID button and assert Toast Notification is displayed + await settingsProfileFirstUser.openCopyIDContextMenu(); + await settingsProfileFirstUser.clickOnContextMenuCopyDidKey(); + + // Wait for toast notification to be closed + await settingsProfileFirstUser.waitUntilNotificationIsClosed(); + + // Paste copied DID Key into Status Input + await settingsProfileFirstUser.pasteUserKeyInStatus(); + const didkey = + await settingsProfileFirstUser.getCopiedDidFromStatusInput(); + + // Grab cache folder and restart + await saveTestKeys(username, didkey, USER_A_INSTANCE); + }); + + it("Chat User A - Settings General - Reduce font size", async () => { + // Go to General Settings and reduce Font Size by 0.5 + await settingsProfileFirstUser.goToGeneralSettings(); + + // Wait for toast notification of Profile Updated to not exist + await settingsGeneralFirstUser.waitUntilNotificationIsClosed(); + + // Click on font scaling minus button + await settingsGeneralFirstUser.settingsGeneral.waitForExist(); + await settingsGeneralFirstUser.clickOnFontScalingMinus(); + }); + + it("Chat User A - Settings Notifications - Disable notifications", async () => { + // Go to Notifications Settings and disable all notifications + await settingsGeneralFirstUser.goToNotificationsSettings(); + await settingsNotificationsFirstUser.validateSettingsNotificationsIsShown(); + await settingsNotificationsFirstUser.clickOnFriendsNotifications(); + await settingsNotificationsFirstUser.clickOnMessagesNotifications(); + + // Go to Friends Screen + await settingsNotificationsFirstUser.goToFriends(); + await friendsScreenFirstUser.validateFriendsScreenIsShown(); + }); + + it("Chat User B - Create Account", async () => { + // Launch second application + await launchSecondApplication(); + + // Create a new account and go to Settings Profile + await createPinFirstUser.waitForIsShown(true); + const username = "ChatUserB"; + await createNewUser(username); + await welcomeScreenFirstUser.goToSettings(); + await settingsProfileFirstUser.validateSettingsProfileIsShown(); + + // Click on Copy ID button and assert Toast Notification is displayed + await settingsProfileFirstUser.openCopyIDContextMenu(); + await settingsProfileFirstUser.clickOnContextMenuCopyDidKey(); + + // Wait for toast notification of Copied To Clipboard to not exist + await settingsProfileFirstUser.waitUntilNotificationIsClosed(); + + // Paste copied DID Key into Status Input + await settingsProfileFirstUser.pasteUserKeyInStatus(); + const didkey = + await settingsProfileFirstUser.getCopiedDidFromStatusInput(); + + // Grab cache folder and restart + await saveTestKeys(username, didkey, USER_A_INSTANCE); + }); + + it("Chat User B - Settings General - Reduce font size", async () => { + // Go to General Settings and reduce Font Size by 0.5 + await settingsProfileFirstUser.goToGeneralSettings(); + + // Wait for toast notification of Profile Updated to not exist + await settingsGeneralFirstUser.waitUntilNotificationIsClosed(); + + // Click on font scaling minus + await settingsGeneralFirstUser.validateSettingsGeneralIsShown(); + await settingsGeneralFirstUser.clickOnFontScalingMinus(); + }); + + it("Chat User B - Settings Notifications - Disable notifications", async () => { + // Go to Notifications Settings and disable all notifications + await settingsGeneralFirstUser.goToNotificationsSettings(); + await settingsNotificationsFirstUser.validateSettingsNotificationsIsShown(); + await settingsNotificationsFirstUser.clickOnFriendsNotifications(); + await settingsNotificationsFirstUser.clickOnMessagesNotifications(); + + // Go to Friends Screen + await settingsNotificationsFirstUser.goToFriends(); + await friendsScreenFirstUser.validateFriendsScreenIsShown(); + }); + + it("Chat User B - Send friend request to User A", async () => { + // Obtain did key from Chat User B + const friendDidKey = await getUserKey("ChatUserA", USER_A_INSTANCE); + await friendsScreenFirstUser.sendFriendRequest(friendDidKey, "ChatUserA"); + + // Go to All Friends List + await friendsScreenFirstUser.goToAllFriendsList(); + await friendsScreenFirstUser.validateAllFriendsListIsShown(); + }); + + it("Chat User A - Accept friend request from User A and go to chat button", async () => { + // Switch control to User A + await activateFirstApplication(); + + // With User A - Go to pending requests list, wait for receiving the friend request and accept it + await friendsScreenFirstUser.hoverOnPendingListButton(); + await friendsScreenFirstUser.goToPendingFriendsList(); + await friendsScreenFirstUser.validateIncomingListIsShown(); + await friendsScreenFirstUser.waitUntilFriendRequestIsReceived(); + await friendsScreenFirstUser.acceptIncomingRequest("ChatUserB"); + + // Validate friend is now on all friends list + await friendsScreenFirstUser.goToAllFriendsList(); + await friendsScreenFirstUser.validateAllFriendsListIsShown(); + await friendsScreenFirstUser.validateAllFriendsListIsNotEmpty(); + + // Go to Chat with User B + await friendsScreenFirstUser.chatWithFriendButton.click(); + }); + + it("Chat User B - Validate friend request was accepted", async () => { + // Switch control to User B + await activateSecondApplication(); + + // With User B - Go to pending requests list, wait for receiving the friend request and accept it + await friendsScreenFirstUser.waitUntilUserAcceptedFriendRequest(); + + // Validate friend is now on all friends list + await friendsScreenFirstUser.goToAllFriendsList(); + await friendsScreenFirstUser.validateAllFriendsListIsShown(); + await friendsScreenFirstUser.validateAllFriendsListIsNotEmpty(); + }); + + it("Chat User A - Chat screen displays Messages secured text displayed on top of conversation", async () => { + // Switch control to User A + await activateFirstApplication(); + await chatsTopbarFirstUser.validateTopbarExists(); + + // Validate E2E message is displayed on top of chat + const encryptedMessagesText = + await chatsLayoutFirstUser.encryptedMessagesText; + await encryptedMessagesText.waitForExist(); + await expect(encryptedMessagesText).toHaveTextContaining( + "Messages are secured by end-to-end encryption and sent over a peer-to-peer network.", + ); + }); + + it("Input Bar - Chars Counter on Input Bar displays 0/1024 before typing a text", async () => { + // Validate Char counter is displayed on Input Bar and it displays 0/1024 + const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; + const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; + await expect(inputCharCounter).toHaveTextContaining("0"); + await expect(inputCharMaxText).toHaveTextContaining("/1024"); + }); + + it("Input Bar - Chars Counter on Input Bar displays the number of chars of text entered", async () => { + // Validate Char counter increases after typing a text + const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; + const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; + await chatsInputFirstUser.typeMessageOnInput("Testing..."); + await expect(inputCharCounter).toHaveTextContaining("10"); + await expect(inputCharMaxText).toHaveTextContaining("/1024"); + }); + + it("Input Bar - Add emoji to the message to be sent", async () => { + // Add emoji to the message to be sent + await chatsInputFirstUser.clickOnEmojiButton(); + await emojiSelectorFirstUser.clickOnEmoji("😀"); + + // Validate Char counter increases after adding an emoji to input bar + const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; + const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; + await expect(inputCharCounter).toHaveTextContaining("11"); + await expect(inputCharMaxText).toHaveTextContaining("/1024"); + }); + + it("Input Bar - Click on send button will send the message to the other user", async () => { + // Send message to the other user + await chatsInputFirstUser.clickOnSendMessage(); + await chatsMessagesFirstUser.waitForMessageSentToExist("Testing...😀"); + + const textFromMessage = + await chatsMessagesFirstUser.getFirstMessageSentText(); + await expect(textFromMessage).toHaveTextContaining("Testing...😀"); + }); + + it("Input Bar - Chars Counter on Input Bar displays 0/1024 after sending a message", async () => { + // Validate Char counter is displayed on Input Bar and it displays 0/1024 + const inputCharCounter = await chatsInputFirstUser.inputCharCounterText; + const inputCharMaxText = await chatsInputFirstUser.inputCharMaxText; + await expect(inputCharCounter).toHaveTextContaining("0"); + await expect(inputCharMaxText).toHaveTextContaining("/1024"); + }); + + it("Chat User A - Validate Chat Message displays timestamp and user who sent it", async () => { + //Timestamp from last message sent should be displayed + const timeAgo = + await chatsMessageGroupsFirstUser.getLastMessageSentTimeAgo(); + await expect(timeAgo).toHaveTextContaining( + /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, + ); + await expect(timeAgo).toHaveTextContaining("ChatUserA"); + }); + + it("Chat User A - Validate Chat Message sent contents", async () => { + //Any message you sent yourself should appear within a colored message bubble + const messageText = + await chatsMessagesFirstUser.getFirstMessageSentText(); + await expect(messageText).toHaveTextContaining("Testing...😀"); + }); + + it("Chat User A - Validate Chat Message Group displays username picture", async () => { + //Your user image should be displayed next to the message + const userImage = + await chatsMessageGroupsFirstUser.getLastGroupWrapSentImage(); + await userImage.waitForExist(); + }); + + it("Chat User A - Topbar information", async () => { + // Validate user image, username is displayed on Chat Topbar + await chatsTopbarFirstUser.validateTopbarUserImage(); + await chatsTopbarFirstUser.validateTopbarUserName("ChatUserB"); + }); + + it("Chat User A - Add user with active chat to Favorites", async () => { + // Add user to favorites + await chatsTopbarFirstUser.addToFavorites(); + await favoritesSidebarFirstUser.validateFavoritesAreShown(); + + // Favorites Sidebar User bubble should be displayed with image + await favoritesSidebarFirstUser.validateFavoritesUserImage("ChatUserB"); + }); + + it("Chat User A - Remove user with active chat from Favorites", async () => { + // Remove user from favorites + await chatsTopbarFirstUser.removeFromFavorites(); + }); + + it("Chat User B - Wait until the other user is connected", async () => { + // Switch control to User B + await activateSecondApplication(); + + // Go to the current list of All friends and then open a Chat conversation with ChatUserA + await friendsScreenFirstUser.chatWithFriendButton.waitForExist(); + await friendsScreenFirstUser.hoverOnChatWithFriendButton("ChatUserA"); + await friendsScreenFirstUser.chatWithFriendButton.click(); + await chatsTopbarFirstUser.validateTopbarExists(); + }); + + it("Chat User B - Assert message received from Chat User A", async () => { + // Validate message received from Chat User A + await chatsMessagesFirstUser.waitForReceivingMessage("Testing...😀"); + + //Any message you sent yourself should appear within a colored message bubble + const textFromMessage = + await chatsMessagesFirstUser.getLastMessageReceivedText(); + await expect(textFromMessage).toHaveTextContaining("Testing...😀"); + }); + + it("Chat User B - Validate Chat Message Group from remote user displays username picture", async () => { + //Your user image should be displayed next to the message + const userImage = + await chatsMessageGroupsFirstUser.getLastGroupWrapReceivedImage(); + await userImage.waitForExist(); + }); + + it("Chat User B - Validate Chat Message received displays timestamp and user who sent it", async () => { + //Timestamp should be displayed when you send a message + const timeAgo = + await chatsMessageGroupsFirstUser.getLastMessageReceivedTimeAgo(); + await expect(timeAgo).toHaveTextContaining( + /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, + ); + await expect(timeAgo).toHaveTextContaining("ChatUserA"); + }); + + after(async () => { + // Save Cache Folder User B + await grabCacheFolder("ChatUserB", USER_A_INSTANCE, "/.uplinkUserB"); + + // Save Cache Folder User B + await activateFirstApplication(); + await grabCacheFolder("ChatUserA", USER_A_INSTANCE); + }); + }; diff --git a/tests/specs/reusable-accounts/01-replies.spec.ts b/tests/specs/reusable-accounts/01-replies.spec.ts new file mode 100644 index 00000000000..b138372a0f4 --- /dev/null +++ b/tests/specs/reusable-accounts/01-replies.spec.ts @@ -0,0 +1,144 @@ +require("module-alias/register"); +import { USER_A_INSTANCE } from "@helpers/constants"; +import ContextMenu from "@screenobjects/chats/ContextMenu"; +import ChatsSidebar from "@screenobjects/chats/ChatsSidebar"; +import InputBar from "@screenobjects/chats/InputBar"; +import MessageGroup from "@screenobjects/chats/MessageGroup"; +import Messages from "@screenobjects/chats/Messages"; +import ReplyPrompt from "@screenobjects/chats/ReplyPrompt"; +import { + activateFirstApplication, + launchSecondApplication, + loginWithTestUser, +} from "@helpers/commands"; +const chatsContextMenuFirstUser = new ContextMenu(USER_A_INSTANCE); +const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); +const chatsMessageGroupsFirstUser = new MessageGroup(USER_A_INSTANCE); +const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); +const chatsReplyPromptFirstUser = new ReplyPrompt(USER_A_INSTANCE); +const ChatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); + +describe("Chats Tests - Replies"), + async () => { + before(async () => { + await loginWithTestUser(); + await ChatsSidebarFirstUser.goToSidebarFirstChat(); + await launchSecondApplication(); + await loginWithTestUser(); + await ChatsSidebarFirstUser.goToSidebarFirstChat(); + }); + + it("Chat User B - Reply popup - Validate contents and close it", async () => { + // Open Context Menu on Last Message Received and select Reply + await chatsMessagesFirstUser.openContextMenuOnLastReceived(); + await chatsContextMenuFirstUser.validateContextMenuIsOpen(); + await chatsContextMenuFirstUser.selectContextOptionReply(); + + // Validate contents of Reply Pop Up and close it + await chatsReplyPromptFirstUser.validateReplyPromptElementsShown( + "Testing...😀", + ); + await chatsReplyPromptFirstUser.closeReplyModal(); + await chatsReplyPromptFirstUser.waitForReplyModalToNotExist(); + }); + + it("Chat User B - Reply to a message", async () => { + // Open Context Menu on Last Message Received and select Reply + await chatsMessagesFirstUser.openContextMenuOnLastReceived(); + await chatsContextMenuFirstUser.validateContextMenuIsOpen(); + await chatsContextMenuFirstUser.selectContextOptionReply(); + + // Type a reply and sent it + await chatsReplyPromptFirstUser.replyPopUp.waitForExist(); + await chatsInputFirstUser.typeMessageOnInput("Reply"); + await chatsInputFirstUser.clickOnSendMessage(); + await chatsReplyPromptFirstUser.waitForReplyModalToNotExist(); + }); + + it("Chat User B - Validate reply message group reply and message replied", async () => { + // Validate message replied appears smaller above your reply + const replySent = await chatsMessagesFirstUser.getLastReply(); + const replySentText = await chatsMessagesFirstUser.getLastReplyText(); + await replySent.waitForExist(); + await expect(replySentText).toHaveTextContaining("Testing...😀"); + + // Validate reply message sent appears as last message + const message = await chatsMessagesFirstUser.getLastMessageSentText(); + await expect(message).toHaveTextContaining("Reply"); + }); + + it("Chat User B - Validate reply message group contains timestamp and user image", async () => { + //Timestamp from last message sent should be displayed + const timeAgo = + await chatsMessageGroupsFirstUser.getLastMessageSentTimeAgo(); + await expect(timeAgo).toHaveTextContaining( + /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, + ); + await expect(timeAgo).toHaveTextContaining("ChatUserB"); + + //Your user image should be displayed next to the message + const userImage = + await chatsMessageGroupsFirstUser.getLastGroupWrapSentImage(); + await userImage.waitForExist(); + }); + + it("Chat User A - Validate reply message contents", async () => { + // Switch control to User A + await activateFirstApplication(); + + // With User A - Validate that reply message is received + await chatsMessagesFirstUser.chatMessageReply.waitForExist(); + + // Validate message replied appears smaller above your reply + const replyReceived = await chatsMessagesFirstUser.getLastReply(); + const replyReceivedText = await chatsMessagesFirstUser.getLastReplyText(); + await replyReceived.waitForExist(); + await expect(replyReceivedText).toHaveTextContaining("Testing...😀"); + + // Validate reply message sent appears as last message + const textFromMessage = + await chatsMessagesFirstUser.getLastMessageReceivedText(); + await expect(textFromMessage).toHaveTextContaining("Reply"); + }); + + it("Chat User A - Validate reply message group contains timestamp", async () => { + //Timestamp from last message sent should be displayed + const timeAgo = + await chatsMessageGroupsFirstUser.getLastMessageReceivedTimeAgo(); + await expect(timeAgo).toHaveTextContaining( + /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, + ); + await expect(timeAgo).toHaveTextContaining("ChatUserB"); + }); + + it("Chat User A - Validate reply message group contains user image", async () => { + //Your user image should be displayed next to the message + const userImage = + await chatsMessageGroupsFirstUser.getLastGroupWrapReceivedImage(); + await userImage.waitForExist(); + }); + + it("Chat User A - Reply to yourself", async () => { + // Open Context Menu on Last Message Sent + await chatsMessagesFirstUser.openContextMenuOnLastSent(); + await chatsContextMenuFirstUser.validateContextMenuIsOpen(); + await chatsContextMenuFirstUser.selectContextOptionReply(); + + // Type a reply and sent it + await chatsReplyPromptFirstUser.replyPopUp.waitForExist(); + await chatsInputFirstUser.typeMessageOnInput("SelfReply"); + await chatsInputFirstUser.clickOnSendMessage(); + await chatsReplyPromptFirstUser.waitForReplyModalToNotExist(); + + // Validate reply to self message is displayed on Chat Conversation + const repliedMessage = await chatsMessagesFirstUser.getLastReply(); + const repliedMessageText = + await chatsMessagesFirstUser.getLastReplyText(); + await repliedMessage.waitForExist(); + await expect(repliedMessageText).toHaveTextContaining("Testing...😀"); + + // Validate reply message sent appears as last message + const message = await chatsMessagesFirstUser.getLastMessageSentText(); + await expect(message).toHaveTextContaining("SelfReply"); + }); + }; diff --git a/tests/specs/reusable-accounts/02-chat-replies.spec.ts b/tests/specs/reusable-accounts/02-chat-replies.spec.ts deleted file mode 100644 index a671f4401b2..00000000000 --- a/tests/specs/reusable-accounts/02-chat-replies.spec.ts +++ /dev/null @@ -1,128 +0,0 @@ -require("module-alias/register"); -import { USER_A_INSTANCE } from "@helpers/constants"; -import ContextMenu from "@screenobjects/chats/ContextMenu"; -import InputBar from "@screenobjects/chats/InputBar"; -import MessageGroup from "@screenobjects/chats/MessageGroup"; -import Messages from "@screenobjects/chats/Messages"; -import ReplyPrompt from "@screenobjects/chats/ReplyPrompt"; -import { activateFirstApplication } from "@helpers/commands"; -const chatsContextMenuFirstUser = new ContextMenu(USER_A_INSTANCE); -const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); -const chatsMessageGroupsFirstUser = new MessageGroup(USER_A_INSTANCE); -const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); -const chatsReplyPromptFirstUser = new ReplyPrompt(USER_A_INSTANCE); - -export default async function repliesTests() { - it("Chat User B - Reply popup - Validate contents and close it", async () => { - // Open Context Menu on Last Message Received and select Reply - await chatsMessagesFirstUser.openContextMenuOnLastReceived(); - await chatsContextMenuFirstUser.validateContextMenuIsOpen(); - await chatsContextMenuFirstUser.selectContextOptionReply(); - - // Validate contents of Reply Pop Up and close it - await chatsReplyPromptFirstUser.validateReplyPromptElementsShown( - "Testing...😀", - ); - await chatsReplyPromptFirstUser.closeReplyModal(); - await chatsReplyPromptFirstUser.waitForReplyModalToNotExist(); - }); - - it("Chat User B - Reply to a message", async () => { - // Open Context Menu on Last Message Received and select Reply - await chatsMessagesFirstUser.openContextMenuOnLastReceived(); - await chatsContextMenuFirstUser.validateContextMenuIsOpen(); - await chatsContextMenuFirstUser.selectContextOptionReply(); - - // Type a reply and sent it - await chatsReplyPromptFirstUser.replyPopUp.waitForExist(); - await chatsInputFirstUser.typeMessageOnInput("Reply"); - await chatsInputFirstUser.clickOnSendMessage(); - await chatsReplyPromptFirstUser.waitForReplyModalToNotExist(); - }); - - it("Chat User B - Validate reply message group reply and message replied", async () => { - // Validate message replied appears smaller above your reply - const replySent = await chatsMessagesFirstUser.getLastReply(); - const replySentText = await chatsMessagesFirstUser.getLastReplyText(); - await replySent.waitForExist(); - await expect(replySentText).toHaveTextContaining("Testing...😀"); - - // Validate reply message sent appears as last message - const message = await chatsMessagesFirstUser.getLastMessageSentText(); - await expect(message).toHaveTextContaining("Reply"); - }); - - it("Chat User B - Validate reply message group contains timestamp and user image", async () => { - //Timestamp from last message sent should be displayed - const timeAgo = - await chatsMessageGroupsFirstUser.getLastMessageSentTimeAgo(); - await expect(timeAgo).toHaveTextContaining( - /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, - ); - await expect(timeAgo).toHaveTextContaining("ChatUserB"); - - //Your user image should be displayed next to the message - const userImage = - await chatsMessageGroupsFirstUser.getLastGroupWrapSentImage(); - await userImage.waitForExist(); - }); - - it("Chat User A - Validate reply message contents", async () => { - // Switch control to User A - await activateFirstApplication(); - - // With User A - Validate that reply message is received - await chatsMessagesFirstUser.chatMessageReply.waitForExist(); - - // Validate message replied appears smaller above your reply - const replyReceived = await chatsMessagesFirstUser.getLastReply(); - const replyReceivedText = await chatsMessagesFirstUser.getLastReplyText(); - await replyReceived.waitForExist(); - await expect(replyReceivedText).toHaveTextContaining("Testing...😀"); - - // Validate reply message sent appears as last message - const textFromMessage = - await chatsMessagesFirstUser.getLastMessageReceivedText(); - await expect(textFromMessage).toHaveTextContaining("Reply"); - }); - - it("Chat User A - Validate reply message group contains timestamp", async () => { - //Timestamp from last message sent should be displayed - const timeAgo = - await chatsMessageGroupsFirstUser.getLastMessageReceivedTimeAgo(); - await expect(timeAgo).toHaveTextContaining( - /- (?:\d{1,2}\s+(?:second|minute)s?\s+ago|now)$/, - ); - await expect(timeAgo).toHaveTextContaining("ChatUserB"); - }); - - it("Chat User A - Validate reply message group contains user image", async () => { - //Your user image should be displayed next to the message - const userImage = - await chatsMessageGroupsFirstUser.getLastGroupWrapReceivedImage(); - await userImage.waitForExist(); - }); - - it("Chat User A - Reply to yourself", async () => { - // Open Context Menu on Last Message Sent - await chatsMessagesFirstUser.openContextMenuOnLastSent(); - await chatsContextMenuFirstUser.validateContextMenuIsOpen(); - await chatsContextMenuFirstUser.selectContextOptionReply(); - - // Type a reply and sent it - await chatsReplyPromptFirstUser.replyPopUp.waitForExist(); - await chatsInputFirstUser.typeMessageOnInput("SelfReply"); - await chatsInputFirstUser.clickOnSendMessage(); - await chatsReplyPromptFirstUser.waitForReplyModalToNotExist(); - - // Validate reply to self message is displayed on Chat Conversation - const repliedMessage = await chatsMessagesFirstUser.getLastReply(); - const repliedMessageText = await chatsMessagesFirstUser.getLastReplyText(); - await repliedMessage.waitForExist(); - await expect(repliedMessageText).toHaveTextContaining("Testing...😀"); - - // Validate reply message sent appears as last message - const message = await chatsMessagesFirstUser.getLastMessageSentText(); - await expect(message).toHaveTextContaining("SelfReply"); - }); -} diff --git a/tests/specs/reusable-accounts/05-message-attachments.spec.ts b/tests/specs/reusable-accounts/05-message-attachments.spec.ts index 5334d564be3..604806b37c5 100644 --- a/tests/specs/reusable-accounts/05-message-attachments.spec.ts +++ b/tests/specs/reusable-accounts/05-message-attachments.spec.ts @@ -13,7 +13,7 @@ import { const chatsAttachmentFirstUser = new ComposeAttachment(USER_A_INSTANCE); const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); const sendFilesFirstUser = new SendFiles(USER_A_INSTANCE); diff --git a/tests/specs/reusable-accounts/06-chat-topbar.spec.ts b/tests/specs/reusable-accounts/06-chat-topbar.spec.ts index 24da0126861..e4222594d56 100644 --- a/tests/specs/reusable-accounts/06-chat-topbar.spec.ts +++ b/tests/specs/reusable-accounts/06-chat-topbar.spec.ts @@ -11,7 +11,7 @@ const chatsContextMenuFirstUser = new ContextMenu(USER_A_INSTANCE); const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); const chatsMessageGroupsFirstUser = new MessageGroup(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); const pinnedMessagesFirstUser = new PinnedMessages(USER_A_INSTANCE); export default async function chatTopbarTests() { diff --git a/tests/specs/reusable-accounts/07-quick-profile.spec.ts b/tests/specs/reusable-accounts/07-quick-profile.spec.ts index 669f69e21fb..e986b219661 100644 --- a/tests/specs/reusable-accounts/07-quick-profile.spec.ts +++ b/tests/specs/reusable-accounts/07-quick-profile.spec.ts @@ -18,9 +18,9 @@ const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsMessageGroupsFirstUser = new MessageGroup(USER_A_INSTANCE); const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); const chatsQuickProfileFirstUser = new QuickProfile(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); -const friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); -const settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); +const friendsScreenFirstUser = new FriendsScreen(); +const settingsProfileFirstUser = new SettingsProfileScreen(); const welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); export default async function quickProfileTests() { diff --git a/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts b/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts index 9a8e6bdac40..ca6356a4524 100644 --- a/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts +++ b/tests/specs/reusable-accounts/08-sidebar-chats.spec.ts @@ -20,12 +20,12 @@ const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsLayoutFirstUser = new ChatsLayout(USER_A_INSTANCE); const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); const chatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); const contextMenuSidebarFirstUser = new ContextMenuSidebar(USER_A_INSTANCE); const favoritesSidebarFirstUser = new FavoritesSidebar(USER_A_INSTANCE); const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); -const friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); -const settingsProfileFirstUser = new SettingsProfileScreen(USER_A_INSTANCE); +const friendsScreenFirstUser = new FriendsScreen(); +const settingsProfileFirstUser = new SettingsProfileScreen(); const welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); export default async function sidebarChatsTests() { diff --git a/tests/specs/reusable-accounts/09-group-chats.spec.ts b/tests/specs/reusable-accounts/09-group-chats.spec.ts index f8aec4f2a51..c19177ce59d 100644 --- a/tests/specs/reusable-accounts/09-group-chats.spec.ts +++ b/tests/specs/reusable-accounts/09-group-chats.spec.ts @@ -14,7 +14,7 @@ import { const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); const chatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); const createGroupFirstUser = new CreateGroupChat(USER_A_INSTANCE); const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); const sidebarSearchFirstUser = new SidebarSearch(USER_A_INSTANCE); diff --git a/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts b/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts index ca0397cacfa..a8da2f2356d 100644 --- a/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts +++ b/tests/specs/reusable-accounts/10-group-chats-edit.spec.ts @@ -10,7 +10,7 @@ import { activateSecondApplication, } from "@helpers/commands"; const chatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); const editGroupFirstUser = new EditGroup(USER_A_INSTANCE); const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); const welcomeScreenFirstUser = new WelcomeScreen(USER_A_INSTANCE); diff --git a/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts b/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts index 51ff3eaddd4..4c055e59385 100644 --- a/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts +++ b/tests/specs/reusable-accounts/11-group-chats-sidebar.spec.ts @@ -16,12 +16,12 @@ import { const chatsInputFirstUser = new InputBar(USER_A_INSTANCE); const chatsMessagesFirstUser = new Messages(USER_A_INSTANCE); const chatsSidebarFirstUser = new ChatsSidebar(USER_A_INSTANCE); -const chatsTopbarFirstUser = new Topbar(USER_A_INSTANCE); +const chatsTopbarFirstUser = new Topbar(); const contextMenuSidebarFirstUser = new ContextMenuSidebar(USER_A_INSTANCE); const editGroupFirstUser = new EditGroup(USER_A_INSTANCE); const favoritesSidebarFirstUser = new FavoritesSidebar(USER_A_INSTANCE); const filesScreenFirstUser = new FilesScreen(USER_A_INSTANCE); -const friendsScreenFirstUser = new FriendsScreen(USER_A_INSTANCE); +const friendsScreenFirstUser = new FriendsScreen(); export default async function groupChatSidebarTests() { it("Group Chat - Add group to favorites", async () => { diff --git a/tests/specs/scripts/01-multiple-logins.spec.ts b/tests/specs/scripts/01-multiple-logins.spec.ts index 1460c0d9bb2..390d89c2f44 100644 --- a/tests/specs/scripts/01-multiple-logins.spec.ts +++ b/tests/specs/scripts/01-multiple-logins.spec.ts @@ -4,20 +4,19 @@ import { launchApplication, loginWithTestUser, } from "@helpers/commands"; -import { USER_A_INSTANCE } from "@helpers/constants"; describe("One time script test for login", async () => { it("Should create an account", async () => { const username = "test"; await createNewUser(username); - await closeApplication(USER_A_INSTANCE); + await closeApplication(); }); for (let i = 1; i <= 100; i++) { it("Should login to app and reset - Attempt #" + i, async () => { await launchApplication(); await loginWithTestUser(); - await closeApplication(USER_A_INSTANCE); + await closeApplication(); }); } }); diff --git a/tests/suites/Chats/01-Chats.suite.ts b/tests/suites/Chats/01-Chats.suite.ts index 984de311b9c..c9337a93f82 100644 --- a/tests/suites/Chats/01-Chats.suite.ts +++ b/tests/suites/Chats/01-Chats.suite.ts @@ -1,22 +1,15 @@ require("module-alias/register"); import chatTopbarTests from "@specs/reusable-accounts/06-chat-topbar.spec"; -import createChatAccountsTests from "@specs/reusable-accounts/01-create-accounts-and-friends.spec"; import groupChatTests from "@specs/reusable-accounts/09-group-chats.spec"; import groupChatEditTests from "@specs/reusable-accounts/10-group-chats-edit.spec"; import groupChatSidebarTests from "@specs/reusable-accounts/11-group-chats-sidebar.spec"; import messageAttachmentsTests from "@specs/reusable-accounts/05-message-attachments.spec"; import messageContextMenuTests from "@specs/reusable-accounts/03-message-context-menu.spec"; import messageInputTests from "@specs/reusable-accounts/04-message-input.spec"; -import repliesTests from "@specs/reusable-accounts/02-chat-replies.spec"; import quickProfileTests from "@specs/reusable-accounts/07-quick-profile.spec"; import sidebarChatsTests from "@specs/reusable-accounts/08-sidebar-chats.spec"; describe("MacOS Chats Tests", function () { - describe( - "Create Accounts and Chat Tests", - createChatAccountsTests.bind(this), - ); - describe("Chat Replies Tests", repliesTests.bind(this)); describe("Message Context Menu Tests", messageContextMenuTests.bind(this)); describe("Message Input Tests", messageInputTests.bind(this)); describe("Message Attachments Tests", messageAttachmentsTests.bind(this));