diff --git a/tests/sanity/tests/inbox/inbox.spec.ts b/tests/sanity/tests/inbox/inbox.spec.ts index 3b0fe1a8d6..2d826e3a18 100644 --- a/tests/sanity/tests/inbox/inbox.spec.ts +++ b/tests/sanity/tests/inbox/inbox.spec.ts @@ -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) + }) }) diff --git a/tests/sanity/tests/model/inbox.ts/inbox-page.ts b/tests/sanity/tests/model/inbox.ts/inbox-page.ts index 6a8a607567..d8ad4a116a 100644 --- a/tests/sanity/tests/model/inbox.ts/inbox-page.ts +++ b/tests/sanity/tests/model/inbox.ts/inbox-page.ts @@ -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 { + await this.inboxChat(text).click() + } + + async checkIfIssueIsPresentInInbox (issueTitle: string): Promise { + await expect(this.issueTitle(issueTitle)).toBeVisible() + } + async checkIfInboxChatExists (text: string, exists: boolean): Promise { if (exists) { await expect(this.inboxChat(text)).toBeVisible() diff --git a/tests/sanity/tests/tracker/subissues.spec.ts b/tests/sanity/tests/tracker/subissues.spec.ts index e77c9b1d85..ea6643634f 100644 --- a/tests/sanity/tests/tracker/subissues.spec.ts +++ b/tests/sanity/tests/tracker/subissues.spec.ts @@ -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+/) })