From 69fda72f73bbff38a946d3bb692d5060d34e61d2 Mon Sep 17 00:00:00 2001 From: jkrusty Date: Fri, 16 Aug 2024 18:55:41 +0400 Subject: [PATCH 1/5] pin -> replay test & add pin chat.spec.ts Signed-off-by: jkrusty --- tests/sanity/tests/chat/chat.spec.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/sanity/tests/chat/chat.spec.ts b/tests/sanity/tests/chat/chat.spec.ts index 0ba12e2987..08e3e10a55 100644 --- a/tests/sanity/tests/chat/chat.spec.ts +++ b/tests/sanity/tests/chat/chat.spec.ts @@ -281,7 +281,7 @@ test.describe('channel tests', () => { await channelPage.checkIfMessageExist(true, 'Test message') }) - test('check if user can pin message', async () => { + test('check if user can reply message', async () => { await leftSideMenuPage.clickChunter() await channelPage.clickChannel('random') await channelPage.sendMessage('Test message') @@ -291,6 +291,17 @@ test.describe('channel tests', () => { await channelPage.checkIfMessageExist(true, 'Reply message') }) + test('check if user can pin message', async () => { + await leftSideMenuPage.clickChunter() + await channelPage.clickChannel('random') + await channelPage.sendMessage('Test message') + await channelPage.pinMessage('Test message') + await channelPage.clickPinMessageTub() + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.closeAndOpenPinMessage() + await channelPage.checkIfMessageExist(true, 'Test message') + }) + test('check if user can edit message', async ({ page }) => { await leftSideMenuPage.clickChunter() await channelPage.clickChannel('random') From d3f99f06da5e53c94673419a946c0a724d22bb8b Mon Sep 17 00:00:00 2001 From: jkrusty Date: Fri, 16 Aug 2024 19:04:12 +0400 Subject: [PATCH 2/5] add clickPinMessageButton channel-page.ts Signed-off-by: jkrusty --- tests/sanity/tests/model/channel-page.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sanity/tests/model/channel-page.ts b/tests/sanity/tests/model/channel-page.ts index d4c898ea3d..9e940be583 100644 --- a/tests/sanity/tests/model/channel-page.ts +++ b/tests/sanity/tests/model/channel-page.ts @@ -115,6 +115,10 @@ export class ChannelPage extends CommonPage { await this.saveMessageTab().click() } + async clickPinMessageButton(): Promise { + await this.pinnedMessageButton().click() + } + async addMemberToChannelPreview (user: string): Promise { await this.addMemberPreview().click() await this.addMemberToChannelButton(user).click() From 6b68a56e97996b7c95b42488b189f6d42fec4975 Mon Sep 17 00:00:00 2001 From: jkrusty Date: Fri, 16 Aug 2024 19:07:18 +0400 Subject: [PATCH 3/5] change to clickPinMessageButton chat.spec.ts Signed-off-by: jkrusty --- tests/sanity/tests/chat/chat.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sanity/tests/chat/chat.spec.ts b/tests/sanity/tests/chat/chat.spec.ts index 08e3e10a55..6d9a4f35fe 100644 --- a/tests/sanity/tests/chat/chat.spec.ts +++ b/tests/sanity/tests/chat/chat.spec.ts @@ -296,9 +296,11 @@ test.describe('channel tests', () => { await channelPage.clickChannel('random') await channelPage.sendMessage('Test message') await channelPage.pinMessage('Test message') - await channelPage.clickPinMessageTub() + await channelPage.clickPinMessageButton() await channelPage.checkIfMessageExist(true, 'Test message') - await channelPage.closeAndOpenPinMessage() + await channelPage.clickPinMessageButton() + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.clickPinMessageButton() await channelPage.checkIfMessageExist(true, 'Test message') }) From fc49e7de640e7e1defe34bdebd49fdba11db55a2 Mon Sep 17 00:00:00 2001 From: jkrusty Date: Fri, 16 Aug 2024 19:17:20 +0400 Subject: [PATCH 4/5] add unpinMessage channel-page.ts Signed-off-by: jkrusty --- tests/sanity/tests/model/channel-page.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/sanity/tests/model/channel-page.ts b/tests/sanity/tests/model/channel-page.ts index 9e940be583..dd9016b6d9 100644 --- a/tests/sanity/tests/model/channel-page.ts +++ b/tests/sanity/tests/model/channel-page.ts @@ -186,6 +186,13 @@ export class ChannelPage extends CommonPage { await expect(this.pinnedMessage(message)).toBeVisible() } + async unpinMessage (message: string): Promise { + await this.textMessage(message).hover() + await this.pinMessageButton().click() + await this.pinnedMessageButton().click() + await expect(this.pinnedMessage(message)).not.toBeVisible() + } + async replyToMessage (message: string, messageReply: string): Promise { await this.textMessage(message).hover() await this.replyButton().click() From 1e6056f84847f6622ab505586ed889b9d09a37be Mon Sep 17 00:00:00 2001 From: jkrusty Date: Fri, 16 Aug 2024 19:18:57 +0400 Subject: [PATCH 5/5] add unpin message tests chat.spec.ts Signed-off-by: jkrusty --- tests/sanity/tests/chat/chat.spec.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/sanity/tests/chat/chat.spec.ts b/tests/sanity/tests/chat/chat.spec.ts index 6d9a4f35fe..f0e91a6851 100644 --- a/tests/sanity/tests/chat/chat.spec.ts +++ b/tests/sanity/tests/chat/chat.spec.ts @@ -304,6 +304,27 @@ test.describe('channel tests', () => { await channelPage.checkIfMessageExist(true, 'Test message') }) + test('check if user can unpin message on pinned messages page', async () => { + await leftSideMenuPage.clickChunter() + await channelPage.clickChannel('random') + await channelPage.sendMessage('Test message') + await channelPage.pinMessage('Test message') + await channelPage.clickPinMessageButton() + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.unpinMessage('Test message') + await channelPage.checkIfMessageExist(false, 'Test message') + }) + + test('check if user can unpin message messages page', async () => { + await leftSideMenuPage.clickChunter() + await channelPage.clickChannel('random') + await channelPage.sendMessage('Test message') + await channelPage.pinMessage('Test message') + await channelPage.checkIfMessageExist(true, 'Test message') + await channelPage.unpinMessage('Test message') + await channelPage.checkIfMessageExist(false, 'Test message') + }) + test('check if user can edit message', async ({ page }) => { await leftSideMenuPage.clickChunter() await channelPage.clickChannel('random')