From 194eefdd7c45abfacb5117f05470e903e30e6926 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 14:03:32 -0600 Subject: [PATCH] chore(appium): just attempt the first set of tests --- config/macos-chats/wdio.mac.chatA.conf.ts | 10 ++++ config/macos-chats/wdio.mac.chatB.conf.ts | 10 ++++ tests/screenobjects/friends/FriendsScreen.ts | 49 ++++++++++---------- tests/suites/Chats/02-ChatsUserA.suite.ts | 20 ++++---- tests/suites/Chats/03-ChatsUserB.suite.ts | 18 +++---- 5 files changed, 63 insertions(+), 44 deletions(-) diff --git a/config/macos-chats/wdio.mac.chatA.conf.ts b/config/macos-chats/wdio.mac.chatA.conf.ts index e55d334985..46654d33e6 100644 --- a/config/macos-chats/wdio.mac.chatA.conf.ts +++ b/config/macos-chats/wdio.mac.chatA.conf.ts @@ -32,6 +32,16 @@ export const config: WebdriverIO.Config = { // 'path/to/excluded/files' ], specFileRetries: 0, + // Options to be passed to Mocha. + mochaOpts: { + ui: "bdd", + /** + * NOTE: This has been increased for more stable Appium Native app + * tests because they can take a bit longer. + */ + timeout: 300000, // 5min + bail: true, + }, // // ============ // Capabilities diff --git a/config/macos-chats/wdio.mac.chatB.conf.ts b/config/macos-chats/wdio.mac.chatB.conf.ts index 2b83c739ab..a4c628fbc4 100644 --- a/config/macos-chats/wdio.mac.chatB.conf.ts +++ b/config/macos-chats/wdio.mac.chatB.conf.ts @@ -33,6 +33,16 @@ export const config: WebdriverIO.Config = { // 'path/to/excluded/files' ], specFileRetries: 0, + // Options to be passed to Mocha. + mochaOpts: { + ui: "bdd", + /** + * NOTE: This has been increased for more stable Appium Native app + * tests because they can take a bit longer. + */ + timeout: 300000, // 5min + bail: true, + }, // // ============ // Capabilities diff --git a/tests/screenobjects/friends/FriendsScreen.ts b/tests/screenobjects/friends/FriendsScreen.ts index 1a66f36321..afbeafb3c8 100644 --- a/tests/screenobjects/friends/FriendsScreen.ts +++ b/tests/screenobjects/friends/FriendsScreen.ts @@ -13,7 +13,7 @@ import { } from "@helpers/commands"; const currentOS = driver[USER_A_INSTANCE].capabilities.automationName; -const {keyboard, Key} = require("@nut-tree/nut-js"); +const { keyboard, Key } = require("@nut-tree/nut-js"); let SELECTORS = {}; @@ -368,7 +368,7 @@ export default class FriendsScreen extends UplinkMainScreen { async acceptIncomingRequest(name: string) { const friendToClick = await this.getExistingFriendByAriaLabel(name); const acceptButton = await friendToClick.$( - SELECTORS.ACCEPT_FRIEND_REQUEST_BUTTON + SELECTORS.ACCEPT_FRIEND_REQUEST_BUTTON, ); await acceptButton.click(); } @@ -578,7 +578,7 @@ export default class FriendsScreen extends UplinkMainScreen { async getUserImageProfile(username: string) { const userLocator = await this.getExistingFriendByAriaLabel(username); const userImageProfile = await userLocator.$( - SELECTORS.FRIEND_USER_IMAGE_PROFILE + SELECTORS.FRIEND_USER_IMAGE_PROFILE, ); await userImageProfile.waitForExist(); return userImageProfile; @@ -601,7 +601,7 @@ export default class FriendsScreen extends UplinkMainScreen { async getUserIndicatorOffline(username: string) { const userLocator = await this.getExistingFriendByAriaLabel(username); const indicatorOffline = await userLocator.$( - SELECTORS.FRIEND_USER_INDICATOR_OFFLINE + SELECTORS.FRIEND_USER_INDICATOR_OFFLINE, ); await indicatorOffline.waitForExist(); return indicatorOffline; @@ -617,10 +617,10 @@ export default class FriendsScreen extends UplinkMainScreen { timeout: 15000, timeoutMsg: "Expected indicator online was never displayed on Friends Screen User after 15 seconds", - } + }, ); const indicatorOnline = await userLocator.$( - SELECTORS.FRIEND_USER_INDICATOR_ONLINE + SELECTORS.FRIEND_USER_INDICATOR_ONLINE, ); return indicatorOnline; } @@ -664,7 +664,7 @@ export default class FriendsScreen extends UplinkMainScreen { async hoverOnBlockButton(username: string) { const userLocator = await this.getExistingFriendByAriaLabel(username); const secondButtonLocator = await userLocator.$( - SELECTORS.BLOCK_FRIEND_BUTTON + SELECTORS.BLOCK_FRIEND_BUTTON, ); await this.hoverOnElement(secondButtonLocator); } @@ -677,7 +677,7 @@ export default class FriendsScreen extends UplinkMainScreen { async hoverOnChatWithFriendButton(username: string) { const userLocator = await this.getExistingFriendByAriaLabel(username); const buttonLocator = await userLocator.$( - SELECTORS.CHAT_WITH_FRIEND_BUTTON + SELECTORS.CHAT_WITH_FRIEND_BUTTON, ); await this.hoverOnElement(buttonLocator); } @@ -690,7 +690,7 @@ export default class FriendsScreen extends UplinkMainScreen { async hoverOnUnfriendDenyUnblockButton(username: string) { const userLocator = await this.getExistingFriendByAriaLabel(username); const firstButtonLocator = await userLocator.$( - SELECTORS.REMOVE_OR_DENY_FRIEND_BUTTON + SELECTORS.REMOVE_OR_DENY_FRIEND_BUTTON, ); await this.hoverOnElement(firstButtonLocator); } @@ -714,7 +714,7 @@ export default class FriendsScreen extends UplinkMainScreen { async removeOrCancelUser(name: string) { const friendToClick = await this.getExistingFriendByAriaLabel(name); const removeOrDenyButton = await friendToClick.$( - SELECTORS.REMOVE_OR_DENY_FRIEND_BUTTON + SELECTORS.REMOVE_OR_DENY_FRIEND_BUTTON, ); await removeOrDenyButton.click(); } @@ -730,7 +730,7 @@ export default class FriendsScreen extends UplinkMainScreen { { timeout: 15000, timeoutMsg: "All friends list never shown any records after 15 seconds", - } + }, ); } @@ -751,7 +751,7 @@ export default class FriendsScreen extends UplinkMainScreen { timeout: 15000, timeoutMsg: "Blocked friends list never shown any records after 15 seconds", - } + }, ); } @@ -787,7 +787,7 @@ export default class FriendsScreen extends UplinkMainScreen { timeout: 15000, timeoutMsg: "Incoming friends list never shown any records after 15 seconds", - } + }, ); } @@ -819,7 +819,7 @@ export default class FriendsScreen extends UplinkMainScreen { timeout: 15000, timeoutMsg: "Expected friend list never shown any records after 15 seconds", - } + }, ); } @@ -835,11 +835,10 @@ export default class FriendsScreen extends UplinkMainScreen { async waitUntilFriendIsRemoved( username: string, - timeoutUser: number = 30000 + timeoutUser: number = 30000, ) { - const nonExistingFriend = await this.getNonExistingFriendByAriaLabel( - username - ); + const nonExistingFriend = + await this.getNonExistingFriendByAriaLabel(username); await this.instance .$(SELECTORS.FRIENDS_BODY) .$(nonExistingFriend) @@ -852,10 +851,10 @@ export default class FriendsScreen extends UplinkMainScreen { return await this.acceptFriendRequestButton; }, { - timeout: 15000, + timeout: 240000, timeoutMsg: - "Expected Accept Friend Request button was never displayed on Friends Screen after 15 seconds", - } + "Expected Accept Friend Request button was never displayed on Friends Screen after 4 minutes", + }, ); } @@ -865,10 +864,10 @@ export default class FriendsScreen extends UplinkMainScreen { return await this.chatWithFriendButton; }, { - timeout: 15000, + timeout: 240000, timeoutMsg: - "Expected Chat With Friend button was never displayed on Friends Screen after 15 seconds", - } + "Expected Chat With Friend button was never displayed on Friends Screen after 4 minutes", + }, ); } @@ -882,7 +881,7 @@ export default class FriendsScreen extends UplinkMainScreen { timeout: 15000, timeoutMsg: "Expected Username was never displayed on Friends Screen after 15 seconds", - } + }, ); } diff --git a/tests/suites/Chats/02-ChatsUserA.suite.ts b/tests/suites/Chats/02-ChatsUserA.suite.ts index b9694a554f..a7d7703b70 100644 --- a/tests/suites/Chats/02-ChatsUserA.suite.ts +++ b/tests/suites/Chats/02-ChatsUserA.suite.ts @@ -13,14 +13,14 @@ import groupChatSidebarTestsUserA from "@specs/reusable-accounts/ChatUserA/11-gr describe("MacOS Chats Tests - User A", async () => { describe("Accept friend request and Chat", mainChatsTestsUserA.bind(this)); - describe("Chat Replies", repliesTestsUserA.bind(this)); - describe("Message Context Menu", messageContextMenuTestsUserA.bind(this)); - describe("Message Input", messageInputTestsUserA.bind(this)); - describe("Message Attachments", messageAttachmentsTestsUserA.bind(this)); - describe("Chat Topbar", chatTopbarTestsUserA.bind(this)); - describe("Quick Profile", quickProfileTestsUserA.bind(this)); - describe("Sidebar Chats", sidebarChatsTestsUserA.bind(this)); - describe("Group Chats Main", groupChatTestsUserA.bind(this)); - describe("Group Chats Edit", groupChatEditTestsUserA.bind(this)); - describe("Group Chats Sidebar", groupChatSidebarTestsUserA.bind(this)); + xdescribe("Chat Replies", repliesTestsUserA.bind(this)); + xdescribe("Message Context Menu", messageContextMenuTestsUserA.bind(this)); + xdescribe("Message Input", messageInputTestsUserA.bind(this)); + xdescribe("Message Attachments", messageAttachmentsTestsUserA.bind(this)); + xdescribe("Chat Topbar", chatTopbarTestsUserA.bind(this)); + xdescribe("Quick Profile", quickProfileTestsUserA.bind(this)); + xdescribe("Sidebar Chats", sidebarChatsTestsUserA.bind(this)); + xdescribe("Group Chats Main", groupChatTestsUserA.bind(this)); + xdescribe("Group Chats Edit", groupChatEditTestsUserA.bind(this)); + xdescribe("Group Chats Sidebar", groupChatSidebarTestsUserA.bind(this)); }); diff --git a/tests/suites/Chats/03-ChatsUserB.suite.ts b/tests/suites/Chats/03-ChatsUserB.suite.ts index 5b8b5e20b5..2428d32ef2 100644 --- a/tests/suites/Chats/03-ChatsUserB.suite.ts +++ b/tests/suites/Chats/03-ChatsUserB.suite.ts @@ -12,13 +12,13 @@ import groupChatSidebarTestsUserB from "@specs/reusable-accounts/ChatUserB/10-gr describe("MacOS Chats Tests - User B", async () => { describe("Send friend request and Chat", mainChatsTestsUserB.bind(this)); - describe("Chat Replies", repliesTestsUserB.bind(this)); - describe("Message Context Menu", messageContextMenuTestsUserB.bind(this)); - describe("Message Input", messageInputTestsUserB.bind(this)); - describe("Message Attachments", messageAttachmentsTestsUserB.bind(this)); - describe("Quick Profile", quickProfileTestsUserB.bind(this)); - describe("Sidebar Chats", sidebarChatsTestsUserB.bind(this)); - describe("Group Chats Main", groupChatTestsUserB.bind(this)); - describe("Group Chats Edit", groupChatEditTestsUserB.bind(this)); - describe("Group Chats Sidebar", groupChatSidebarTestsUserB.bind(this)); + xdescribe("Chat Replies", repliesTestsUserB.bind(this)); + xdescribe("Message Context Menu", messageContextMenuTestsUserB.bind(this)); + xdescribe("Message Input", messageInputTestsUserB.bind(this)); + xdescribe("Message Attachments", messageAttachmentsTestsUserB.bind(this)); + xdescribe("Quick Profile", quickProfileTestsUserB.bind(this)); + xdescribe("Sidebar Chats", sidebarChatsTestsUserB.bind(this)); + xdescribe("Group Chats Main", groupChatTestsUserB.bind(this)); + xdescribe("Group Chats Edit", groupChatEditTestsUserB.bind(this)); + xdescribe("Group Chats Sidebar", groupChatSidebarTestsUserB.bind(this)); });