Skip to content

Commit

Permalink
add changes to test
Browse files Browse the repository at this point in the history
Signed-off-by: Jasmin <[email protected]>
  • Loading branch information
JasminMus committed May 21, 2024
1 parent 9b1a593 commit 573d39b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/sanity/tests/chat/chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ test.describe('channel tests', () => {
await channelPageSecond.checkIfChannelDefaultExist(false, data.channelName)
await channelPageSecond.clickChannelTab()
await channelPageSecond.checkIfChannelTableExist(data.channelName, true)
await channelPageSecond.clickJoinChannelButton()
await channelPageSecond.clickChooseChannel(data.channelName)
await channelPageSecond.checkMessageExist('Test message', true, 'Test message')
await channelPageSecond.sendMessage('My dream is to fly')
Expand Down Expand Up @@ -185,7 +186,7 @@ test.describe('channel tests', () => {
await channelPage.clickOnUser(data.lastName + ' ' + data.firstName)
await channelPage.addMemberToChannel(newUser2.lastName + ' ' + newUser2.firstName)
await leftSideMenuPageSecond.clickChunter()
await channelPageSecond.checkIfChannelDefaultExist(false, data.channelName)
await channelPageSecond.checkIfChannelDefaultExist(true, data.channelName)
await channelPageSecond.clickChannelTab()
await channelPageSecond.checkIfChannelTableExist(data.channelName, true)
await channelPageSecond.clickChooseChannel(data.channelName)
Expand Down
5 changes: 5 additions & 0 deletions tests/sanity/tests/model/channel-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class ChannelPage {
readonly closePopupWindow = (): Locator => this.page.locator('.root > div > .antiButton').first()
readonly openAddMemberToChannel = (userName: string): Locator => this.page.getByRole('button', { name: userName })
readonly addMemberToChannelButton = (userName: string): Locator => this.page.getByRole('button', { name: userName })
readonly joinChannelButton = (): Locator => this.page.getByRole('button', { name: 'Join' })

async sendMessage (message: string): Promise<void> {
await this.inputMessage().fill(message)
Expand Down Expand Up @@ -56,6 +57,10 @@ export class ChannelPage {
await this.openAddMemberToChannel(user).click()
}

async clickJoinChannelButton (): Promise<void> {
await this.joinChannelButton().click()
}

async checkIfChannelDefaultExist (shouldExist: boolean, channel: string): Promise<void> {
if (shouldExist) {
await expect(this.channelName(channel)).toBeVisible()
Expand Down

0 comments on commit 573d39b

Please sign in to comment.