Skip to content

Commit

Permalink
Merge branch 'dev' into luis/attachement
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm authored Nov 14, 2023
2 parents 6cdcbce + ef8d15c commit f417c32
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 39 deletions.
11 changes: 10 additions & 1 deletion config/wdio.mac.multiremote.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,14 @@ export const config: WebdriverIO.Config = {
]);
}
}
}
},

afterSuite: async function (suite) {
// Close second application if open
await driver[USER_A_INSTANCE].executeScript("macos: terminateApp", [
{
bundleId: MACOS_USER_B_BUNDLE_ID,
},
]);
},
}
2 changes: 1 addition & 1 deletion tests/helpers/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ export async function selectFileOnWindows(

// Wait for Save Panel to be displayed
const listView = await driver[instance].$("~listview");
await listView.waitForExist();
await listView.waitForExist({ timeout: 25000 });

// Type file location and hit enter
const editField = await driver[instance].$("//Window/ComboBox/Edit");
Expand Down
14 changes: 13 additions & 1 deletion tests/screenobjects/account-creation/CreateUserScreen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import "module-alias/register";
import UplinkMainScreen from "@screenobjects/UplinkMainScreen";
import { USER_A_INSTANCE, WINDOWS_DRIVER } from "@helpers/constants";
import {
MACOS_DRIVER,
USER_A_INSTANCE,
WINDOWS_DRIVER,
} from "@helpers/constants";

const currentOS = driver[USER_A_INSTANCE].capabilities.automationName;
let SELECTORS = {};
Expand Down Expand Up @@ -52,8 +56,16 @@ export default class CreateUserScreen extends UplinkMainScreen {
}

async enterUsername(username: string) {
const currentDriver = await this.getCurrentDriver();
const usernameInput = await this.usernameInput;
await usernameInput.clearValue();
await usernameInput.setValue(username);
if (currentDriver === MACOS_DRIVER) {
const usernameInputValue = await usernameInput.getValue();
if (usernameInputValue !== username) {
await this.enterUsername(username);
}
}
}

async clickOnCreateAccount() {
Expand Down
46 changes: 24 additions & 22 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 @@ -407,9 +407,12 @@ export default class FriendsScreen extends UplinkMainScreen {

async enterFriendDidKey(didkey: string) {
const addSomeoneInput = await this.addSomeoneInput;
await addSomeoneInput.click();
await addSomeoneInput.clearValue();
await addSomeoneInput.setValue(didkey);
const addSomeoneInputText = await addSomeoneInput.getText();
if (addSomeoneInputText !== didkey) {
await this.enterFriendDidKey(didkey);
}
}

async enterCopiedID() {
Expand Down Expand Up @@ -578,7 +581,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 +604,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 +620,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 +667,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 +680,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 +693,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 +717,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 +733,7 @@ export default class FriendsScreen extends UplinkMainScreen {
{
timeout: 15000,
timeoutMsg: "All friends list never shown any records after 15 seconds",
}
},
);
}

Expand All @@ -751,7 +754,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 +790,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 +822,7 @@ export default class FriendsScreen extends UplinkMainScreen {
timeout: 15000,
timeoutMsg:
"Expected friend list never shown any records after 15 seconds",
}
},
);
}

Expand All @@ -835,11 +838,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 @@ -855,7 +857,7 @@ export default class FriendsScreen extends UplinkMainScreen {
timeout: 15000,
timeoutMsg:
"Expected Accept Friend Request button was never displayed on Friends Screen after 15 seconds",
}
},
);
}

Expand All @@ -868,7 +870,7 @@ export default class FriendsScreen extends UplinkMainScreen {
timeout: 15000,
timeoutMsg:
"Expected Chat With Friend button was never displayed on Friends Screen after 15 seconds",
}
},
);
}

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

Expand Down
6 changes: 4 additions & 2 deletions tests/specs/03-files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,13 @@ export default async function files() {
// Wait until progress indicator disappears
await filesScreenFirstUser.uploadFileIndicatorProgress.waitForExist({
reverse: true,
timeout: 60000,
});

// Once that progress indicator disappears, validate that file is loaded
await filesScreenFirstUser.validateFileOrFolderExist(
"app-macos.zip",
60000,
30000,
);

// Finally, ensure that file size indicators are updated
Expand All @@ -221,12 +222,13 @@ export default async function files() {
// Wait until progress indicator disappears
await filesScreenFirstUser.uploadFileIndicatorProgress.waitForExist({
reverse: true,
timeout: 60000,
});

// Once that progress indicator disappears, validate that file is loaded and is automatically renamed to avoid name conflicts
await filesScreenFirstUser.validateFileOrFolderExist(
"app-macos (1).zip",
60000,
30000,
);
});

Expand Down
12 changes: 0 additions & 12 deletions tests/specs/reusable-accounts/04-message-input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,6 @@ export default async function messageInputTests() {
);
});

it("Chat Input Text - Validate text starting with http:// is sent as link", async () => {
// With Chat User A
await chatsInputFirstUser.typeMessageOnInput("http://www.microsoft.com");
await chatsInputFirstUser.clickOnSendMessage();
await chatsMessagesFirstUser.waitForLinkSentToExist(
"http://www.microsoft.com",
);
});

it("Chat Input Text - Validate text starting with www. is sent as link", async () => {
// With Chat User A
await chatsInputFirstUser.typeMessageOnInput("www.apple.com");
Expand Down Expand Up @@ -153,9 +144,6 @@ export default async function messageInputTests() {
await activateSecondApplication();
await chatsMessagesFirstUser.waitForReceivingLink("https://www.google.com");

// With Chat User B, validate message with URL starting with http:// was received as link
await chatsMessagesFirstUser.waitForReceivingLink("http://www.google.com");

// With Chat User B, validate message with URL starting with www. was received as link
await chatsMessagesFirstUser.waitForReceivingLink("www.apple.com");
});
Expand Down

0 comments on commit f417c32

Please sign in to comment.