mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
TESTS-193: TESTS-194: feat(tests): working on the tests (#4739)
Signed-off-by: Alex Velichko <alex@hardcoreeng.com>
This commit is contained in:
parent
f2fc595eca
commit
4c55ef48f3
14
tests/sanity/tests/tracker/common-steps.ts
Normal file
14
tests/sanity/tests/tracker/common-steps.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { Page, test } from '@playwright/test'
|
||||
import { IssuesPage } from '../model/tracker/issues-page'
|
||||
import { NewIssue } from '../model/tracker/types'
|
||||
|
||||
export async function prepareNewIssueStep (page: Page, issue: NewIssue): Promise<string> {
|
||||
return await test.step('Prepare document', async () => {
|
||||
const issuesPage = new IssuesPage(page)
|
||||
await issuesPage.modelSelectorAll.click()
|
||||
|
||||
await issuesPage.createNewIssue(issue)
|
||||
await issuesPage.searchIssueByName(issue.title)
|
||||
return await issuesPage.getIssueId(issue.title)
|
||||
})
|
||||
}
|
@ -5,6 +5,7 @@ import { NewIssue } from '../model/tracker/types'
|
||||
import { LeftSideMenuPage } from '../model/left-side-menu-page'
|
||||
import { IssuesDetailsPage } from '../model/tracker/issues-details-page'
|
||||
import { TrackerNavigationMenuPage } from '../model/tracker/tracker-navigation-menu-page'
|
||||
import { prepareNewIssueStep } from './common-steps'
|
||||
|
||||
test.use({
|
||||
storageState: PlatformSetting
|
||||
@ -26,16 +27,10 @@ test.describe('Relations', () => {
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const secondIssueId = await prepareNewIssueStep(page, secondIssue)
|
||||
const firstIssueId = await prepareNewIssueStep(page, firstIssue)
|
||||
|
||||
const issuesPage = new IssuesPage(page)
|
||||
await issuesPage.modelSelectorAll.click()
|
||||
|
||||
await issuesPage.createNewIssue(secondIssue)
|
||||
await issuesPage.searchIssueByName(secondIssue.title)
|
||||
const secondIssueId = await issuesPage.getIssueId(secondIssue.title)
|
||||
|
||||
await issuesPage.createNewIssue(firstIssue)
|
||||
await issuesPage.searchIssueByName(firstIssue.title)
|
||||
const firstIssueId = await issuesPage.getIssueId(firstIssue.title)
|
||||
await issuesPage.openIssueByName(firstIssue.title)
|
||||
|
||||
const issuesDetailsPage = new IssuesDetailsPage(page)
|
||||
@ -48,6 +43,7 @@ test.describe('Relations', () => {
|
||||
...firstIssue,
|
||||
blockedBy: secondIssueId
|
||||
})
|
||||
await issuesDetailsPage.checkActivityContentExist(`New blocked by: ${secondIssueId}`)
|
||||
})
|
||||
|
||||
await test.step('Check the second issue description', async () => {
|
||||
@ -64,4 +60,98 @@ test.describe('Relations', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
test('Mark as blocking', async ({ page }) => {
|
||||
const firstIssue: NewIssue = {
|
||||
title: `First. Mark as blocking-${generateId()}`,
|
||||
description: 'First. Mark as blocking'
|
||||
}
|
||||
const secondIssue: NewIssue = {
|
||||
title: `Second. Mark as blocked by-${generateId()}`,
|
||||
description: 'Second. Mark as blocked by'
|
||||
}
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const secondIssueId = await prepareNewIssueStep(page, secondIssue)
|
||||
const firstIssueId = await prepareNewIssueStep(page, firstIssue)
|
||||
|
||||
const issuesPage = new IssuesPage(page)
|
||||
await issuesPage.openIssueByName(firstIssue.title)
|
||||
|
||||
const issuesDetailsPage = new IssuesDetailsPage(page)
|
||||
await test.step('Mark as blocking... and check issue description', async () => {
|
||||
await issuesDetailsPage.waitDetailsOpened(firstIssue.title)
|
||||
await issuesDetailsPage.moreActionOnIssueWithSecondLevel('Relations', 'Mark as blocking...')
|
||||
await issuesDetailsPage.fillSearchForIssueModal(secondIssue.title)
|
||||
|
||||
// TODO remove reload after fixed https://front.hc.engineering/workbench/platform/tracker/UBERF-5652
|
||||
await page.reload()
|
||||
await issuesDetailsPage.waitDetailsOpened(firstIssue.title)
|
||||
await issuesDetailsPage.checkIssue({
|
||||
...firstIssue,
|
||||
blocks: secondIssueId
|
||||
})
|
||||
})
|
||||
|
||||
await test.step('Check the second issue description', async () => {
|
||||
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
|
||||
await trackerNavigationMenuPage.openIssuesForProject('Default')
|
||||
|
||||
await issuesPage.searchIssueByName(secondIssue.title)
|
||||
await issuesPage.openIssueByName(secondIssue.title)
|
||||
|
||||
await issuesDetailsPage.waitDetailsOpened(secondIssue.title)
|
||||
await issuesDetailsPage.checkIssue({
|
||||
...secondIssue,
|
||||
blockedBy: firstIssueId
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
test('Reference another issue', async ({ page }) => {
|
||||
const firstIssue: NewIssue = {
|
||||
title: `First. Reference another issue-${generateId()}`,
|
||||
description: 'First. Reference another issue'
|
||||
}
|
||||
const secondIssue: NewIssue = {
|
||||
title: `Second. Reference another issue-${generateId()}`,
|
||||
description: 'Second. Reference another issue'
|
||||
}
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const secondIssueId = await prepareNewIssueStep(page, secondIssue)
|
||||
const firstIssueId = await prepareNewIssueStep(page, firstIssue)
|
||||
|
||||
const issuesPage = new IssuesPage(page)
|
||||
await issuesPage.openIssueByName(firstIssue.title)
|
||||
|
||||
const issuesDetailsPage = new IssuesDetailsPage(page)
|
||||
await test.step('Reference another issue... and check issue description', async () => {
|
||||
await issuesDetailsPage.waitDetailsOpened(firstIssue.title)
|
||||
await issuesDetailsPage.moreActionOnIssueWithSecondLevel('Relations', 'Reference another issue...')
|
||||
await issuesDetailsPage.fillSearchForIssueModal(secondIssue.title)
|
||||
|
||||
await issuesDetailsPage.waitDetailsOpened(firstIssue.title)
|
||||
await issuesDetailsPage.checkIssue({
|
||||
...firstIssue,
|
||||
relatedIssue: secondIssueId
|
||||
})
|
||||
})
|
||||
|
||||
await test.step('Check the second issue description', async () => {
|
||||
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
|
||||
await trackerNavigationMenuPage.openIssuesForProject('Default')
|
||||
|
||||
await issuesPage.searchIssueByName(secondIssue.title)
|
||||
await issuesPage.openIssueByName(secondIssue.title)
|
||||
|
||||
await issuesDetailsPage.waitDetailsOpened(secondIssue.title)
|
||||
await issuesDetailsPage.checkIssue({
|
||||
...secondIssue,
|
||||
relatedIssue: firstIssueId
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user