Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new channel page tests #6345

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion tests/sanity/tests/chat/chat.spec.ts
Original file line number Diff line number Diff line change
@@ -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,40 @@ 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.clickPinMessageButton()
await channelPage.checkIfMessageExist(true, 'Test message')
await channelPage.clickPinMessageButton()
await channelPage.checkIfMessageExist(true, 'Test message')
await channelPage.clickPinMessageButton()
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')
11 changes: 11 additions & 0 deletions tests/sanity/tests/model/channel-page.ts
Original file line number Diff line number Diff line change
@@ -115,6 +115,10 @@ export class ChannelPage extends CommonPage {
await this.saveMessageTab().click()
}

async clickPinMessageButton(): Promise<void> {
await this.pinnedMessageButton().click()
}

async addMemberToChannelPreview (user: string): Promise<void> {
await this.addMemberPreview().click()
await this.addMemberToChannelButton(user).click()
@@ -182,6 +186,13 @@ export class ChannelPage extends CommonPage {
await expect(this.pinnedMessage(message)).toBeVisible()
}

async unpinMessage (message: string): Promise<void> {
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<void> {
await this.textMessage(message).hover()
await this.replyButton().click()