mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
Add tests for filter change in inbox (#5851)
Signed-off-by: Jasmin <jasmin@hardcoreeng.com>
This commit is contained in:
parent
e76316f18b
commit
8ea10fbdb7
@ -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)
|
||||
})
|
||||
})
|
||||
|
@ -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()
|
||||
|
@ -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+/)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user