diff --git a/samples/e2e-tests/playwright.config.ts b/samples/e2e-tests/playwright.config.ts index 29986e40..878d6cb6 100644 --- a/samples/e2e-tests/playwright.config.ts +++ b/samples/e2e-tests/playwright.config.ts @@ -32,26 +32,16 @@ export default defineConfig({ /* Configure projects for major browsers */ projects: [ - { - name: "chromium", - use: { ...devices["Desktop Chrome"] }, - }, - - { - name: "firefox", - use: { ...devices["Desktop Firefox"] }, - }, + // { + // name: "Mobile Safari", + // use: { ...devices["iPhone 13"] }, + // }, + /* Test against mobile viewports. */ { - name: "webkit", - use: { ...devices["Desktop Safari"] }, + name: "Mobile Chrome", + use: { ...devices["Pixel 5"] }, }, - - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { ...devices['Pixel 5'] }, - // }, // { // name: 'Mobile Safari', // use: { ...devices['iPhone 12'] }, diff --git a/samples/e2e-tests/screen-object/channel-list.ts b/samples/e2e-tests/screen-object/channel-list.ts index 6bf06b12..9e56f72e 100644 --- a/samples/e2e-tests/screen-object/channel-list.ts +++ b/samples/e2e-tests/screen-object/channel-list.ts @@ -1,11 +1,49 @@ -import { expect, Locator, Page } from "@playwright/test" +import { Locator, Page } from "@playwright/test" export class ChannelListComponent { readonly page: Page readonly containerChannelList: Locator + readonly inputSearchChannelList: Locator + readonly headerUser: Locator + readonly sectionUnread: Locator + readonly sectionPublicChannels: Locator + readonly sectionGroups: Locator + readonly sectionDirectMessages: Locator + readonly iconChat: Locator + readonly iconFooterHome: Locator + readonly iconFooterMentions: Locator + readonly iconFooterProfile: Locator constructor(page: Page) { this.page = page - this.containerChannelList = page.getByTestId("channel-list-container") + this.containerChannelList = page.locator( + '//*[@id="root"]/div/div[2]/div/div/div/div/div/div[1]/div/div[2]/div[2]/div/div/div/div[1]/div/div[1]/div[1]/div/div/div/div/div/div[1]/div/div[2]/div[2]/div/div/div/div[1]/div[1]' + ) + this.inputSearchChannelList = page.getByPlaceholder("Search") + this.headerUser = page + .locator( + "div:nth-child(2) > div > div > div > div:nth-child(2) > div > div > .css-view-175oi2r" + ) + .first() + this.sectionUnread = page + .locator("div") + .filter({ hasText: /^UNREAD󰇘󰅃$/ }) + .first() + this.sectionPublicChannels = page + .locator("div") + .filter({ hasText: /^PUBLIC CHANNELS󰅃$/ }) + .first() + this.sectionGroups = page + .locator("div") + .filter({ hasText: /^GROUPS󰅃$/ }) + .first() + this.sectionDirectMessages = page + .locator("div") + .filter({ hasText: /^DIRECT MESSAGES󰅃$/ }) + .first() + this.iconChat = page.locator("div").filter({ hasText: /^$/ }).first() + this.iconFooterHome = page.getByRole("link", { name: "󰚡 󰚡 Home" }) + this.iconFooterMentions = page.getByRole("link", { name: "  Mentions" }) + this.iconFooterProfile = page.getByRole("link", { name: "  Mentions" }) } } diff --git a/samples/e2e-tests/screen-object/login-page.ts b/samples/e2e-tests/screen-object/login-page.ts new file mode 100644 index 00000000..240bd867 --- /dev/null +++ b/samples/e2e-tests/screen-object/login-page.ts @@ -0,0 +1,16 @@ +import { Locator, Page } from "@playwright/test" + +export class LoginPageComponent { + readonly page: Page + readonly buttonLogin: Locator + readonly inputUserId: Locator + + constructor(page: Page) { + this.page = page + this.buttonLogin = page + .locator("div") + .filter({ hasText: /^Log in$/ }) + .first() + this.inputUserId = page.getByRole("textbox") + } +} diff --git a/samples/e2e-tests/screen-object/message-input.ts b/samples/e2e-tests/screen-object/message-input.ts deleted file mode 100644 index debcca10..00000000 --- a/samples/e2e-tests/screen-object/message-input.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { expect, Locator, Page } from "@playwright/test" - -export class MessageInputComponent { - readonly page: Page - readonly containerMessageInput: Locator - readonly buttonSendMessage: Locator - - constructor(page: Page) { - this.page = page - this.containerMessageInput = page.getByTestId("message-input-container") - this.buttonSendMessage = page.getByTestId("message-input-send-button") - } -} diff --git a/samples/e2e-tests/screen-object/message-list.ts b/samples/e2e-tests/screen-object/message-list.ts index bd19892e..8867618e 100644 --- a/samples/e2e-tests/screen-object/message-list.ts +++ b/samples/e2e-tests/screen-object/message-list.ts @@ -1,13 +1,65 @@ -import { expect, Locator, Page } from "@playwright/test" +import { Locator, Page } from "@playwright/test" export class MessageListComponent { readonly page: Page - readonly containerMessageList: Locator - readonly containerUserMessage: Locator + readonly buttonLoadEarlierMessages: Locator + readonly inputMessage: Locator + readonly buttonSendMessage: Locator + readonly buttonPinIconHead: Locator + readonly wrapperMentionUserList: Locator + readonly containerMentionsList: Locator + readonly messageSent: Locator + readonly messageQuoted: Locator + readonly containerActions: Locator + readonly buttonCopyMessageActions: Locator + readonly buttonReplyInThreadActions: Locator + readonly buttonQuoteMessageActions: Locator + readonly buttonPinMessage: Locator + readonly messagePinned: Locator constructor(page: Page) { this.page = page - this.containerMessageList = page.getByTestId("message-list-container") - this.containerUserMessage = page.getByTestId("message-list-container-user-message") + this.buttonLoadEarlierMessages = page.getByRole("button", { name: "Load earlier messages" }) + this.inputMessage = page.getByTestId("Type a message...") + this.buttonSendMessage = page.getByTestId("GC_SEND_TOUCHABLE") + this.wrapperMentionUserList = page + .getByTestId("GC_WRAPPER") + .locator("div") + .filter({ hasText: /^test-user$/ }) + .nth(1) + this.containerMentionsList = page + .locator( + "div:nth-child(2) > div > div > div > div > div > div > div > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > div > div:nth-child(2) > div > div > div" + ) + .first() + this.containerActions = page + .locator("div") + .filter({ hasText: /^ActionsCopy messageReply in threadQuote messagePin message$/ }) + .nth(1) + this.buttonCopyMessageActions = page + .locator("div") + .filter({ hasText: /^Copy message$/ }) + .first() + this.buttonReplyInThreadActions = page + .locator("div") + .filter({ hasText: /^Reply in thread$/ }) + .first() + this.buttonQuoteMessageActions = page + .locator("div") + .filter({ hasText: /^Pin message$/ }) + .first() + this.buttonPinMessage = page + .locator("div") + .filter({ hasText: /^Pin message$/ }) + .first() + this.buttonPinIconHead = page.getByText("󰤱") + this.messagePinned = page + .locator( + "div:nth-child(3) > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > div" + ) + .first() + this.messageSent = page.locator( + "div:nth-child(2) > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > div > div > div > div > div > div > div > div > div > div:nth-child(2) > div > div > div > div > div" + ) } } diff --git a/samples/e2e-tests/screen-object/newchat-page.ts b/samples/e2e-tests/screen-object/newchat-page.ts new file mode 100644 index 00000000..1efcd08c --- /dev/null +++ b/samples/e2e-tests/screen-object/newchat-page.ts @@ -0,0 +1,80 @@ +import { Locator, Page } from "@playwright/test" + +export class NewChatPageComponent { + readonly page: Page + readonly headerNewChat: Locator + readonly buttonGroupChat: Locator + readonly sectionUserDirectChat: Locator + readonly inputSearchNewChatPage: Locator + readonly inputGroupName: Locator + readonly groupMemberOne: Locator + readonly groupMemberTwo: Locator + readonly groupMemberThree: Locator + readonly buttonCreateGroup: Locator + readonly buttonCancelCreateGroup: Locator + readonly buttonChangeNameGroup: Locator + readonly buttonLeaveConversationGroup: Locator + readonly iconHeadGroupChat: Locator + readonly popupChangeChatName: Locator + readonly inputChangeChatName: Locator + readonly buttonSaveChatName: Locator + readonly groupName: locator + + constructor(page: Page) { + this.page = page + this.headerNewChat = page.getByRole("heading", { name: "New chat" }) + this.buttonGroupChat = page + .locator("div") + .filter({ hasText: /^Create group chat$/ }) + .first() + this.sectionUserDirectChat = page + .locator("div") + .filter({ hasText: /^Lukasz$/ }) + .nth(1) + this.inputSearchNewChatPage = page.getByRole("textbox", { name: "Search" }) + this.inputGroupName = page.getByRole("textbox").nth(1) + this.groupMemberOne = page + .locator( + "div:nth-child(2) > div > div > div > div > div > div:nth-child(9) > div > div > div > div > div" + ) + .first() + this.groupMemberTwo = page + .locator("div:nth-child(9) > div > div:nth-child(4) > div > div > div") + .first() + this.groupMemberThree = page + .locator("div:nth-child(9) > div > div:nth-child(6) > div > div > div") + .first() + this.buttonCreateGroup = page + .locator("div") + .filter({ hasText: /^Create$/ }) + .first() + this.buttonCancelCreateGroup = page + .locator("div") + .filter({ hasText: /^Cancel$/ }) + .first() + this.buttonChangeNameGroup = page + .locator( + "div:nth-child(3) > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > div > div:nth-child(2) > div:nth-child(2)" + ) + .first() + this.buttonLeaveConversationGroup = page + .locator("div") + .filter({ hasText: /^Leave conversation$/ }) + .first() + this.iconHeadGroupChat = page.locator( + "div:nth-child(2) > div > div:nth-child(2) > div:nth-child(2) > div:nth-child(2) > div" + ) + this.popupChangeChatName = page + .locator("div") + .filter({ hasText: /^Change chat nameNameSaveCancel$/ }) + .nth(1) + this.inputChangeChatName = page.getByRole("textbox") + this.buttonSaveChatName = page + .locator("div") + .filter({ hasText: /^Save$/ }) + .first() + this.groupName = page.locator( + '//*[@id="root"]/div/div[2]/div/div/div/div/div/div[1]/div/div[2]/div[2]/div/div/div/div[1]/div/div[1]/div[1]/div/div/div/div/div/div[1]/div[3]/div[2]/div[2]/div/div/div/div[1]/div/div/div[2]/div[1]/div[2]' + ) + } +} diff --git a/samples/e2e-tests/tests/chat.spec.ts b/samples/e2e-tests/tests/chat.spec.ts new file mode 100644 index 00000000..cfc19aee --- /dev/null +++ b/samples/e2e-tests/tests/chat.spec.ts @@ -0,0 +1,131 @@ +import { expect, test } from "@playwright/test" +import { getRandomString, getRandomTestUserMention } from "./helpers" + +import { LoginPageComponent } from "../screen-object/login-page" +import { ChannelListComponent } from "../screen-object/channel-list" +import { NewChatPageComponent } from "../screen-object/newchat-page" +import { MessageListComponent } from "../screen-object/message-list" + +test.describe("Chat smoke tests.", () => { + test("chat setting functionality smoke test CSK-322. Should create group chat rename it and leave chat.", async ({ + page, + }) => { + const randomMessage = getRandomString(10) + const randomChatName = getRandomString(5) + const loginPageComponent = new LoginPageComponent(page) + const channelListComponent = new ChannelListComponent(page) + const newChatPageComponent = new NewChatPageComponent(page) + const messageListComponent = new MessageListComponent(page) + + await page.goto("http://localhost:19006") + + await expect(loginPageComponent.inputUserId).toBeVisible() + + await loginPageComponent.buttonLogin.tap() + await channelListComponent.iconChat.tap() + await newChatPageComponent.buttonGroupChat.tap() + await newChatPageComponent.inputGroupName.fill(randomMessage) + await newChatPageComponent.groupMemberTwo.tap() + await newChatPageComponent.groupMemberOne.tap() + await newChatPageComponent.groupMemberThree.tap() + await newChatPageComponent.buttonCreateGroup.tap() + await messageListComponent.inputMessage.fill(randomMessage) + await messageListComponent.buttonSendMessage.tap() + + await expect(messageListComponent.messageSent).toContainText(randomMessage) + + await newChatPageComponent.iconHeadGroupChat.tap() + await newChatPageComponent.buttonChangeNameGroup.tap() + + await expect(newChatPageComponent.popupChangeChatName).toBeVisible() + + await newChatPageComponent.inputChangeChatName.fill(randomChatName) + await newChatPageComponent.buttonSaveChatName.tap() + + await expect(newChatPageComponent.groupName).toContainText(randomChatName) + + await newChatPageComponent.buttonLeaveConversationGroup.tap() + + await expect(channelListComponent.containerChannelList).not.toContainText(randomChatName) + }) + test("WIP people interface functionality smoke test CSK-321", async ({ page }) => { + const randomMention = getRandomTestUserMention() + const loginPageComponent = new LoginPageComponent(page) + const channelListComponent = new ChannelListComponent(page) + const newChatPageComponent = new NewChatPageComponent(page) + const messageListComponent = new MessageListComponent(page) + + await page.goto("http://localhost:19006") + await expect(loginPageComponent.inputUserId).toBeVisible() + await loginPageComponent.buttonLogin.click() + + await expect(channelListComponent.containerChannelList).toBeVisible() + await expect(channelListComponent.headerUser).toBeVisible() + await expect(channelListComponent.inputSearchChannelList).toBeVisible() + await expect(channelListComponent.sectionUnread).toBeVisible() + await expect(channelListComponent.sectionPublicChannels).toBeVisible() + await expect(channelListComponent.sectionGroups).toBeVisible() + await expect(channelListComponent.iconChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await channelListComponent.iconChat.click() + + await expect(newChatPageComponent.headerNewChat).toBeVisible() + await expect(newChatPageComponent.inputSearchNewChatPage).toBeVisible() + await expect(newChatPageComponent.buttonGroupChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await newChatPageComponent.sectionUserDirectChat.click() + await expect(messageListComponent.buttonLoadEarlierMessages).toBeVisible() + + await messageListComponent.inputMessage.fill("@test-user") + await messageListComponent.wrapperMentionUserList.click() + await messageListComponent.inputMessage.fill(randomMention) + await messageListComponent.buttonSendMessage.click() + await channelListComponent.iconFooterMentions.click() + }) + test("WIP notifications functionality smoke test CSK-323", async ({ page }) => { + const randomMention = getRandomTestUserMention() + const loginPageComponent = new LoginPageComponent(page) + const channelListComponent = new ChannelListComponent(page) + const newChatPageComponent = new NewChatPageComponent(page) + const messageListComponent = new MessageListComponent(page) + + await page.goto("http://localhost:19006") + await expect(loginPageComponent.inputUserId).toBeVisible() + await loginPageComponent.buttonLogin.click() + + await expect(channelListComponent.containerChannelList).toBeVisible() + await expect(channelListComponent.headerUser).toBeVisible() + await expect(channelListComponent.inputSearchChannelList).toBeVisible() + await expect(channelListComponent.sectionUnread).toBeVisible() + await expect(channelListComponent.sectionPublicChannels).toBeVisible() + await expect(channelListComponent.sectionGroups).toBeVisible() + await expect(channelListComponent.iconChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await channelListComponent.iconChat.click() + + await expect(newChatPageComponent.headerNewChat).toBeVisible() + await expect(newChatPageComponent.inputSearchNewChatPage).toBeVisible() + await expect(newChatPageComponent.buttonGroupChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await newChatPageComponent.sectionUserDirectChat.click() + await expect(messageListComponent.buttonLoadEarlierMessages).toBeVisible() + + await messageListComponent.inputMessage.fill("@test-user") + await messageListComponent.wrapperMentionUserList.click() + await messageListComponent.inputMessage.fill(randomMention) + await messageListComponent.buttonSendMessage.click() + await channelListComponent.iconFooterMentions.click() + }) +}) diff --git a/samples/e2e-tests/tests/helpers.ts b/samples/e2e-tests/tests/helpers.ts new file mode 100644 index 00000000..5ad2348d --- /dev/null +++ b/samples/e2e-tests/tests/helpers.ts @@ -0,0 +1,12 @@ +export function getRandomString(length: number): string { + const characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + let result = "" + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * characters.length)) + } + return result +} + +export function getRandomTestUserMention(): string { + return "@test-user" + getRandomString(5) +} diff --git a/samples/e2e-tests/tests/message-input.spec.ts b/samples/e2e-tests/tests/message-input.spec.ts deleted file mode 100644 index 837af31e..00000000 --- a/samples/e2e-tests/tests/message-input.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect, test } from "@playwright/test" - -import { MessageInputComponent } from "../screen-object/message-input.component" -import { MessageListComponent } from "../screen-object/message-input.component" - -test.describe("Message input smoke tests.", () => { - test("Message input verify", async ({ page }) => { - const messageInputComponent = new MessageInputComponent(page) - - await page.goto("http://localhost:5173/") - await expect(messageInputComponent.containerMessageInput).toBeVisible() - }) - - test("Send a simple message", async ({ page }) => { - const messageListComponent = new MessageListComponent(page) - const messageInputComponent = new MessageInputComponent(page) - - await page.goto("http://localhost:5173/") - await messageInputComponent.inputMessage.fill("What about now?") - await messageInputComponent.buttonSendMessage.click() - await expect(messageListComponent.containerUserMessage).toBeVisible() - }) -}) diff --git a/samples/e2e-tests/tests/message.spec.ts b/samples/e2e-tests/tests/message.spec.ts new file mode 100644 index 00000000..306e4900 --- /dev/null +++ b/samples/e2e-tests/tests/message.spec.ts @@ -0,0 +1,216 @@ +import { expect, test } from "@playwright/test" +import { getRandomTestUserMention, getRandomString } from "./helpers" + +import { LoginPageComponent } from "../screen-object/login-page" +import { ChannelListComponent } from "../screen-object/channel-list" +import { NewChatPageComponent } from "../screen-object/newchat-page" +import { MessageListComponent } from "../screen-object/message-list" + +test.describe("Message smoke tests.", () => { + test("@mention functionality smoke test CSK-319", async ({ page }) => { + const randomMention = getRandomTestUserMention() + const loginPageComponent = new LoginPageComponent(page) + const channelListComponent = new ChannelListComponent(page) + const newChatPageComponent = new NewChatPageComponent(page) + const messageListComponent = new MessageListComponent(page) + + await page.goto("http://localhost:19006") + + await expect(loginPageComponent.inputUserId).toBeVisible() + + await loginPageComponent.buttonLogin.click() + + await expect(channelListComponent.containerChannelList).toBeVisible() + await expect(channelListComponent.headerUser).toBeVisible() + await expect(channelListComponent.inputSearchChannelList).toBeVisible() + await expect(channelListComponent.sectionUnread).toBeVisible() + await expect(channelListComponent.sectionPublicChannels).toBeVisible() + await expect(channelListComponent.sectionGroups).toBeVisible() + await expect(channelListComponent.iconChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await channelListComponent.iconChat.click() + + await expect(newChatPageComponent.headerNewChat).toBeVisible() + await expect(newChatPageComponent.inputSearchNewChatPage).toBeVisible() + await expect(newChatPageComponent.buttonGroupChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await newChatPageComponent.sectionUserDirectChat.click() + + await expect(messageListComponent.buttonLoadEarlierMessages).toBeVisible() + + await messageListComponent.inputMessage.fill("@test-user") + await messageListComponent.wrapperMentionUserList.click() + await messageListComponent.inputMessage.fill(randomMention) + await messageListComponent.buttonSendMessage.click() + await channelListComponent.iconFooterMentions.click() + + await expect(messageListComponent.containerMentionsList).toBeVisible() + await expect(messageListComponent.containerMentionsList).toContainText(randomMention) + }) + test("pin message functionality smoke test CSK-317", async ({ page }) => { + const randomMention = getRandomTestUserMention() + const loginPageComponent = new LoginPageComponent(page) + const channelListComponent = new ChannelListComponent(page) + const newChatPageComponent = new NewChatPageComponent(page) + const messageListComponent = new MessageListComponent(page) + + await page.goto("http://localhost:19006") + + await expect(loginPageComponent.inputUserId).toBeVisible() + + await loginPageComponent.buttonLogin.tap() + + await expect(channelListComponent.containerChannelList).toBeVisible() + await expect(channelListComponent.headerUser).toBeVisible() + await expect(channelListComponent.inputSearchChannelList).toBeVisible() + await expect(channelListComponent.sectionUnread).toBeVisible() + await expect(channelListComponent.sectionPublicChannels).toBeVisible() + await expect(channelListComponent.sectionGroups).toBeVisible() + await expect(channelListComponent.iconChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await channelListComponent.iconChat.tap() + + await expect(newChatPageComponent.headerNewChat).toBeVisible() + await expect(newChatPageComponent.inputSearchNewChatPage).toBeVisible() + await expect(newChatPageComponent.buttonGroupChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await newChatPageComponent.sectionUserDirectChat.tap() + + await expect(messageListComponent.buttonLoadEarlierMessages).toBeVisible() + + await messageListComponent.inputMessage.fill("@test-user") + await messageListComponent.wrapperMentionUserList.click() + await messageListComponent.inputMessage.fill(randomMention) + await messageListComponent.buttonSendMessage.tap() + + await expect(messageListComponent.messageSent).toBeVisible() + + await messageListComponent.messageSent.tap({ noWaitAfter: false }) + + await expect(messageListComponent.containerActions).toBeVisible() + + await messageListComponent.buttonPinMessage.tap() + + await messageListComponent.buttonPinIconHead.tap() + + await expect(messageListComponent.messagePinned).toContainText(randomMention) + }) + test("quote messages functionality smoke test CSK-318", async ({ page }) => { + const randomMessage = getRandomString(10) + const loginPageComponent = new LoginPageComponent(page) + const channelListComponent = new ChannelListComponent(page) + const newChatPageComponent = new NewChatPageComponent(page) + const messageListComponent = new MessageListComponent(page) + + await page.goto("http://localhost:19006") + + await expect(loginPageComponent.inputUserId).toBeVisible() + + await loginPageComponent.buttonLogin.tap() + + await expect(channelListComponent.containerChannelList).toBeVisible() + await expect(channelListComponent.headerUser).toBeVisible() + await expect(channelListComponent.inputSearchChannelList).toBeVisible() + await expect(channelListComponent.sectionUnread).toBeVisible() + await expect(channelListComponent.sectionPublicChannels).toBeVisible() + await expect(channelListComponent.sectionGroups).toBeVisible() + await expect(channelListComponent.iconChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await channelListComponent.iconChat.tap() + + await expect(newChatPageComponent.headerNewChat).toBeVisible() + await expect(newChatPageComponent.inputSearchNewChatPage).toBeVisible() + await expect(newChatPageComponent.buttonGroupChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await newChatPageComponent.sectionUserDirectChat.tap() + + await expect(messageListComponent.buttonLoadEarlierMessages).toBeVisible() + + await messageListComponent.inputMessage.fill(randomMessage) + await messageListComponent.buttonSendMessage.tap() + + await expect(messageListComponent.messageSent).toBeVisible() + + await messageListComponent.messageSent.tap({ noWaitAfter: false }) + + await expect(messageListComponent.containerActions).toBeVisible() + + await messageListComponent.buttonQuoteMessageActions.tap() + + await messageListComponent.inputMessage.fill(randomMessage) + await messageListComponent.buttonSendMessage.tap() + + await expect(messageListComponent.messageQuoted).toContainText(randomMessage) + }) + test("thread view functionality smoke test CSK-320", async ({ page }) => { + const randomMessage = getRandomString(10) + const loginPageComponent = new LoginPageComponent(page) + const channelListComponent = new ChannelListComponent(page) + const newChatPageComponent = new NewChatPageComponent(page) + const messageListComponent = new MessageListComponent(page) + + await page.goto("http://localhost:19006") + + await expect(loginPageComponent.inputUserId).toBeVisible() + + await loginPageComponent.buttonLogin.tap() + + await expect(channelListComponent.containerChannelList).toBeVisible() + await expect(channelListComponent.headerUser).toBeVisible() + await expect(channelListComponent.inputSearchChannelList).toBeVisible() + await expect(channelListComponent.sectionUnread).toBeVisible() + await expect(channelListComponent.sectionPublicChannels).toBeVisible() + await expect(channelListComponent.sectionGroups).toBeVisible() + await expect(channelListComponent.iconChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await channelListComponent.iconChat.tap() + + await expect(newChatPageComponent.headerNewChat).toBeVisible() + await expect(newChatPageComponent.inputSearchNewChatPage).toBeVisible() + await expect(newChatPageComponent.buttonGroupChat).toBeVisible() + await expect(channelListComponent.iconFooterHome).toBeVisible() + await expect(channelListComponent.iconFooterMentions).toBeVisible() + await expect(channelListComponent.iconFooterProfile).toBeVisible() + + await newChatPageComponent.sectionUserDirectChat.tap() + + await expect(messageListComponent.buttonLoadEarlierMessages).toBeVisible() + + await messageListComponent.inputMessage.fill(randomMessage) + await messageListComponent.buttonSendMessage.tap() + + await expect(messageListComponent.messageSent).toBeVisible() + + await messageListComponent.messageSent.tap({ noWaitAfter: false }) + + await expect(messageListComponent.containerActions).toBeVisible() + + await messageListComponent.buttonReplyInThreadActions.tap() + + await messageListComponent.inputMessage.fill(randomMessage) + await messageListComponent.buttonSendMessage.tap() + + await expect(messageListComponent.messageSent).toContainText(randomMessage) + }) +})