From 446e3f44bdb02c3c2e7b9c269955eabf6d8e4de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Mon, 6 Nov 2023 23:14:04 -0600 Subject: [PATCH] screenobject(update): update waitUntil methods and click on emoji --- tests/helpers/commands.ts | 28 +++++++++---------- tests/screenobjects/chats/ChatsLayout.ts | 2 +- tests/screenobjects/chats/ChatsSidebar.ts | 10 +++++-- .../screenobjects/chats/ComposeAttachment.ts | 22 +++++++-------- tests/screenobjects/chats/CreateGroupChat.ts | 20 +++++++------ tests/screenobjects/chats/EditGroup.ts | 12 +++++--- tests/screenobjects/chats/EmojiSelector.ts | 3 +- tests/screenobjects/chats/FavoritesSidebar.ts | 25 ++++++++++------- tests/screenobjects/chats/MessageGroup.ts | 10 ++++--- tests/screenobjects/chats/Messages.ts | 16 +++++------ tests/screenobjects/chats/Topbar.ts | 10 +++---- tests/screenobjects/friends/FriendsScreen.ts | 24 ++++++++++------ 12 files changed, 103 insertions(+), 79 deletions(-) diff --git a/tests/helpers/commands.ts b/tests/helpers/commands.ts index 3886ed660d6..53da8dcdd3f 100644 --- a/tests/helpers/commands.ts +++ b/tests/helpers/commands.ts @@ -16,7 +16,7 @@ import { const { readFileSync, rmSync, writeFileSync } = require("fs"); const { execSync } = require("child_process"); const fsp = require("fs").promises; -const { mouse, Button } = require("@nut-tree/nut-js") +const { 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); @@ -35,7 +35,7 @@ export async function deleteCache() { console.log("Deleted user cache successfully"); } catch (error) { console.error( - `Got an error trying to delete the user cache files: ${error.message}` + `Got an error trying to delete the user cache files: ${error.message}`, ); } } @@ -50,7 +50,7 @@ export async function grabCacheFolder(username: string, instance: string) { console.log("Copied user cache successfully"); } catch (error) { console.error( - `Got an error trying to copy the user cache files: ${error.message}` + `Got an error trying to copy the user cache files: ${error.message}`, ); } } @@ -67,7 +67,7 @@ export async function loadTestUserData(user: string, instance: string) { console.log("Copied user cache successfully"); } catch (error) { console.error( - `Got an error trying to copy the user cache files: ${error.message}` + `Got an error trying to copy the user cache files: ${error.message}`, ); } } @@ -88,7 +88,7 @@ export async function getUserKey(username: string, instance: string) { export async function saveTestKeys( username: string, didkey: string, - instance: string + instance: string, ) { // Save JSON file with keys const currentDriver = await driver[instance].capabilities.automationName; @@ -263,7 +263,7 @@ export async function maximizeWindow(instance: string) { export async function clickOnSwitchMacOS( element: WebdriverIO.Element, - instance: string + instance: string, ) { const currentInstance = await browser.getInstance(instance); const elementLocator = await currentInstance.$(element); @@ -288,7 +288,7 @@ export async function getClipboardMacOS() { export async function hoverOnMacOS( locator: WebdriverIO.Element, - instance: string + instance: string, ) { // Hover on X and Y coordinates previously retrieved await driver[instance].executeScript("macos: hover", [ @@ -323,7 +323,7 @@ export async function saveFileOnMacOS(filename: string, instance: string) { export async function selectFileOnMacos( relativePath: string, - instance: string + instance: string, ) { const currentInstance = await browser.getInstance(instance); @@ -366,7 +366,7 @@ export async function selectFileOnMacos( export async function rightClickOnMacOS( locator: WebdriverIO.Element, - instance: string + instance: string, ) { await driver[instance].executeScript("macos: rightClick", [ { @@ -379,14 +379,14 @@ export async function rightClickOnMacOS( export async function hoverOnWindows( locator: WebdriverIO.Element, - instance: string + instance: string, ) { await driver[instance].moveToElement(locator.elementId); } export async function rightClickOnWindows( locator: WebdriverIO.Element, - instance: string + instance: string, ) { await driver[instance].moveToElement(locator.elementId); await mouse.click(Button.RIGHT); @@ -395,7 +395,7 @@ export async function rightClickOnWindows( export async function saveFileOnWindows( filename: string, uplinkContext: string, - instance: string + instance: string, ) { // Get the filepath to select on browser const filepath = join(process.cwd(), "\\tests\\fixtures\\", filename); @@ -415,7 +415,7 @@ export async function saveFileOnWindows( // Type file location and hit enter const editInput = await driver[instance].$( - "/Window/Pane[1]/ComboBox[1]/Edit" + "/Window/Pane[1]/ComboBox[1]/Edit", ); await editInput.clearValue(); await editInput.setValue(filename + "\uE007"); @@ -429,7 +429,7 @@ export async function saveFileOnWindows( export async function selectFileOnWindows( relativePath: string, uplinkContext: string, - instance: string + instance: string, ) { // Get the filepath to select on browser const filepath = join(process.cwd(), relativePath); diff --git a/tests/screenobjects/chats/ChatsLayout.ts b/tests/screenobjects/chats/ChatsLayout.ts index 6e405f6753c..c17e5a48d74 100644 --- a/tests/screenobjects/chats/ChatsLayout.ts +++ b/tests/screenobjects/chats/ChatsLayout.ts @@ -72,7 +72,7 @@ export default class ChatsLayout extends UplinkMainScreen { async validateChatLayoutIsShown() { await driver[this.executor].waitUntil( async () => { - return await this.chatLayout; + return await this.chatLayout.waitForExist(); }, { timeout: 15000, diff --git a/tests/screenobjects/chats/ChatsSidebar.ts b/tests/screenobjects/chats/ChatsSidebar.ts index 0a93675dd00..97cc8c1d4c9 100644 --- a/tests/screenobjects/chats/ChatsSidebar.ts +++ b/tests/screenobjects/chats/ChatsSidebar.ts @@ -415,7 +415,7 @@ export default class ChatsSidebar extends UplinkMainScreen { async waitForReceivingMessageOnSidebar() { await driver[this.executor].waitUntil( async () => { - return await this.sidebarChatsUserStatusValue; + return await this.sidebarChatsUserStatusValue.waitForExist(); }, { timeout: 60000, @@ -456,7 +456,10 @@ export default class ChatsSidebar extends UplinkMainScreen { const element = await this.getExistingElementByAriaLabel(groupname); await driver[this.executor].waitUntil( async () => { - return await this.instance.$(SELECTORS.SIDEBAR).$(element); + return await this.instance + .$(SELECTORS.SIDEBAR) + .$(element) + .waitForExist(); }, { timeout: 60000, @@ -548,7 +551,8 @@ export default class ChatsSidebar extends UplinkMainScreen { return await userLocator .$(SELECTORS.SIDEBAR_CHATS_USER_IMAGE_WRAP) .$(SELECTORS.SIDEBAR_CHATS_USER_IMAGE) - .$(SELECTORS.SIDEBAR_CHATS_USER_ONLINE_INDICATOR); + .$(SELECTORS.SIDEBAR_CHATS_USER_ONLINE_INDICATOR) + .waitForExist(); }, { timeout: 60000, diff --git a/tests/screenobjects/chats/ComposeAttachment.ts b/tests/screenobjects/chats/ComposeAttachment.ts index 871c200463c..e2a0cdfc717 100644 --- a/tests/screenobjects/chats/ComposeAttachment.ts +++ b/tests/screenobjects/chats/ComposeAttachment.ts @@ -58,25 +58,25 @@ export default class ComposeAttachments extends UplinkMainScreen { get composeAttachmentsFileIcon() { return this.composeAttachmentsFileEmbed.$( - SELECTORS.COMPOSE_ATTACHMENTS_FILE_ICON + SELECTORS.COMPOSE_ATTACHMENTS_FILE_ICON, ); } get composeAttachmentsFileInfo() { return this.composeAttachmentsFileEmbed.$( - SELECTORS.COMPOSE_ATTACHMENTS_FILE_INFO + SELECTORS.COMPOSE_ATTACHMENTS_FILE_INFO, ); } get composeAttachmentsFileMeta() { return this.composeAttachmentsFileEmbed.$( - SELECTORS.COMPOSE_ATTACHMENTS_FILE_META + SELECTORS.COMPOSE_ATTACHMENTS_FILE_META, ); } get composeAttachmentsFileName() { return this.composeAttachmentsFileEmbed.$( - SELECTORS.COMPOSE_ATTACHMENTS_FILE_NAME + SELECTORS.COMPOSE_ATTACHMENTS_FILE_NAME, ); } @@ -92,17 +92,17 @@ export default class ComposeAttachments extends UplinkMainScreen { get composeAttachmentsInputErrorText() { return this.composeAttachmentsInputError.$( - SELECTORS.COMPOSE_ATTACHMENTS_INPUT_ERROR_TEXT + SELECTORS.COMPOSE_ATTACHMENTS_INPUT_ERROR_TEXT, ); } async clickOnDeleteAttachment(attachment: number) { // Get the locator of attachment to delete by passing the index const attachmentToDelete = await this.instance.$$( - SELECTORS.COMPOSE_ATTACHMENTS_FILE_EMBED + SELECTORS.COMPOSE_ATTACHMENTS_FILE_EMBED, )[attachment]; const deleteAttachmentButton = await attachmentToDelete.$( - SELECTORS.COMPOSE_ATTACHMENTS_BUTTON + SELECTORS.COMPOSE_ATTACHMENTS_BUTTON, ); await deleteAttachmentButton.click(); } @@ -116,7 +116,7 @@ export default class ComposeAttachments extends UplinkMainScreen { const composeAttachments = await this.composeAttachments; await composeAttachments.waitForExist(); const filesAttached = await this.instance.$$( - SELECTORS.COMPOSE_ATTACHMENTS_FILE_EMBED + SELECTORS.COMPOSE_ATTACHMENTS_FILE_EMBED, ); let results = []; for (let fileAttached of filesAttached) { @@ -134,18 +134,18 @@ export default class ComposeAttachments extends UplinkMainScreen { const composeAttachmentsFileEmbed = await this.composeAttachmentsFileEmbed; await driver[this.executor].waitUntil( async () => { - return await composeAttachmentsFileEmbed; + return await composeAttachmentsFileEmbed.waitForExist(); }, { timeout: 15000, timeoutMsg: "Attachment file was not added after 15 seconds", - } + }, ); } async validateAttachmentWithFileNameIsAdded( fileName: string, - expectedAssertion: boolean + expectedAssertion: boolean, ) { const attachmentsList = await this.getListOfAttachmentsEmbed(); const includesAttachment = await attachmentsList.includes(fileName); diff --git a/tests/screenobjects/chats/CreateGroupChat.ts b/tests/screenobjects/chats/CreateGroupChat.ts index 0ad4f578df1..f07728f0d31 100644 --- a/tests/screenobjects/chats/CreateGroupChat.ts +++ b/tests/screenobjects/chats/CreateGroupChat.ts @@ -1,4 +1,4 @@ -const {keyboard, Key} = require("@nut-tree/nut-js"); +const { keyboard, Key } = require("@nut-tree/nut-js"); import "module-alias/register"; import { getClipboardMacOS } from "@helpers/commands"; import { @@ -187,7 +187,7 @@ export default class CreateGroupChat extends UplinkMainScreen { async getFriendFromListIndicatorOffline(username: string) { const friendLocator = await this.getFriendFromListLocator(username); const indicatorOffline = await friendLocator.$( - SELECTORS.FRIEND_INDICATOR_OFFLINE + SELECTORS.FRIEND_INDICATOR_OFFLINE, ); await indicatorOffline.waitForExist(); return indicatorOffline; @@ -197,17 +197,19 @@ export default class CreateGroupChat extends UplinkMainScreen { const friendLocator = await this.getFriendFromListLocator(username); await driver[this.executor].waitUntil( async () => { - return await friendLocator.$(SELECTORS.FRIEND_INDICATOR_ONLINE); + return await friendLocator + .$(SELECTORS.FRIEND_INDICATOR_ONLINE) + .waitForExist(); }, { timeout: 15000, timeoutMsg: "Expected indicator online was never displayed on Create Group Users List after 15 seconds", - } + }, ); const indicatorOnline = await friendLocator.$( - SELECTORS.FRIEND_INDICATOR_ONLINE + SELECTORS.FRIEND_INDICATOR_ONLINE, ); return indicatorOnline; } @@ -215,7 +217,7 @@ export default class CreateGroupChat extends UplinkMainScreen { async getFriendFromListUserImageProfile(username: string) { const friendLocator = await this.getFriendFromListLocator(username); const userImageProfile = await friendLocator.$( - SELECTORS.FRIEND_USER_IMAGE_PROFILE + SELECTORS.FRIEND_USER_IMAGE_PROFILE, ); await userImageProfile.waitForExist(); return userImageProfile; @@ -231,7 +233,7 @@ export default class CreateGroupChat extends UplinkMainScreen { .$( '//XCUIElementTypeGroup[@label="friend-name"]/XCUIElementTypeStaticText[contains(@value, "' + username + - '")]/../..' + '")]/../..', ); } else if (currentDriver === WINDOWS_DRIVER) { friendLocator = await this.instance @@ -240,7 +242,7 @@ export default class CreateGroupChat extends UplinkMainScreen { .$( '//Group[@Name="friend-name"]/Text[contains(@Name, "' + username + - '")]/../..' + '")]/../..', ); } return friendLocator; @@ -256,7 +258,7 @@ export default class CreateGroupChat extends UplinkMainScreen { async getFriendFromListUserImageWrap(username: string) { const friendLocator = await this.getFriendFromListLocator(username); const userImageWrap = await friendLocator.$( - SELECTORS.FRIEND_USER_IMAGE_WRAP + SELECTORS.FRIEND_USER_IMAGE_WRAP, ); await userImageWrap.waitForExist(); return userImageWrap; diff --git a/tests/screenobjects/chats/EditGroup.ts b/tests/screenobjects/chats/EditGroup.ts index 4ab5e7463f9..1f8f15a9518 100644 --- a/tests/screenobjects/chats/EditGroup.ts +++ b/tests/screenobjects/chats/EditGroup.ts @@ -251,7 +251,7 @@ export default class EditGroup extends UplinkMainScreen { )[0]; await driver[this.executor].waitUntil( async () => { - return await firstAddButton; + return await firstAddButton.waitForExist(); }, { timeout: 15000, @@ -268,7 +268,7 @@ export default class EditGroup extends UplinkMainScreen { )[0]; await driver[this.executor].waitUntil( async () => { - return await removeParticipantButton; + return await removeParticipantButton.waitForExist(); }, { timeout: 15000, @@ -348,7 +348,9 @@ export default class EditGroup extends UplinkMainScreen { const userLocator = await this.getParticipantContainerLocator(participant); await driver[this.executor].waitUntil( async () => { - return await userLocator.$(SELECTORS.PARTICIPANT_USER_INDICATOR_ONLINE); + return await userLocator + .$(SELECTORS.PARTICIPANT_USER_INDICATOR_ONLINE) + .waitForExist(); }, { timeout: 60000, @@ -440,7 +442,9 @@ export default class EditGroup extends UplinkMainScreen { async validateParticipantIndicatorOnline(username: string) { await driver[this.executor].waitUntil( async () => { - return await this.getParticipantIndicatorOnline(username); + return await this.getParticipantIndicatorOnline( + username, + ).waitForExist(); }, { timeout: 60000, diff --git a/tests/screenobjects/chats/EmojiSelector.ts b/tests/screenobjects/chats/EmojiSelector.ts index 730f1892a3d..678592bb23d 100644 --- a/tests/screenobjects/chats/EmojiSelector.ts +++ b/tests/screenobjects/chats/EmojiSelector.ts @@ -5,6 +5,7 @@ import { USER_A_INSTANCE, } from "@helpers/constants"; import UplinkMainScreen from "@screenobjects/UplinkMainScreen"; +const { mouse, Button } = require("@nut-tree/nut-js"); const currentOS = driver[USER_A_INSTANCE].capabilities.automationName; let SELECTORS = {}; @@ -72,6 +73,6 @@ export default class EmojiSelector extends UplinkMainScreen { .$(emojiLocator); } await this.hoverOnElement(emojiElement); - await emojiElement.click(); + await mouse.click(Button.LEFT); } } diff --git a/tests/screenobjects/chats/FavoritesSidebar.ts b/tests/screenobjects/chats/FavoritesSidebar.ts index 12d497f8456..bcfcf7f24c0 100644 --- a/tests/screenobjects/chats/FavoritesSidebar.ts +++ b/tests/screenobjects/chats/FavoritesSidebar.ts @@ -185,7 +185,10 @@ export default class FavoritesSidebar extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(SELECTORS.SLIMBAR).$(favoritesLocator); + return await this.instance + .$(SELECTORS.SLIMBAR) + .$(favoritesLocator) + .waitForExist(); }, { timeout: 15000, @@ -203,7 +206,9 @@ export default class FavoritesSidebar extends UplinkMainScreen { const favoriteLocator = await this.getFavoritesUserByAriaLabel(username); await driver[this.executor].waitUntil( async () => { - return await favoriteLocator.$(SELECTORS.FAVORITES_USER_IMAGE); + return await favoriteLocator + .$(SELECTORS.FAVORITES_USER_IMAGE) + .waitForExist(); }, { timeout: 15000, @@ -219,9 +224,9 @@ export default class FavoritesSidebar extends UplinkMainScreen { const favoriteLocator = await this.getFavoritesUserByAriaLabel(username); await driver[this.executor].waitUntil( async () => { - return await favoriteLocator.$( - SELECTORS.FAVORITES_USER_IMAGE_GROUP_WRAP, - ); + return await favoriteLocator + .$(SELECTORS.FAVORITES_USER_IMAGE_GROUP_WRAP) + .waitForExist(); }, { timeout: 15000, @@ -276,9 +281,9 @@ export default class FavoritesSidebar extends UplinkMainScreen { const favoriteLocator = await this.getFavoritesUserByAriaLabel(username); await driver[this.executor].waitUntil( async () => { - return await favoriteLocator.$( - SELECTORS.FAVORITES_USER_INDICATOR_ONLINE, - ); + return await favoriteLocator + .$(SELECTORS.FAVORITES_USER_INDICATOR_ONLINE) + .waitForExist(); }, { timeout: 60000, @@ -308,7 +313,7 @@ export default class FavoritesSidebar extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.contextMenu; + return await this.contextMenu.waitForExist(); }, { timeout: 15000, @@ -365,7 +370,7 @@ export default class FavoritesSidebar extends UplinkMainScreen { async validateFavoritesAreShown() { await driver[this.executor].waitUntil( async () => { - return await this.favorites; + return await this.favorites.waitForExist(); }, { timeout: 15000, diff --git a/tests/screenobjects/chats/MessageGroup.ts b/tests/screenobjects/chats/MessageGroup.ts index f40295e162d..8959b1d9ab5 100644 --- a/tests/screenobjects/chats/MessageGroup.ts +++ b/tests/screenobjects/chats/MessageGroup.ts @@ -300,7 +300,9 @@ export default class MessageGroup extends UplinkMainScreen { const lastGroupReceived = await this.getLastReceivedGroup(); await driver[this.executor].waitUntil( async () => { - return await lastGroupReceived.$(SELECTORS.PIN_INDICATOR); + return await lastGroupReceived + .$(SELECTORS.PIN_INDICATOR) + .waitForExist(); }, { timeout: 15000, @@ -334,7 +336,7 @@ export default class MessageGroup extends UplinkMainScreen { const lastGroupSent = await this.getLastSentGroup(); await driver[this.executor].waitUntil( async () => { - return await lastGroupSent.$(SELECTORS.PIN_INDICATOR); + return await lastGroupSent.$(SELECTORS.PIN_INDICATOR).waitForExist(); }, { timeout: 15000, @@ -468,7 +470,7 @@ export default class MessageGroup extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(emojiReactionLocator); + return await this.instance.$(emojiReactionLocator).waitForExist(); }, { timeout: 60000, @@ -494,7 +496,7 @@ export default class MessageGroup extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(emojiReactionLocator); + return await this.instance.$(emojiReactionLocator).waitForExist(); }, { timeout: 15000, diff --git a/tests/screenobjects/chats/Messages.ts b/tests/screenobjects/chats/Messages.ts index 649a8fd3c1e..8a85496cb07 100644 --- a/tests/screenobjects/chats/Messages.ts +++ b/tests/screenobjects/chats/Messages.ts @@ -352,7 +352,7 @@ export default class Messages extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(locator); + return await this.instance.$(locator).waitForExist(); }, { timeout: 60000, @@ -413,7 +413,7 @@ export default class Messages extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(codeMessageLocator); + return await this.instance.$(codeMessageLocator).waitForExist(); }, { timeout: 15000, @@ -467,7 +467,7 @@ export default class Messages extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(linkSentLocator); + return await this.instance.$(linkSentLocator).waitForExist(); }, { timeout: 15000, @@ -493,7 +493,7 @@ export default class Messages extends UplinkMainScreen { } await driver[this.executor].waitUntil( async () => { - return await this.instance.$(messageSentLocator); + return await this.instance.$(messageSentLocator).waitForExist(); }, { timeout: 15000, @@ -519,7 +519,7 @@ export default class Messages extends UplinkMainScreen { await driver[this.executor].waitUntil( async () => { - return await this.instance.$(codeMessageReceivedLocator); + return await this.instance.$(codeMessageReceivedLocator).waitForExist(); }, { timeout: 60000, @@ -545,7 +545,7 @@ export default class Messages extends UplinkMainScreen { await driver[this.executor].waitUntil( async () => { - return await this.instance.$(linkReceivedLocator); + return await this.instance.$(linkReceivedLocator).waitForExist(); }, { timeout: 60000, @@ -571,7 +571,7 @@ export default class Messages extends UplinkMainScreen { await driver[this.executor].waitUntil( async () => { - return await this.instance.$(receivedMessageLocator); + return await this.instance.$(receivedMessageLocator).waitForExist(); }, { timeout: 60000, @@ -646,7 +646,7 @@ export default class Messages extends UplinkMainScreen { await driver[this.executor].waitUntil( async () => { - return await this.instance.$(messageSentLocator); + return await this.instance.$(messageSentLocator).waitForExist(); }, { timeout: 15000, diff --git a/tests/screenobjects/chats/Topbar.ts b/tests/screenobjects/chats/Topbar.ts index 9b3cc74d6fc..2428227967c 100644 --- a/tests/screenobjects/chats/Topbar.ts +++ b/tests/screenobjects/chats/Topbar.ts @@ -229,7 +229,7 @@ export default class Topbar extends UplinkMainScreen { await topbarAddToFavorites.click(); await driver[this.executor].waitUntil( async () => { - return await this.topbarRemoveFromFavorites; + return await this.topbarRemoveFromFavorites.waitForExist(); }, { timeout: 15000, @@ -295,7 +295,7 @@ export default class Topbar extends UplinkMainScreen { async validateTopbarIndicatorOnline() { await driver[this.executor].waitUntil( async () => { - return await this.topbarIndicatorOnline; + return await this.topbarIndicatorOnline.waitForExist(); }, { timeout: 60000, @@ -321,7 +321,7 @@ export default class Topbar extends UplinkMainScreen { async validateTopbarUserImage() { await driver[this.executor].waitUntil( async () => { - return await this.topbarUserImage; + return await this.topbarUserImage.waitForExist(); }, { timeout: 15000, @@ -334,7 +334,7 @@ export default class Topbar extends UplinkMainScreen { async validateTopbarExists() { await driver[this.executor].waitUntil( async () => { - return await this.topbar; + return await this.topbar.waitForExist(); }, { timeout: 15000, @@ -346,7 +346,7 @@ export default class Topbar extends UplinkMainScreen { async waitUntilRemoteUserIsOnline() { await driver[this.executor].waitUntil( async () => { - return await this.topbarIndicatorOnline; + return await this.topbarIndicatorOnline.waitForExist(); }, { timeout: 60000, diff --git a/tests/screenobjects/friends/FriendsScreen.ts b/tests/screenobjects/friends/FriendsScreen.ts index 96a3815afbc..d435cdf2337 100644 --- a/tests/screenobjects/friends/FriendsScreen.ts +++ b/tests/screenobjects/friends/FriendsScreen.ts @@ -611,7 +611,9 @@ export default class FriendsScreen extends UplinkMainScreen { const userLocator = await this.getExistingFriendByAriaLabel(username); await driver[this.executor].waitUntil( async () => { - return await userLocator.$(SELECTORS.FRIEND_USER_INDICATOR_ONLINE); + return await userLocator + .$(SELECTORS.FRIEND_USER_INDICATOR_ONLINE) + .waitForExist(); }, { timeout: 60000, @@ -725,7 +727,8 @@ export default class FriendsScreen extends UplinkMainScreen { async () => { return await this.instance .$(SELECTORS.FRIENDS_LIST) - .$(SELECTORS.FRIEND_INFO_USERNAME); + .$(SELECTORS.FRIEND_INFO_USERNAME) + .waitForExist(); }, { timeout: 60000, @@ -745,7 +748,8 @@ export default class FriendsScreen extends UplinkMainScreen { async () => { return await this.instance .$(SELECTORS.BLOCKED_LIST) - .$(SELECTORS.FRIEND_INFO_USERNAME); + .$(SELECTORS.FRIEND_INFO_USERNAME) + .waitForExist(); }, { timeout: 60000, @@ -769,7 +773,7 @@ export default class FriendsScreen extends UplinkMainScreen { // Wait until incoming list is not empty await driver[this.executor].waitUntil( async () => { - return await this.chatWithFriendButton; + return await this.chatWithFriendButton.waitForExist(); }, { timeout: 60000, @@ -794,7 +798,8 @@ export default class FriendsScreen extends UplinkMainScreen { async () => { return await this.instance .$(SELECTORS.INCOMING_REQUESTS_LIST) - .$(SELECTORS.FRIEND_INFO_USERNAME); + .$(SELECTORS.FRIEND_INFO_USERNAME) + .waitForExist(); }, { timeout: 60000, @@ -826,7 +831,8 @@ export default class FriendsScreen extends UplinkMainScreen { async () => { return await this.instance .$(SELECTORS.OUTGOING_REQUESTS_LIST) - .$(SELECTORS.FRIEND_INFO_USERNAME); + .$(SELECTORS.FRIEND_INFO_USERNAME) + .waitForExist(); }, { timeout: 60000, @@ -861,7 +867,7 @@ export default class FriendsScreen extends UplinkMainScreen { async waitUntilFriendRequestIsReceived() { await driver[this.executor].waitUntil( async () => { - return await this.acceptFriendRequestButton; + return await this.acceptFriendRequestButton.waitForExist(); }, { timeout: 240000, @@ -874,7 +880,7 @@ export default class FriendsScreen extends UplinkMainScreen { async waitUntilUserAcceptedFriendRequest() { await driver[this.executor].waitUntil( async () => { - return await this.chatWithFriendButton; + return await this.chatWithFriendButton.waitForExist(); }, { timeout: 240000, @@ -888,7 +894,7 @@ export default class FriendsScreen extends UplinkMainScreen { const user = await this.getExistingFriendByAriaLabel(username); await driver[this.executor].waitUntil( async () => { - return await user.$(SELECTORS.FRIEND_INFO_USERNAME); + return await user.$(SELECTORS.FRIEND_INFO_USERNAME).waitForExist(); }, { timeout: 60000,