From 1356e3b9d82934045df2760f06ab0ff082811775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Wed, 6 Mar 2024 18:34:34 -0600 Subject: [PATCH 1/7] test(add): add markdowns strikethrough italics and fix code ones --- tests/screenobjects/chats/InputBar.ts | 5 +- tests/screenobjects/chats/MessageLocal.ts | 91 ++++++++++++++----- tests/screenobjects/chats/MessageRemote.ts | 86 +++++++++++++----- .../04-message-input.spec.ts | 77 ++++++++++++---- 4 files changed, 193 insertions(+), 66 deletions(-) diff --git a/tests/screenobjects/chats/InputBar.ts b/tests/screenobjects/chats/InputBar.ts index 7da5f932cc..44d696564f 100644 --- a/tests/screenobjects/chats/InputBar.ts +++ b/tests/screenobjects/chats/InputBar.ts @@ -217,9 +217,8 @@ export default class InputBar extends UplinkMainScreen { } else { await keyboardShiftEnter(); await inputText.addValue(codeToType); - let inputTextValueCode = await inputText.getText(); - inputTextValueCode += " "; - if (inputTextValueCode.includes(codeToType) === false) { + let inputTextValue = (await inputText.getText()).slice(0, -1); + if (inputTextValue.includes(codeToType) === false) { await this.typeCodeOnInputBar(language, codeToType); } } diff --git a/tests/screenobjects/chats/MessageLocal.ts b/tests/screenobjects/chats/MessageLocal.ts index f068625abf..060f65c34b 100644 --- a/tests/screenobjects/chats/MessageLocal.ts +++ b/tests/screenobjects/chats/MessageLocal.ts @@ -220,22 +220,24 @@ export default class MessageLocal extends UplinkMainScreen { // Message Local Methods - async waitForCodeMessageSentToExist(expectedLanguage: string) { + async waitForCodeMessageSentToExist( + expectedLanguage: string, + expectedMessage: string, + ) { const currentDriver = await this.getCurrentDriver(); - let codeMessageLocator: string = ""; + let codeSentLocator: string = ""; if (currentDriver === MACOS_DRIVER) { - codeMessageLocator = - '//XCUIElementTypeGroup[(@label, "message-local")]//XCUIElementTypeStaticText[(@value, "' + - expectedLanguage + - '")]'; + codeSentLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; } else if (currentDriver === WINDOWS_DRIVER) { - codeMessageLocator = - '//Group[(@Name, "message-local")]//Text[contains(@Name, "' + - expectedLanguage + - '")]'; + codeSentLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; } - const codeMessage = await $(codeMessageLocator); - await codeMessage.waitForExist(); + await driver.waitUntil(async () => { + return await $(codeSentLocator).waitForExist({ + timeout: 45000, + timeoutMsg: + "Expected sent message with code was not found after 45 seconds", + }); + }); } async waitForMessageToBeDeleted(expectedMessage: string) { @@ -297,8 +299,14 @@ export default class MessageLocal extends UplinkMainScreen { // Message Methods Using Message Custom Locator - async clickOnCopyCodeOfCustomMessageSent(expectedMessage: string) { - const copyButton = await this.getCustomMessageLocator(expectedMessage); + async clickOnCopyCodeOfCustomMessageSent( + expectedLanguage: string, + expectedMessage: string, + ) { + const copyButton = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); await this.hoverOnElement(copyButton); await copyButton.click(); } @@ -315,6 +323,21 @@ export default class MessageLocal extends UplinkMainScreen { return messageSent; } + async getCustomMessageLocatorCode( + expectedLanguage: string, + expectedMessage: string, + ) { + const currentDriver = await this.getCurrentDriver(); + let codeSentLocator: string = ""; + if (currentDriver === MACOS_DRIVER) { + codeSentLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; + } else if (currentDriver === WINDOWS_DRIVER) { + codeSentLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; + } + const codeReceived = await $(codeSentLocator); + return codeReceived; + } + async getCustomMessageLocatorLink(expectedMessage: string) { const currentDriver = await this.getCurrentDriver(); let messageSentLocator: string = ""; @@ -333,8 +356,14 @@ export default class MessageLocal extends UplinkMainScreen { return messageText; } - async getCustomMessageSentCodeCopyButton(expectedMessage: string) { - const message = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageSentCodeCopyButton( + expectedLanguage: string, + expectedMessage: string, + ) { + const message = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); const messageCodeCopyButton = await message .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) .$(SELECTORS.CHAT_MESSAGE_CODE_COPY_BUTTON); @@ -342,8 +371,14 @@ export default class MessageLocal extends UplinkMainScreen { return messageCodeCopyButton; } - async getCustomMessageSentCodeLanguage(expectedMessage: string) { - const message = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageSentCodeLanguage( + expectedLanguage: string, + expectedMessage: string, + ) { + const message = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); const messageText = await message.$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); const messageCodeLanguage = await messageText.$( SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE, @@ -352,8 +387,14 @@ export default class MessageLocal extends UplinkMainScreen { return messageCodeLanguage; } - async getCustomMessageSentCodePane(expectedMessage: string) { - const message = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageSentCodePane( + expectedLanguage: string, + expectedMessage: string, + ) { + const message = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); const messageCodePane = await message .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) .$(SELECTORS.CHAT_MESSAGE_CODE_PANE); @@ -361,8 +402,14 @@ export default class MessageLocal extends UplinkMainScreen { return messageCodePane; } - async getCustomMessageSentCodeMessage(expectedMessage: string) { - const messageCodePane = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageSentCodeMessage( + expectedLanguage: string, + expectedMessage: string, + ) { + const messageCodePane = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); let messageResult = ""; const messageResultElements = await messageCodePane.$$( SELECTORS.CHAT_MESSAGE_CODE_MESSAGES, diff --git a/tests/screenobjects/chats/MessageRemote.ts b/tests/screenobjects/chats/MessageRemote.ts index eba287dd7d..8cf1fb77cc 100644 --- a/tests/screenobjects/chats/MessageRemote.ts +++ b/tests/screenobjects/chats/MessageRemote.ts @@ -243,25 +243,22 @@ export default class MessageRemote extends UplinkMainScreen { ); } - async waitForReceivingCodeMessage(expectedLanguage: string) { + async waitForReceivingCodeMessage( + expectedLanguage: string, + expectedMessage: string, + ) { const currentDriver = await this.getCurrentDriver(); - let codeMessageReceivedLocator: string = ""; + let codeReceivedLocator: string = ""; if (currentDriver === MACOS_DRIVER) { - codeMessageReceivedLocator = - '//XCUIElementTypeGroup[contains(@label, "remote")]//XCUIElementTypeStaticText[contains(@value, "' + - expectedLanguage + - '")]'; + codeReceivedLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; } else if (currentDriver === WINDOWS_DRIVER) { - codeMessageReceivedLocator = - '//Group[contains(@Name, "remote")]//Text[contains(@Name, "' + - expectedLanguage + - '")]'; + codeReceivedLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; } await driver.waitUntil(async () => { - return await $(codeMessageReceivedLocator).waitForExist({ + return await $(codeReceivedLocator).waitForExist({ timeout: 45000, timeoutMsg: - "Expected message with code markdown was not found after 45 seconds", + "Expected sent message with code was not found after 45 seconds", }); }); } @@ -300,8 +297,14 @@ export default class MessageRemote extends UplinkMainScreen { // Message Methods Using Message Custom Locator - async clickOnCopyCodeOfCustomMessageReceived(expectedMessage: string) { - const copyButton = await this.getCustomMessageLocator(expectedMessage); + async clickOnCopyCodeOfCustomMessageReceived( + expectedLanguage: string, + expectedMessage: string, + ) { + const copyButton = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); await this.hoverOnElement(copyButton); await copyButton.click(); } @@ -318,6 +321,21 @@ export default class MessageRemote extends UplinkMainScreen { return MessageReceived; } + async getCustomMessageLocatorCode( + expectedLanguage: string, + expectedMessage: string, + ) { + const currentDriver = await this.getCurrentDriver(); + let codeReceivedLocator: string = ""; + if (currentDriver === MACOS_DRIVER) { + codeReceivedLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; + } else if (currentDriver === WINDOWS_DRIVER) { + codeReceivedLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; + } + const codeReceived = await $(codeReceivedLocator); + return codeReceived; + } + async getCustomMessageLocatorLink(expectedMessage: string) { const currentDriver = await this.getCurrentDriver(); let MessageReceivedLocator: string = ""; @@ -336,8 +354,14 @@ export default class MessageRemote extends UplinkMainScreen { return messageText; } - async getCustomMessageReceivedCodeCopyButton(expectedMessage: string) { - const message = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageReceivedCodeCopyButton( + expectedLanguage: string, + expectedMessage: string, + ) { + const message = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); const messageCodeCopyButton = await message .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) .$(SELECTORS.CHAT_MESSAGE_CODE_COPY_BUTTON); @@ -345,8 +369,14 @@ export default class MessageRemote extends UplinkMainScreen { return messageCodeCopyButton; } - async getCustomMessageReceivedCodeLanguage(expectedMessage: string) { - const message = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageReceivedCodeLanguage( + expectedLanguage: string, + expectedMessage: string, + ) { + const message = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); const messageText = await message.$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); const messageCodeLanguage = await messageText.$( SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE, @@ -355,8 +385,14 @@ export default class MessageRemote extends UplinkMainScreen { return messageCodeLanguage; } - async getCustomMessageReceivedCodePane(expectedMessage: string) { - const message = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageReceivedCodePane( + expectedLanguage: string, + expectedMessage: string, + ) { + const message = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); const messageCodePane = await message .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) .$(SELECTORS.CHAT_MESSAGE_CODE_PANE); @@ -364,8 +400,14 @@ export default class MessageRemote extends UplinkMainScreen { return messageCodePane; } - async getCustomMessageReceivedCodeMessage(expectedMessage: string) { - const messageCodePane = await this.getCustomMessageLocator(expectedMessage); + async getCustomMessageReceivedCodeMessage( + expectedLanguage: string, + expectedMessage: string, + ) { + const messageCodePane = await this.getCustomMessageLocatorCode( + expectedLanguage, + expectedMessage, + ); let messageResult = ""; const messageResultElements = await messageCodePane.$$( SELECTORS.CHAT_MESSAGE_CODE_MESSAGES, diff --git a/tests/specs/reusable-accounts/04-message-input.spec.ts b/tests/specs/reusable-accounts/04-message-input.spec.ts index 46771e3f0e..a26cf23dd1 100644 --- a/tests/specs/reusable-accounts/04-message-input.spec.ts +++ b/tests/specs/reusable-accounts/04-message-input.spec.ts @@ -130,33 +130,72 @@ export default async function messageInputTests() { // With Chat User A, send a message with __ markdown await chatsInput.typeMessageOnInput("__Bolds2__"); await chatsInput.clickOnSendMessage(); - await chatsInput.goToFiles(); - await filesScreen.waitForIsShown(true); - await filesScreen.goToMainScreen(); - await chatsInput.waitForIsShown(true); await messageLocal.waitForMessageSentToExist("__Bolds2__"); const messageContents = await messageLocal.getCustomMessageContents("__Bolds2__"); await expect(messageContents).toHaveText("Bolds2"); }); - // Needs research to implement on MacOS - xit("Chat Input Text - Validate users can send messages using the code language markdown", async () => { + it("Chat Input Text - Validate texts with * and _ markdown are sent in italic", async () => { + // With Chat User A, send a message with _ markdown + await chatsInput.typeMessageOnInput("_Italic1_"); + await chatsInput.clickOnSendMessage(); + await messageLocal.waitForMessageSentToExist("_Italic1_"); + const messageContentsItalicsOne = + await messageLocal.getCustomMessageContents("_Italic1_"); + await expect(messageContentsItalicsOne).toHaveText("Italic1"); + + // With Chat User A, send a message with * markdown + await chatsInput.typeMessageOnInput("*Italic2*"); + await chatsInput.clickOnSendMessage(); + await messageLocal.waitForMessageSentToExist("*Italic2*"); + const messageContentsItalicsTwo = + await messageLocal.getCustomMessageContents("*Italic2*"); + await expect(messageContentsItalicsTwo).toHaveText("Italic2"); + }); + + it("Chat Input Text - Validate texts with ~ and ~~ markdown are sent in strikethrough", async () => { + // With Chat User A, send a message with ~ markdown + await chatsInput.typeMessageOnInput("~Strikethrough1~"); + await chatsInput.clickOnSendMessage(); + await messageLocal.waitForMessageSentToExist("~Strikethrough1~"); + const messageContentsStrikethroughOne = + await messageLocal.getCustomMessageContents("~Strikethrough1~"); + await expect(messageContentsStrikethroughOne).toHaveText("Strikethrough1"); + + // With Chat User A, send a message with ~~ markdown + await chatsInput.typeMessageOnInput("~~Strikethrough2~~"); + await chatsInput.clickOnSendMessage(); + await messageLocal.waitForMessageSentToExist("~~Strikethrough2~~"); + const messageContentsStrikethroughTwo = + await messageLocal.getCustomMessageContents("~~Strikethrough2~~"); + await expect(messageContentsStrikethroughTwo).toHaveText("Strikethrough2"); + }); + + it("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 chatsInput.typeCodeOnInputBar("javascript", "let a = 1;"); await chatsInput.clickOnSendMessage(); // With Chat User A, validate code message was sent and is displayed correctly - await messageLocal.waitForCodeMessageSentToExist("JavaScript"); + await messageLocal.waitForCodeMessageSentToExist( + "javaScript", + "let a = 1;", + ); const codeMessageTextSent = - await messageLocal.getCustomMessageSentCodeMessage("let a = 1;"); + await messageLocal.getCustomMessageSentCodeMessage( + "javascript", + "let a = 1;", + ); await expect(codeMessageTextSent).toEqual("let a = 1;"); }); - // Needs research to implement on MacOS - xit("Chat Input Text - Code Markdown - User can copy the message from the code block", async () => { + it("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 messageLocal.clickOnCopyCodeOfCustomMessageSent("let a = 1;"); + await messageLocal.clickOnCopyCodeOfCustomMessageSent( + "javascript", + "let a = 1;", + ); // Then, paste it into the input bar and assert the text contents on input bar await chatsInput.pasteClipboardOnInputBar(); @@ -184,12 +223,14 @@ export default async function messageInputTests() { await expect(messageContentsBolds2).toHaveText("Bolds2"); }); - // Needs research to implement on MacOS - xit("Chat Input Text - Validate message with code markdown is received in expected format", async () => { + it("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 messageRemote.waitForReceivingCodeMessage("JavaScript"); + await messageRemote.waitForReceivingCodeMessage("javaScript", "let a = 1;"); const codeMessageTextReceived = - await messageRemote.getCustomMessageReceivedCodeMessage("let a = 1;"); + await messageRemote.getCustomMessageReceivedCodeMessage( + "javacript", + "let a = 1;", + ); await expect(codeMessageTextReceived).toEqual("let a = 1;"); }); @@ -263,8 +304,7 @@ export default async function messageInputTests() { await linkEmbedReceivedIconTitle.waitForExist(); }); - // Test failing on CI - xit("Typing Indicator - Send a long message to trigger typing indicator on remote side", async () => { + it("Typing Indicator - Send a long message to trigger typing indicator on remote side", async () => { await chatsInput.waitForIsShown(true); // Generate a random text with 100 chars const shortText = await chatsInput.generateShortRandomText(); @@ -272,8 +312,7 @@ export default async function messageInputTests() { await chatsInput.typeMessageOnInput(shortText + "efgh"); }); - // Test failing on CI - xit("Validate Typing Indicator is displayed if remote user is typing", async () => { + it("Validate Typing Indicator is displayed if remote user is typing", async () => { // Switch to second user and validate that Typing Indicator is displayed await activateFirstApplication(); await chatsInput.waitForIsShown(true); From 7ab06713d245f099e5707f081ccf4dda97f521b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:06:09 -0600 Subject: [PATCH 2/7] screenobject(update): fix code messages methods for getting ui elements --- tests/screenobjects/chats/InputBar.ts | 9 +- tests/screenobjects/chats/MessageLocal.ts | 120 +++++++----------- tests/screenobjects/chats/MessageRemote.ts | 111 ++++++---------- .../04-message-input.spec.ts | 61 +++++---- 4 files changed, 128 insertions(+), 173 deletions(-) diff --git a/tests/screenobjects/chats/InputBar.ts b/tests/screenobjects/chats/InputBar.ts index 44d696564f..7bd58b42a6 100644 --- a/tests/screenobjects/chats/InputBar.ts +++ b/tests/screenobjects/chats/InputBar.ts @@ -1,5 +1,6 @@ require("module-alias/register"); import { faker } from "@faker-js/faker"; +import { keyboard } from "@nut-tree/nut-js"; import { MACOS_DRIVER, WINDOWS_DRIVER } from "@helpers/constants"; import { keyboardShiftEnter, @@ -7,6 +8,7 @@ import { getUplinkWindowHandle, selectFileOnMacos, selectFileOnWindows, + setClipboardValue, } from "@helpers/commands"; import UplinkMainScreen from "@screenobjects/UplinkMainScreen"; let SELECTORS = {}; @@ -216,9 +218,10 @@ export default class InputBar extends UplinkMainScreen { await this.typeCodeOnInputBar(language, codeToType); } else { await keyboardShiftEnter(); - await inputText.addValue(codeToType); - let inputTextValue = (await inputText.getText()).slice(0, -1); - if (inputTextValue.includes(codeToType) === false) { + await keyboard.type(codeToType); + let inputTextValueCode = await inputText.getText(); + inputTextValueCode += " "; + if (inputTextValueCode.includes(codeToType) === false) { await this.typeCodeOnInputBar(language, codeToType); } } diff --git a/tests/screenobjects/chats/MessageLocal.ts b/tests/screenobjects/chats/MessageLocal.ts index 060f65c34b..026388ae34 100644 --- a/tests/screenobjects/chats/MessageLocal.ts +++ b/tests/screenobjects/chats/MessageLocal.ts @@ -16,9 +16,10 @@ const SELECTORS_COMMON = {}; const SELECTORS_WINDOWS = { CHAT_MESSAGE_CODE_COPY_BUTTON: '[name="Copy"]', + CHAT_MESSAGE_CODE_LANGUAGE_GROUP: "//Group[2]/Group", CHAT_MESSAGE_CODE_LANGUAGE: "", CHAT_MESSAGE_CODE_MESSAGES: "", - CHAT_MESSAGE_CODE_PANE: "", + CHAT_MESSAGE_CODE_PANE: "//Group[1]/Group", CHAT_MESSAGE_FILE_BUTTON: '[name="attachment-button"]', CHAT_MESSAGE_FILE_EMBED: '[name="file-embed"]', CHAT_MESSAGE_FILE_ICON: '[name="file-icon"]', @@ -45,10 +46,12 @@ const SELECTORS_WINDOWS = { const SELECTORS_MACOS = { CHAT_MESSAGE_CODE_COPY_BUTTON: "-ios class chain:**/XCUIElementTypeButton", - CHAT_MESSAGE_CODE_LANGUAGE: - "//XCUIElementTypeGroup/XCUIElementTypeGroup/XCUIElementTypeStaticText", + CHAT_MESSAGE_CODE_LANGUAGE: "-ios class chain:**/XCUIElementTypeStaticText", + CHAT_MESSAGE_CODE_LANGUAGE_GROUP: + "-ios class chain:**/XCUIElementTypeGroup[2]/XCUIElementTypeGroup", CHAT_MESSAGE_CODE_MESSAGES: "-ios class chain:**/XCUIElementTypeStaticText", - CHAT_MESSAGE_CODE_PANE: "-ios class chain:**/XCUIElementTypeGroup", + CHAT_MESSAGE_CODE_PANE: + "-ios class chain:**/XCUIElementTypeGroup[1]/XCUIElementTypeGroup", CHAT_MESSAGE_FILE_BUTTON: "~attachment-button", CHAT_MESSAGE_FILE_EMBED: "~file-embed", CHAT_MESSAGE_FILE_ICON: "~file-icon", @@ -220,24 +223,20 @@ export default class MessageLocal extends UplinkMainScreen { // Message Local Methods - async waitForCodeMessageSentToExist( - expectedLanguage: string, - expectedMessage: string, - ) { + async waitForCodeMessageSentToExist(expectedLanguage: string) { const currentDriver = await this.getCurrentDriver(); - let codeSentLocator: string = ""; + let codeMessageLocator: string = ""; if (currentDriver === MACOS_DRIVER) { - codeSentLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; + codeMessageLocator = + '//XCUIElementTypeGroup[contains(@label, "message-text-```' + + expectedLanguage + + '")]'; } else if (currentDriver === WINDOWS_DRIVER) { - codeSentLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; + codeMessageLocator = + '//Group[contains(@Name, "message-text-```' + expectedLanguage + '")]'; } - await driver.waitUntil(async () => { - return await $(codeSentLocator).waitForExist({ - timeout: 45000, - timeoutMsg: - "Expected sent message with code was not found after 45 seconds", - }); - }); + const codeMessage = await $(codeMessageLocator); + await codeMessage.waitForExist(); } async waitForMessageToBeDeleted(expectedMessage: string) { @@ -299,14 +298,8 @@ export default class MessageLocal extends UplinkMainScreen { // Message Methods Using Message Custom Locator - async clickOnCopyCodeOfCustomMessageSent( - expectedLanguage: string, - expectedMessage: string, - ) { - const copyButton = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); + async clickOnCopyCodeOfCustomMessageSent(expectedLanguage: string) { + const copyButton = await this.getCustomMessageLocatorCode(expectedLanguage); await this.hoverOnElement(copyButton); await copyButton.click(); } @@ -323,19 +316,20 @@ export default class MessageLocal extends UplinkMainScreen { return messageSent; } - async getCustomMessageLocatorCode( - expectedLanguage: string, - expectedMessage: string, - ) { + async getCustomMessageLocatorCode(expectedLanguage: string) { const currentDriver = await this.getCurrentDriver(); let codeSentLocator: string = ""; if (currentDriver === MACOS_DRIVER) { - codeSentLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; + codeSentLocator = + '//XCUIElementTypeGroup[contains(@label, "message-text-```' + + expectedLanguage + + '")]'; } else if (currentDriver === WINDOWS_DRIVER) { - codeSentLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; + codeSentLocator = + '//Group[contains(@Name, "message-text-```' + expectedLanguage + '")]'; } - const codeReceived = await $(codeSentLocator); - return codeReceived; + const codeSent = await $(codeSentLocator); + return codeSent; } async getCustomMessageLocatorLink(expectedMessage: string) { @@ -356,61 +350,35 @@ export default class MessageLocal extends UplinkMainScreen { return messageText; } - async getCustomMessageSentCodeCopyButton( - expectedLanguage: string, - expectedMessage: string, - ) { - const message = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, + async getCustomMessageSentCodeCopyButton(expectedLanguage: string) { + const message = await this.getCustomMessageLocatorCode(expectedLanguage); + const messageCodeCopyButton = await message.$( + SELECTORS.CHAT_MESSAGE_CODE_COPY_BUTTON, ); - const messageCodeCopyButton = await message - .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) - .$(SELECTORS.CHAT_MESSAGE_CODE_COPY_BUTTON); await messageCodeCopyButton.waitForExist(); return messageCodeCopyButton; } - async getCustomMessageSentCodeLanguage( - expectedLanguage: string, - expectedMessage: string, - ) { - const message = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); - const messageText = await message.$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); - const messageCodeLanguage = await messageText.$( - SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE, - ); + async getCustomMessageSentCodeLanguage(expectedLanguage: string) { + const message = await this.getCustomMessageLocatorCode(expectedLanguage); + const messageCodeLanguage = await message + .$(SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE_GROUP) + .$(SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE); await messageCodeLanguage.waitForExist(); return messageCodeLanguage; } - async getCustomMessageSentCodePane( - expectedLanguage: string, - expectedMessage: string, - ) { - const message = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); - const messageCodePane = await message - .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) - .$(SELECTORS.CHAT_MESSAGE_CODE_PANE); + async getCustomMessageSentCodePane(expectedLanguage: string) { + const message = await this.getCustomMessageLocatorCode(expectedLanguage); + const messageCodePane = await message.$(SELECTORS.CHAT_MESSAGE_CODE_PANE); await messageCodePane.waitForExist(); return messageCodePane; } - async getCustomMessageSentCodeMessage( - expectedLanguage: string, - expectedMessage: string, - ) { - const messageCodePane = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); - let messageResult = ""; + async getCustomMessageSentCodeMessage(expectedLanguage: string) { + const messageCodePane = + await this.getCustomMessageSentCodePane(expectedLanguage); + let messageResult: string = ""; const messageResultElements = await messageCodePane.$$( SELECTORS.CHAT_MESSAGE_CODE_MESSAGES, ); diff --git a/tests/screenobjects/chats/MessageRemote.ts b/tests/screenobjects/chats/MessageRemote.ts index 8cf1fb77cc..e1f1ed27c1 100644 --- a/tests/screenobjects/chats/MessageRemote.ts +++ b/tests/screenobjects/chats/MessageRemote.ts @@ -16,6 +16,7 @@ const SELECTORS_COMMON = {}; const SELECTORS_WINDOWS = { CHAT_MESSAGE_CODE_COPY_BUTTON: '[name="Copy"]', + CHAT_MESSAGE_CODE_LANGUAGE_GROUP: "//Group[2]/Group", CHAT_MESSAGE_CODE_LANGUAGE: "", CHAT_MESSAGE_CODE_MESSAGES: "", CHAT_MESSAGE_CODE_PANE: "", @@ -46,10 +47,12 @@ const SELECTORS_WINDOWS = { const SELECTORS_MACOS = { CHAT_MESSAGE_CODE_COPY_BUTTON: "-ios class chain:**/XCUIElementTypeButton", - CHAT_MESSAGE_CODE_LANGUAGE: - "//XCUIElementTypeGroup/XCUIElementTypeGroup/XCUIElementTypeStaticText", + CHAT_MESSAGE_CODE_LANGUAGE: "-ios class chain:**/XCUIElementTypeStaticText", + CHAT_MESSAGE_CODE_LANGUAGE_GROUP: + "-ios class chain:**/XCUIElementTypeGroup[2]/XCUIElementTypeGroup", CHAT_MESSAGE_CODE_MESSAGES: "-ios class chain:**/XCUIElementTypeStaticText", - CHAT_MESSAGE_CODE_PANE: "-ios class chain:**/XCUIElementTypeGroup", + CHAT_MESSAGE_CODE_PANE: + "-ios class chain:**/XCUIElementTypeGroup[1]/XCUIElementTypeGroup", CHAT_MESSAGE_FILE_BUTTON: "~attachment-button", CHAT_MESSAGE_FILE_EMBED: "~file-embed", CHAT_MESSAGE_FILE_EMBED_REMOTE: "~file-embed-remote", @@ -243,24 +246,19 @@ export default class MessageRemote extends UplinkMainScreen { ); } - async waitForReceivingCodeMessage( - expectedLanguage: string, - expectedMessage: string, - ) { + async waitForReceivingCodeMessage(expectedLanguage: string) { const currentDriver = await this.getCurrentDriver(); let codeReceivedLocator: string = ""; if (currentDriver === MACOS_DRIVER) { - codeReceivedLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; + codeReceivedLocator = + '//XCUIElementTypeGroup[contains(@label, "message-text-```' + + expectedLanguage + + '")]'; } else if (currentDriver === WINDOWS_DRIVER) { - codeReceivedLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; + codeReceivedLocator = + '//Group[contains(@Name, "message-text-```' + expectedLanguage + '")]'; } - await driver.waitUntil(async () => { - return await $(codeReceivedLocator).waitForExist({ - timeout: 45000, - timeoutMsg: - "Expected sent message with code was not found after 45 seconds", - }); - }); + await $(codeReceivedLocator).waitForExist({ timeout: 45000 }); } async waitForReceivingLink(expectedMessage: string) { @@ -297,14 +295,8 @@ export default class MessageRemote extends UplinkMainScreen { // Message Methods Using Message Custom Locator - async clickOnCopyCodeOfCustomMessageReceived( - expectedLanguage: string, - expectedMessage: string, - ) { - const copyButton = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); + async clickOnCopyCodeOfCustomMessageReceived(expectedLanguage: string) { + const copyButton = await this.getCustomMessageLocatorCode(expectedLanguage); await this.hoverOnElement(copyButton); await copyButton.click(); } @@ -321,16 +313,17 @@ export default class MessageRemote extends UplinkMainScreen { return MessageReceived; } - async getCustomMessageLocatorCode( - expectedLanguage: string, - expectedMessage: string, - ) { + async getCustomMessageLocatorCode(expectedLanguage: string) { const currentDriver = await this.getCurrentDriver(); let codeReceivedLocator: string = ""; if (currentDriver === MACOS_DRIVER) { - codeReceivedLocator = `~message-text-\`\`\`${expectedLanguage} ${expectedMessage}`; + codeReceivedLocator = + '//XCUIElementTypeGroup[contains(@label, "message-text-```' + + expectedLanguage + + '")]'; } else if (currentDriver === WINDOWS_DRIVER) { - codeReceivedLocator = `[name="message-text-\`\`\`${expectedLanguage} ${expectedMessage}"]`; + codeReceivedLocator = + '//Group[contains(@Name, "message-text-```' + expectedLanguage + '")]'; } const codeReceived = await $(codeReceivedLocator); return codeReceived; @@ -354,61 +347,35 @@ export default class MessageRemote extends UplinkMainScreen { return messageText; } - async getCustomMessageReceivedCodeCopyButton( - expectedLanguage: string, - expectedMessage: string, - ) { - const message = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, + async getCustomMessageReceivedCodeCopyButton(expectedLanguage: string) { + const message = await this.getCustomMessageLocatorCode(expectedLanguage); + const messageCodeCopyButton = await message.$( + SELECTORS.CHAT_MESSAGE_CODE_COPY_BUTTON, ); - const messageCodeCopyButton = await message - .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) - .$(SELECTORS.CHAT_MESSAGE_CODE_COPY_BUTTON); await messageCodeCopyButton.waitForExist(); return messageCodeCopyButton; } - async getCustomMessageReceivedCodeLanguage( - expectedLanguage: string, - expectedMessage: string, - ) { - const message = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); - const messageText = await message.$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP); - const messageCodeLanguage = await messageText.$( - SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE, - ); + async getCustomMessageReceivedCodeLanguage(expectedLanguage: string) { + const message = await this.getCustomMessageLocatorCode(expectedLanguage); + const messageCodeLanguage = await message + .$(SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE_GROUP) + .$(SELECTORS.CHAT_MESSAGE_CODE_LANGUAGE); await messageCodeLanguage.waitForExist(); return messageCodeLanguage; } - async getCustomMessageReceivedCodePane( - expectedLanguage: string, - expectedMessage: string, - ) { - const message = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); - const messageCodePane = await message - .$(SELECTORS.CHAT_MESSAGE_TEXT_GROUP) - .$(SELECTORS.CHAT_MESSAGE_CODE_PANE); + async getCustomMessageReceivedCodePane(expectedLanguage: string) { + const message = await this.getCustomMessageLocatorCode(expectedLanguage); + const messageCodePane = await message.$(SELECTORS.CHAT_MESSAGE_CODE_PANE); await messageCodePane.waitForExist(); return messageCodePane; } - async getCustomMessageReceivedCodeMessage( - expectedLanguage: string, - expectedMessage: string, - ) { - const messageCodePane = await this.getCustomMessageLocatorCode( - expectedLanguage, - expectedMessage, - ); - let messageResult = ""; + async getCustomMessageReceivedCodeMessage(expectedLanguage: string) { + const messageCodePane = + await this.getCustomMessageReceivedCodePane(expectedLanguage); + let messageResult: string = ""; const messageResultElements = await messageCodePane.$$( SELECTORS.CHAT_MESSAGE_CODE_MESSAGES, ); diff --git a/tests/specs/reusable-accounts/04-message-input.spec.ts b/tests/specs/reusable-accounts/04-message-input.spec.ts index a26cf23dd1..f7ab7785c4 100644 --- a/tests/specs/reusable-accounts/04-message-input.spec.ts +++ b/tests/specs/reusable-accounts/04-message-input.spec.ts @@ -174,28 +174,19 @@ export default async function messageInputTests() { it("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 chatsInput.typeCodeOnInputBar("javascript", "let a = 1;"); + await chatsInput.typeCodeOnInputBar("JavaScript", "let a = 1;"); await chatsInput.clickOnSendMessage(); // With Chat User A, validate code message was sent and is displayed correctly - await messageLocal.waitForCodeMessageSentToExist( - "javaScript", - "let a = 1;", - ); + await messageLocal.waitForCodeMessageSentToExist("JavaScript"); const codeMessageTextSent = - await messageLocal.getCustomMessageSentCodeMessage( - "javascript", - "let a = 1;", - ); + await messageLocal.getCustomMessageSentCodeMessage("JavaScript"); await expect(codeMessageTextSent).toEqual("let a = 1;"); }); it("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 messageLocal.clickOnCopyCodeOfCustomMessageSent( - "javascript", - "let a = 1;", - ); + await messageLocal.clickOnCopyCodeOfCustomMessageSent("JavaScript"); // Then, paste it into the input bar and assert the text contents on input bar await chatsInput.pasteClipboardOnInputBar(); @@ -212,25 +203,51 @@ export default async function messageInputTests() { await activateSecondApplication(); await chatsInput.waitForIsShown(true); await messageRemote.waitForReceivingMessage("**Bolds1**"); - const messageContentsBolds1 = + const messageContentsBoldsOne = await messageRemote.getCustomMessageContents("**Bolds1**"); - await expect(messageContentsBolds1).toHaveText("Bolds1"); + await expect(messageContentsBoldsOne).toHaveText("Bolds1"); // With Chat User B, validate message with with __ markdown was received in bolds await messageRemote.waitForReceivingMessage("__Bolds2__"); - const messageContentsBolds2 = + const messageContentsBoldsTwo = await messageRemote.getCustomMessageContents("__Bolds2__"); - await expect(messageContentsBolds2).toHaveText("Bolds2"); + await expect(messageContentsBoldsTwo).toHaveText("Bolds2"); + }); + + it("Chat Input Text - Validate messages with italic markdowns were received in expected format", async () => { + // With Chat User B, validate message with with _ markdown was received in italic + await messageRemote.waitForReceivingMessage("_Italic1_"); + const messageContentsItalicOne = + await messageRemote.getCustomMessageContents("_Italic1_"); + await expect(messageContentsItalicOne).toHaveText("Italic1"); + + // With Chat User B, validate message with with * markdown was received in italic + await messageRemote.waitForReceivingMessage("*Italic2*"); + const messageContentsItalicTwo = + await messageRemote.getCustomMessageContents("*Italic2*"); + await expect(messageContentsItalicTwo).toHaveText("Italic2"); + }); + + it("Chat Input Text - Validate messages with strikethrough markdowns were received in expected format", async () => { + // With Chat User B, validate message with with ~ markdown was received in Strikethrough + await chatsInput.waitForIsShown(true); + await messageRemote.waitForReceivingMessage("~Strikethrough1~"); + const messageContentsStrikethroughOne = + await messageRemote.getCustomMessageContents("~Strikethrough1~"); + await expect(messageContentsStrikethroughOne).toHaveText("Strikethrough1"); + + // With Chat User B, validate message with with ~~ markdown was received in Strikethrough + await messageRemote.waitForReceivingMessage("~~Strikethrough2~~"); + const messageContentsStrikethroughTwo = + await messageRemote.getCustomMessageContents("~~Strikethrough2~~"); + await expect(messageContentsStrikethroughTwo).toHaveText("Strikethrough2"); }); it("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 messageRemote.waitForReceivingCodeMessage("javaScript", "let a = 1;"); + await messageRemote.waitForReceivingCodeMessage("JavaScript"); const codeMessageTextReceived = - await messageRemote.getCustomMessageReceivedCodeMessage( - "javacript", - "let a = 1;", - ); + await messageRemote.getCustomMessageReceivedCodeMessage("JavaSript"); await expect(codeMessageTextReceived).toEqual("let a = 1;"); }); From e3a1b2a215768abdecf192f7f334b2c404e00d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:06:08 -0600 Subject: [PATCH 3/7] screenobject(update): fixing method to get code text --- tests/screenobjects/chats/MessageLocal.ts | 6 +++++- tests/screenobjects/chats/MessageRemote.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/screenobjects/chats/MessageLocal.ts b/tests/screenobjects/chats/MessageLocal.ts index 026388ae34..1d25163bd1 100644 --- a/tests/screenobjects/chats/MessageLocal.ts +++ b/tests/screenobjects/chats/MessageLocal.ts @@ -384,7 +384,11 @@ export default class MessageLocal extends UplinkMainScreen { ); for (let element of messageResultElements) { const codeMessageText = await element.getText(); - messageResult += codeMessageText; + if (codeMessageText === "=") { + messageResult += "= "; + } else { + messageResult += codeMessageText; + } } return messageResult; } diff --git a/tests/screenobjects/chats/MessageRemote.ts b/tests/screenobjects/chats/MessageRemote.ts index e1f1ed27c1..5d1f15246f 100644 --- a/tests/screenobjects/chats/MessageRemote.ts +++ b/tests/screenobjects/chats/MessageRemote.ts @@ -381,7 +381,11 @@ export default class MessageRemote extends UplinkMainScreen { ); for (let element of messageResultElements) { const codeMessageText = await element.getText(); - messageResult += codeMessageText; + if (codeMessageText === "=") { + messageResult += "= "; + } else { + messageResult += codeMessageText; + } } return messageResult; } From 658ce05b11cb7c65699f618a80515846d338b6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:00:32 -0600 Subject: [PATCH 4/7] screenobject(update): fixing method to get copy code button --- tests/screenobjects/chats/MessageLocal.ts | 3 ++- tests/screenobjects/chats/MessageRemote.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/screenobjects/chats/MessageLocal.ts b/tests/screenobjects/chats/MessageLocal.ts index 1d25163bd1..330248b33d 100644 --- a/tests/screenobjects/chats/MessageLocal.ts +++ b/tests/screenobjects/chats/MessageLocal.ts @@ -299,7 +299,8 @@ export default class MessageLocal extends UplinkMainScreen { // Message Methods Using Message Custom Locator async clickOnCopyCodeOfCustomMessageSent(expectedLanguage: string) { - const copyButton = await this.getCustomMessageLocatorCode(expectedLanguage); + const copyButton = + await this.getCustomMessageSentCodeCopyButton(expectedLanguage); await this.hoverOnElement(copyButton); await copyButton.click(); } diff --git a/tests/screenobjects/chats/MessageRemote.ts b/tests/screenobjects/chats/MessageRemote.ts index 5d1f15246f..d8fda3e621 100644 --- a/tests/screenobjects/chats/MessageRemote.ts +++ b/tests/screenobjects/chats/MessageRemote.ts @@ -296,7 +296,8 @@ export default class MessageRemote extends UplinkMainScreen { // Message Methods Using Message Custom Locator async clickOnCopyCodeOfCustomMessageReceived(expectedLanguage: string) { - const copyButton = await this.getCustomMessageLocatorCode(expectedLanguage); + const copyButton = + await this.getCustomMessageReceivedCodeCopyButton(expectedLanguage); await this.hoverOnElement(copyButton); await copyButton.click(); } From 8332323e50e6ebdbf01abec72f66312c9569d00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:08:29 -0600 Subject: [PATCH 5/7] test(update): fix getter on code message validation --- tests/specs/reusable-accounts/04-message-input.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/specs/reusable-accounts/04-message-input.spec.ts b/tests/specs/reusable-accounts/04-message-input.spec.ts index f7ab7785c4..2cbff6489a 100644 --- a/tests/specs/reusable-accounts/04-message-input.spec.ts +++ b/tests/specs/reusable-accounts/04-message-input.spec.ts @@ -192,7 +192,7 @@ export default async function messageInputTests() { await chatsInput.pasteClipboardOnInputBar(); const inputText = await chatsInput.getValueFromInputBar(); - await expect(inputText).toHaveText("let a = 1;"); + await expect(inputText).toEqual("let a = 1;"); // Finally, clear the input bar for next tests await chatsInput.clearInputBar(); From 21b28c73730db9ff368d0c0b0be9e8107aa2a0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:21:28 -0600 Subject: [PATCH 6/7] test(update): fix typo on test --- tests/specs/reusable-accounts/04-message-input.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/specs/reusable-accounts/04-message-input.spec.ts b/tests/specs/reusable-accounts/04-message-input.spec.ts index 2cbff6489a..6f52001039 100644 --- a/tests/specs/reusable-accounts/04-message-input.spec.ts +++ b/tests/specs/reusable-accounts/04-message-input.spec.ts @@ -247,7 +247,7 @@ export default async function messageInputTests() { // With Chat User B, validate code message was received and is displayed correctly await messageRemote.waitForReceivingCodeMessage("JavaScript"); const codeMessageTextReceived = - await messageRemote.getCustomMessageReceivedCodeMessage("JavaSript"); + await messageRemote.getCustomMessageReceivedCodeMessage("JavaScript"); await expect(codeMessageTextReceived).toEqual("let a = 1;"); }); From 91e90abe8d2dbf2ece4c96ab4ced7b5eb095c7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Carden=CC=83a?= <35935591+luisecm@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:00:54 -0600 Subject: [PATCH 7/7] test(update): skipping again typing indicator tests --- tests/specs/reusable-accounts/04-message-input.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/specs/reusable-accounts/04-message-input.spec.ts b/tests/specs/reusable-accounts/04-message-input.spec.ts index 6f52001039..36a6b70702 100644 --- a/tests/specs/reusable-accounts/04-message-input.spec.ts +++ b/tests/specs/reusable-accounts/04-message-input.spec.ts @@ -321,7 +321,8 @@ export default async function messageInputTests() { await linkEmbedReceivedIconTitle.waitForExist(); }); - it("Typing Indicator - Send a long message to trigger typing indicator on remote side", async () => { + // Skipping this test since the time spent between switching windows to validate, the typing indicator is already gone + xit("Typing Indicator - Send a long message to trigger typing indicator on remote side", async () => { await chatsInput.waitForIsShown(true); // Generate a random text with 100 chars const shortText = await chatsInput.generateShortRandomText(); @@ -329,7 +330,8 @@ export default async function messageInputTests() { await chatsInput.typeMessageOnInput(shortText + "efgh"); }); - it("Validate Typing Indicator is displayed if remote user is typing", async () => { + // Skipping this test since the time spent between switching windows to validate, the typing indicator is already gone + xit("Validate Typing Indicator is displayed if remote user is typing", async () => { // Switch to second user and validate that Typing Indicator is displayed await activateFirstApplication(); await chatsInput.waitForIsShown(true);