Skip to content

Commit

Permalink
chore(appium): just attempt the first set of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Nov 6, 2023
1 parent 5b1ab56 commit 194eefd
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 44 deletions.
10 changes: 10 additions & 0 deletions config/macos-chats/wdio.mac.chatA.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions config/macos-chats/wdio.mac.chatB.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 24 additions & 25 deletions tests/screenobjects/friends/FriendsScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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();
}
Expand All @@ -730,7 +730,7 @@ export default class FriendsScreen extends UplinkMainScreen {
{
timeout: 15000,
timeoutMsg: "All friends list never shown any records after 15 seconds",
}
},
);
}

Expand All @@ -751,7 +751,7 @@ export default class FriendsScreen extends UplinkMainScreen {
timeout: 15000,
timeoutMsg:
"Blocked friends list never shown any records after 15 seconds",
}
},
);
}

Expand Down Expand Up @@ -787,7 +787,7 @@ export default class FriendsScreen extends UplinkMainScreen {
timeout: 15000,
timeoutMsg:
"Incoming friends list never shown any records after 15 seconds",
}
},
);
}

Expand Down Expand Up @@ -819,7 +819,7 @@ export default class FriendsScreen extends UplinkMainScreen {
timeout: 15000,
timeoutMsg:
"Expected friend list never shown any records after 15 seconds",
}
},
);
}

Expand All @@ -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)
Expand All @@ -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",
},
);
}

Expand All @@ -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",
},
);
}

Expand All @@ -882,7 +881,7 @@ export default class FriendsScreen extends UplinkMainScreen {
timeout: 15000,
timeoutMsg:
"Expected Username was never displayed on Friends Screen after 15 seconds",
}
},
);
}

Expand Down
20 changes: 10 additions & 10 deletions tests/suites/Chats/02-ChatsUserA.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
18 changes: 9 additions & 9 deletions tests/suites/Chats/03-ChatsUserB.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});

0 comments on commit 194eefd

Please sign in to comment.