diff --git a/tests/sanity-ws/000005/doc-index-state-1700601525062-0.snp.gz b/tests/sanity-ws/000005/doc-index-state-1700601525062-0.snp.gz new file mode 100644 index 0000000000..e55b2d02fa Binary files /dev/null and b/tests/sanity-ws/000005/doc-index-state-1700601525062-0.snp.gz differ diff --git a/tests/sanity-ws/000005/doc-index-state-data-1700601525062-1.tar.gz b/tests/sanity-ws/000005/doc-index-state-data-1700601525062-1.tar.gz new file mode 100644 index 0000000000..a265bc19d3 Binary files /dev/null and b/tests/sanity-ws/000005/doc-index-state-data-1700601525062-1.tar.gz differ diff --git a/tests/sanity-ws/000005/fulltext-blob-1700601525062-0.snp.gz b/tests/sanity-ws/000005/fulltext-blob-1700601525062-0.snp.gz new file mode 100644 index 0000000000..37961aa974 Binary files /dev/null and b/tests/sanity-ws/000005/fulltext-blob-1700601525062-0.snp.gz differ diff --git a/tests/sanity-ws/000005/fulltext-blob-data-1700601525062-1.tar.gz b/tests/sanity-ws/000005/fulltext-blob-data-1700601525062-1.tar.gz new file mode 100644 index 0000000000..8dc08806f2 Binary files /dev/null and b/tests/sanity-ws/000005/fulltext-blob-data-1700601525062-1.tar.gz differ diff --git a/tests/sanity-ws/000005/space-1700601525062-0.snp.gz b/tests/sanity-ws/000005/space-1700601525062-0.snp.gz new file mode 100644 index 0000000000..278f99a542 Binary files /dev/null and b/tests/sanity-ws/000005/space-1700601525062-0.snp.gz differ diff --git a/tests/sanity-ws/000005/space-data-1700601525062-1.tar.gz b/tests/sanity-ws/000005/space-data-1700601525062-1.tar.gz new file mode 100644 index 0000000000..c1a5828275 Binary files /dev/null and b/tests/sanity-ws/000005/space-data-1700601525062-1.tar.gz differ diff --git a/tests/sanity-ws/000005/task-1700601525062-0.snp.gz b/tests/sanity-ws/000005/task-1700601525062-0.snp.gz new file mode 100644 index 0000000000..17bf225656 Binary files /dev/null and b/tests/sanity-ws/000005/task-1700601525062-0.snp.gz differ diff --git a/tests/sanity-ws/000005/task-data-1700601525062-1.tar.gz b/tests/sanity-ws/000005/task-data-1700601525062-1.tar.gz new file mode 100644 index 0000000000..5abb377c38 Binary files /dev/null and b/tests/sanity-ws/000005/task-data-1700601525062-1.tar.gz differ diff --git a/tests/sanity-ws/000005/tx-1700601525062-0.snp.gz b/tests/sanity-ws/000005/tx-1700601525062-0.snp.gz new file mode 100644 index 0000000000..226a07bf6c Binary files /dev/null and b/tests/sanity-ws/000005/tx-1700601525062-0.snp.gz differ diff --git a/tests/sanity-ws/000005/tx-data-1700601525062-1.tar.gz b/tests/sanity-ws/000005/tx-data-1700601525062-1.tar.gz new file mode 100644 index 0000000000..178135a124 Binary files /dev/null and b/tests/sanity-ws/000005/tx-data-1700601525062-1.tar.gz differ diff --git a/tests/sanity-ws/backup.json.gz b/tests/sanity-ws/backup.json.gz index 079c68b576..c1d05209ec 100644 Binary files a/tests/sanity-ws/backup.json.gz and b/tests/sanity-ws/backup.json.gz differ diff --git a/tests/sanity/tests/collaborative/issues.spec.ts b/tests/sanity/tests/collaborative/issues.spec.ts index a8661d569a..9e0ef4ef3d 100644 --- a/tests/sanity/tests/collaborative/issues.spec.ts +++ b/tests/sanity/tests/collaborative/issues.spec.ts @@ -5,6 +5,7 @@ import { NewIssue } from '../model/tracker/types' import { IssuesPage } from '../model/tracker/issues-page' import { LeftSideMenuPage } from '../model/left-side-menu-page' import { IssuesDetailsPage } from '../model/tracker/issues-details-page' +import { NotificationPage } from '../model/notification-page' test.use({ storageState: PlatformSetting @@ -35,8 +36,6 @@ test.describe('Collaborative test for issue', () => { // open second page const userSecondPage = await getSecondPage(browser) await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() - const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage) - await leftSideMenuPageSecond.buttonTracker.click() const issuesPageSecond = new IssuesPage(userSecondPage) await issuesPageSecond.linkSidebarAll.click() @@ -75,8 +74,6 @@ test.describe('Collaborative test for issue', () => { // open second page const userSecondPage = await getSecondPage(browser) await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() - const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage) - await leftSideMenuPageSecond.buttonTracker.click() const issuesPageSecond = new IssuesPage(userSecondPage) await issuesPageSecond.linkSidebarAll.click() @@ -108,4 +105,51 @@ test.describe('Collaborative test for issue', () => { status: 'In Progress' }) }) + + test('First user change assignee, second user should see assigned issue', async ({ page, browser }) => { + const newAssignee: string = 'Dirak Kainin' + const issue: NewIssue = { + title: 'First user change assignee, second user should see assigned issue', + description: 'Issue for collaborative test' + } + + // open second page + const userSecondPage = await getSecondPage(browser) + await (await userSecondPage.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() + + await test.step(`user1. change assignee to ${newAssignee}`, async () => { + await (await page.goto(`${PlatformURI}/workbench/sanity-ws/tracker/`))?.finished() + const issuesPage = new IssuesPage(page) + await issuesPage.linkSidebarAll.click() + await issuesPage.modelSelectorBacklog.click() + await issuesPage.searchIssueByName(issue.title) + await issuesPage.openIssueByName(issue.title) + + const issuesDetailsPage = new IssuesDetailsPage(page) + await issuesDetailsPage.editIssue({ assignee: newAssignee }) + }) + + await test.step('user2. check notification', async () => { + const leftSideMenuPageSecond = new LeftSideMenuPage(userSecondPage) + await leftSideMenuPageSecond.checkExistNewNotification(userSecondPage) + await leftSideMenuPageSecond.buttonNotification.click() + + const notificationPageSecond = new NotificationPage(userSecondPage) + await notificationPageSecond.checkNotification(issue.title, newAssignee) + + await leftSideMenuPageSecond.buttonTracker.click() + }) + + await test.step('user2. check issue assignee', async () => { + const issuesPageSecond = new IssuesPage(userSecondPage) + await issuesPageSecond.linkSidebarMyIssue.click() + await issuesPageSecond.modelSelectorBacklog.click() + + await issuesPageSecond.searchIssueByName(issue.title) + await issuesPageSecond.openIssueByName(issue.title) + + const issuesDetailsPageSecond = new IssuesDetailsPage(userSecondPage) + await issuesDetailsPageSecond.checkIssue({ ...issue }) + }) + }) }) diff --git a/tests/sanity/tests/model/common-page.ts b/tests/sanity/tests/model/common-page.ts index 15d481c223..29c175cc67 100644 --- a/tests/sanity/tests/model/common-page.ts +++ b/tests/sanity/tests/model/common-page.ts @@ -53,4 +53,8 @@ export class CommonPage { } await page.locator('div.selectPopup div.list-item').click() } + + async checkExistNewNotification (page: Page): Promise { + await expect(page.locator('button[id$="Inbox"] > div.noty')).toBeVisible() + } } diff --git a/tests/sanity/tests/model/left-side-menu-page.ts b/tests/sanity/tests/model/left-side-menu-page.ts index ef47bde6a5..5c4e6d27df 100644 --- a/tests/sanity/tests/model/left-side-menu-page.ts +++ b/tests/sanity/tests/model/left-side-menu-page.ts @@ -1,15 +1,19 @@ import { type Locator, type Page } from '@playwright/test' +import { CommonPage } from './common-page' -export class LeftSideMenuPage { +export class LeftSideMenuPage extends CommonPage { readonly page: Page readonly buttonChunter: Locator readonly buttonContacts: Locator readonly buttonTracker: Locator + readonly buttonNotification: Locator constructor (page: Page) { + super() this.page = page this.buttonChunter = page.locator('button[id$="ApplicationLabelChunter"]') this.buttonContacts = page.locator('button[id$="Contacts"]') this.buttonTracker = page.locator('button[id$="TrackerApplication"]') + this.buttonNotification = page.locator('button[id$="Inbox"]') } } diff --git a/tests/sanity/tests/model/notification-page.ts b/tests/sanity/tests/model/notification-page.ts new file mode 100644 index 0000000000..a5516c33fd --- /dev/null +++ b/tests/sanity/tests/model/notification-page.ts @@ -0,0 +1,14 @@ +import { expect, type Page } from '@playwright/test' + +export class NotificationPage { + readonly page: Page + + constructor (page: Page) { + this.page = page + } + + async checkNotification (name: string, assignee: string): Promise { + const notification = this.page.locator('div[class*="inbox-activity"] span', { hasText: name }) + await expect(notification.locator('xpath=../../..').locator('a span.ap-label')).toHaveText(assignee) + } +} diff --git a/tests/sanity/tests/model/tracker/issues-page.ts b/tests/sanity/tests/model/tracker/issues-page.ts index d068e86584..9627f092e1 100644 --- a/tests/sanity/tests/model/tracker/issues-page.ts +++ b/tests/sanity/tests/model/tracker/issues-page.ts @@ -24,6 +24,7 @@ export class IssuesPage extends CommonTrackerPage { readonly buttonCreateIssue: Locator readonly inputSearch: Locator readonly linkSidebarAll: Locator + readonly linkSidebarMyIssue: Locator constructor (page: Page) { super(page) @@ -59,6 +60,7 @@ export class IssuesPage extends CommonTrackerPage { this.buttonCreateIssue = page.locator('button > span', { hasText: 'Create issue' }) this.inputSearch = page.locator('input[placeholder="Search"]') this.linkSidebarAll = page.locator('a[href$="all-issues"]') + this.linkSidebarMyIssue = page.locator('a[href$="my-issues"]') } async createNewIssue (data: NewIssue): Promise {