mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-28 19:08:01 +00:00
TESTS-89: feat(tests): working on First user change assignee, second user should see assigned issue test (#4046)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
6f37f276e2
commit
a3bf9c8f73
BIN
tests/sanity-ws/000005/doc-index-state-1700601525062-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/doc-index-state-1700601525062-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000005/fulltext-blob-1700601525062-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/fulltext-blob-1700601525062-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/fulltext-blob-data-1700601525062-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/fulltext-blob-data-1700601525062-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/space-1700601525062-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/space-1700601525062-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/space-data-1700601525062-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/space-data-1700601525062-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/task-1700601525062-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/task-1700601525062-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/task-data-1700601525062-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/task-data-1700601525062-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/tx-1700601525062-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/tx-1700601525062-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/tx-data-1700601525062-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/tx-data-1700601525062-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -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 })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -53,4 +53,8 @@ export class CommonPage {
|
||||
}
|
||||
await page.locator('div.selectPopup div.list-item').click()
|
||||
}
|
||||
|
||||
async checkExistNewNotification (page: Page): Promise<void> {
|
||||
await expect(page.locator('button[id$="Inbox"] > div.noty')).toBeVisible()
|
||||
}
|
||||
}
|
||||
|
@ -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"]')
|
||||
}
|
||||
}
|
||||
|
14
tests/sanity/tests/model/notification-page.ts
Normal file
14
tests/sanity/tests/model/notification-page.ts
Normal file
@ -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<void> {
|
||||
const notification = this.page.locator('div[class*="inbox-activity"] span', { hasText: name })
|
||||
await expect(notification.locator('xpath=../../..').locator('a span.ap-label')).toHaveText(assignee)
|
||||
}
|
||||
}
|
@ -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<void> {
|
||||
|
Loading…
Reference in New Issue
Block a user