Add tests for filter change in inbox (#5851)

Signed-off-by: Jasmin <jasmin@hardcoreeng.com>
This commit is contained in:
JasminMus 2024-06-19 15:48:39 +02:00 committed by GitHub
parent e76316f18b
commit 8ea10fbdb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 46 additions and 1 deletions

View File

@ -255,4 +255,40 @@ test.describe('Inbox tests', () => {
await leftSideMenuPageSecond.clickNotification()
await inboxPageSecond.checkIfInboxChatExists('Channel general', false)
})
test('User is able to change filter in inbox', async ({ page, browser }) => {
const channelPage = new ChannelPage(page)
await leftSideMenuPage.openProfileMenu()
await leftSideMenuPage.inviteToWorkspace()
await leftSideMenuPage.getInviteLink()
const linkText = await page.locator('.antiPopup .link').textContent()
const page2 = await browser.newPage()
const leftSideMenuPageSecond = new LeftSideMenuPage(page2)
const inboxPageSecond = new InboxPage(page2)
await leftSideMenuPage.clickOnCloseInvite()
await page2.goto(linkText ?? '')
const joinPage = new SignInJoinPage(page2)
await joinPage.join(newUser2)
await leftSideMenuPage.clickChunter()
await channelPage.clickChannel('general')
await channelPage.sendMessage('Test message')
await leftSideMenuPage.clickTracker()
const newIssue = createNewIssueData(newUser2.firstName, newUser2.lastName)
await prepareNewIssueWithOpenStep(page, newIssue)
await issuesDetailsPage.checkIssue({
...newIssue,
milestone: 'Milestone',
estimation: '2h'
})
await leftSideMenuPageSecond.clickTracker()
await leftSideMenuPageSecond.clickNotification()
await inboxPageSecond.clickOnInboxFilter('Channels')
await inboxPageSecond.checkIfInboxChatExists(newIssue.title, false)
await inboxPageSecond.checkIfInboxChatExists('Test message', true)
await inboxPageSecond.clickOnInboxFilter('Issues')
await inboxPageSecond.checkIfIssueIsPresentInInbox(newIssue.title)
await inboxPageSecond.checkIfInboxChatExists('Channel general', false)
})
})

View File

@ -12,6 +12,7 @@ export class InboxPage {
readonly leftSidePanelOpen = (): Locator => this.page.locator('#btnPAside')
readonly leftSidePanelClose = (): Locator => this.page.locator('#btnPClose')
readonly inboxChat = (text: string): Locator => this.page.getByText(text)
readonly issueTitle = (issueTitle: string): Locator => this.page.getByTitle(issueTitle)
// ACTIONS
@ -39,6 +40,14 @@ export class InboxPage {
await this.inboxChat(text).click()
}
async clickOnInboxFilter (text: string): Promise<void> {
await this.inboxChat(text).click()
}
async checkIfIssueIsPresentInInbox (issueTitle: string): Promise<void> {
await expect(this.issueTitle(issueTitle)).toBeVisible()
}
async checkIfInboxChatExists (text: string, exists: boolean): Promise<void> {
if (exists) {
await expect(this.inboxChat(text)).toBeVisible()

View File

@ -185,7 +185,7 @@ test.describe('Tracker sub-issues tests', () => {
await issuesDetailsPage.moreActionOnIssue('Move to project')
await issuesDetailsPage.fillMoveIssuesModal(secondProjectName)
await page.waitForTimeout(1000)
await issuesDetailsPage.openSubIssueByName(newSubIssue.title)
await expect(issuesDetailsPage.textIdentifier()).toHaveText(/SECON-\d+/)
})