Skip to content

Commit

Permalink
Merge branch 'dev' into luis/appium-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm authored Nov 11, 2023
2 parents 4af9e04 + eecb04a commit b00d2f5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 39 deletions.
17 changes: 15 additions & 2 deletions tests/screenobjects/chats/ContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const SELECTORS_COMMON = {};
const SELECTORS_WINDOWS = {
CONTEXT_MENU: '[name="Context Menu"]',
CONTEXT_MESSAGES_CANCEL_EDIT: '[name="messages-cancel-edit"]',
CONTEXT_MESSAGES_COPY: '[name="messages-copy"]',
CONTEXT_MESSAGES_DELETE: '[name="messages-delete"]',
CONTEXT_MESSAGES_EDIT: '[name="messages-edit"]',
CONTEXT_MESSAGES_PIN: '[name="messages-pin"]',
Expand All @@ -26,6 +27,7 @@ const SELECTORS_WINDOWS = {
const SELECTORS_MACOS = {
CONTEXT_MENU: "~Context Menu",
CONTEXT_MESSAGES_CANCEL_EDIT: "~messages-cancel-edit",
CONTEXT_MESSAGES_COPY: "~messages-copy",
CONTEXT_MESSAGES_DELETE: "~messages-delete",
CONTEXT_MESSAGES_EDIT: "~messages-edit",
CONTEXT_MESSAGES_PIN: "~messages-pin",
Expand Down Expand Up @@ -54,6 +56,12 @@ export default class ContextMenu extends UplinkMainScreen {
.$(SELECTORS.CONTEXT_MESSAGES_CANCEL_EDIT);
}

get contextMessagesCopy() {
return this.instance
.$(SELECTORS.CONTEXT_MENU)
.$(SELECTORS.CONTEXT_MESSAGES_COPY);
}

get contextMessagesDelete() {
return this.instance
.$(SELECTORS.CONTEXT_MENU)
Expand Down Expand Up @@ -152,11 +160,11 @@ export default class ContextMenu extends UplinkMainScreen {
locator = await this.instance.$(
'//XCUIElementTypeGroup[@label="Context Menu"]/XCUIElementTypeButton[@Value="' +
reaction +
'"]'
'"]',
);
} else if (currentDriver === WINDOWS_DRIVER) {
locator = await this.instance.$(
'//Group[@Name="Context Menu"]/Button[@Name="' + reaction + '"]'
'//Group[@Name="Context Menu"]/Button[@Name="' + reaction + '"]',
);
}
await locator.click();
Expand All @@ -178,6 +186,11 @@ export default class ContextMenu extends UplinkMainScreen {
await contextMessagesCancelEdit.click();
}

async selectContextOptionCopy() {
const contextMessagesCopy = await this.contextMessagesCopy;
await contextMessagesCopy.click();
}

async selectContextOptionDelete() {
const contextMessagesDelete = await this.contextMessagesDelete;
await contextMessagesDelete.click();
Expand Down
4 changes: 3 additions & 1 deletion tests/screenobjects/chats/InputBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ export default class InputBar extends UplinkMainScreen {
if (inputTextValueLanguage.includes("```" + language) === false) {
await this.typeCodeOnInputBar(language, codeToType);
} else {
await keyboard.type(Key.LeftShift, Key.Enter);
await keyboard.pressKey(Key.LeftShift);
await keyboard.type(Key.Enter);
await keyboard.releaseKey(Key.LeftShift);
await inputText.addValue(codeToType);
const inputTextValueCode = await inputText.getText();
if (inputTextValueCode.includes(codeToType) === false) {
Expand Down
31 changes: 6 additions & 25 deletions tests/screenobjects/chats/ReplyPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ const SELECTORS_MACOS = {
REPLY_POPUP_INDICATOR_ONLINE: "~indicator-online",
REPLY_POPUP_LOCAL_TEXT_TO_REPLY: "~reply-text-message",
REPLY_POPUP_LOCAL_TEXT_TO_REPLY_VALUE:
"-ios class chain:**/XCUIElementTypeStaticText",
"-ios class chain:**/XCUIElementTypeGroup/XCUIElementTypeStaticText",
REPLY_POPUP_REMOTE_TEXT_TO_REPLY: "~reply-text-message-remote",
REPLY_POPUP_REMOTE_TEXT_TO_REPLY_VALUE:
"-ios class chain:**/XCUIElementTypeStaticText",
"-ios class chain:**/XCUIElementTypeGroup/XCUIElementTypeStaticText",
REPLY_POPUP_USER_IMAGE: "~User Image",
REPLY_POPUP_USER_IMAGE_PROFILE: "~user-image-profile",
REPLY_POPUP_USER_IMAGE_WRAP: "~user-image-wrap",
Expand Down Expand Up @@ -152,28 +152,9 @@ export default class ReplyPrompt extends UplinkMainScreen {
await replyPopUpCloseButton.waitForExist();
await replyPopUpUserImage.waitForExist();
await replyPopUpIndicator.waitForExist();
await driver[this.executor].waitUntil(
async () => {
return (await this.replyPopUpHeader.getText()) === "REPLYING TO:";
},
{
timeout: 15000,
timeoutMsg:
"Expected reply prompt header was incorrect after 15 seconds",
}
);

await driver[this.executor].waitUntil(
async () => {
return (
(await this.replyPopUpRemoteTextToReplyValue.getText()) === message
);
},
{
timeout: 15000,
timeoutMsg:
"Expected reply prompt header text to reply was incorrect after 15 seconds",
}
await expect(this.replyPopUpHeader).toHaveTextContaining("REPLYING TO:");
await expect(this.replyPopUpRemoteTextToReplyValue).toHaveTextContaining(
message,
);
}

Expand All @@ -185,7 +166,7 @@ export default class ReplyPrompt extends UplinkMainScreen {
{
timeout: 15000,
timeoutMsg: "Expected reply modal is still visible after 15 seconds",
}
},
);
}
}
22 changes: 14 additions & 8 deletions tests/specs/reusable-accounts/04-message-input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let chatsMessagesFirstUser = new Messages(USER_A_INSTANCE);
export default async function messageInputTests() {
it("Chat User A - Message Input - User cannot send empty messages", async () => {
// Ensure that input bar is empty and click on send message button
await chatsInputFirstUser.switchToOtherUserWindow();
await activateFirstApplication();
await chatsInputFirstUser.clearInputBar();
await chatsInputFirstUser.clickOnInputBar();
await chatsInputFirstUser.clickOnSendMessage();
Expand All @@ -29,7 +29,8 @@ export default async function messageInputTests() {
await expect(textMessage).toHaveTextContaining("Two...");
});

it("Chat User A - Message Input - User can type up to 1024 chars on input bar", async () => {
// Skipping Test Failing on CI
xit("Chat User A - Message Input - User can type up to 1024 chars on input bar", async () => {
// Generate a random text with 1024 chars
const longText = await chatsInputFirstUser.generateRandomText();
// Type long text with 1024 chars on input bar and attempt to add 4 more chars (efgh)
Expand Down Expand Up @@ -58,9 +59,10 @@ export default async function messageInputTests() {
await chatsMessagesFirstUser.waitForMessageSentToExist("Bolds2");
});

it("Chat Input Text - Validate users can send messages using the code language markdown", async () => {
// Needs research to implement on MacOS
xit("Chat Input Text - Validate users can send messages using the code language markdown", async () => {
// With Chat User A, send a code snippet with JavaScript language
await chatsInputFirstUser.typeCodeOnInputBar("JavaScript", "let a = 1;");
await chatsInputFirstUser.typeCodeOnInputBar("javascript", "let a = 1;");
await chatsInputFirstUser.clickOnSendMessage();

// With Chat User A, validate code message was sent and is displayed correctly
Expand All @@ -70,7 +72,8 @@ export default async function messageInputTests() {
await expect(codeMessageTextSent).toEqual("let a = 1;");
});

it("Chat Input Text - Code Markdown - User can copy the message from the code block", async () => {
// Needs research to implement on MacOS
xit("Chat Input Text - Code Markdown - User can copy the message from the code block", async () => {
// With Chat User A, click on the copy button from code block of last chat message sent
await chatsMessagesFirstUser.clickOnCopyCodeOfLastMessageSent();

Expand All @@ -91,7 +94,8 @@ export default async function messageInputTests() {
await chatsMessagesFirstUser.waitForReceivingMessage("Bolds2");
});

it("Chat Input Text - Validate message with code markdown is received in expected format", async () => {
// Needs research to implement on MacOS
xit("Chat Input Text - Validate message with code markdown is received in expected format", async () => {
// With Chat User B, validate code message was received and is displayed correctly
await chatsMessagesFirstUser.waitForReceivingCodeMessage("JavaScript");
const codeMessageTextReceived =
Expand Down Expand Up @@ -177,7 +181,8 @@ export default async function messageInputTests() {
await linkEmbedReceivedIconTitle.waitForExist();
});

it("Typing Indicator - Send a long message to trigger typing indicator on remote side", async () => {
// Test failing on CI
xit("Typing Indicator - Send a long message to trigger typing indicator on remote side", async () => {
// With User A
await activateFirstApplication();
// Generate a random text with 100 chars
Expand All @@ -186,7 +191,8 @@ export default async function messageInputTests() {
await chatsInputFirstUser.typeMessageOnInput(shortText + "efgh");
});

it("Validate Typing Indicator is displayed if remote user is typing", async () => {
// Test failing on CI
xit("Validate Typing Indicator is displayed if remote user is typing", async () => {
// Switch to second user and validate that Typing Indicator is displayed
await activateSecondApplication();
await chatsLayoutFirstUser.typingIndicator.waitForExist({
Expand Down
6 changes: 3 additions & 3 deletions tests/suites/Chats/01-Chats.suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ describe("MacOS Chats Tests", function () {
"Create Accounts and Chat Tests",
createChatAccountsTests.bind(this),
);
xdescribe("Chat Replies Tests", repliesTests.bind(this));
xdescribe("Message Context Menu Tests", messageContextMenuTests.bind(this));
xdescribe("Message Input Tests", messageInputTests.bind(this));
describe("Chat Replies Tests", repliesTests.bind(this));
describe("Message Context Menu Tests", messageContextMenuTests.bind(this));
describe("Message Input Tests", messageInputTests.bind(this));
xdescribe("Message Attachments Tests", messageAttachmentsTests.bind(this));
xdescribe("Chat Topbar Tests", chatTopbarTests.bind(this));
xdescribe("Quick Profile Tests", quickProfileTests.bind(this));
Expand Down

0 comments on commit b00d2f5

Please sign in to comment.