mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-25 01:39:53 +00:00
feat(tests): TESTS-47 done Mark as blocked by test (#4737)
Signed-off-by: Alex Velichko <alex@hardcoreeng.com>
This commit is contained in:
parent
44a6147368
commit
d6909b4605
@ -21,6 +21,10 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
|||||||
readonly buttonAddSubIssue: Locator
|
readonly buttonAddSubIssue: Locator
|
||||||
readonly textRelated: Locator
|
readonly textRelated: Locator
|
||||||
readonly buttonCollaborators: Locator
|
readonly buttonCollaborators: Locator
|
||||||
|
readonly buttonIssueOnSearchForIssueModal: Locator
|
||||||
|
readonly inputSearchOnSearchForIssueModal: Locator
|
||||||
|
readonly textBlockedBy: Locator
|
||||||
|
readonly textBlocks: Locator
|
||||||
|
|
||||||
constructor (page: Page) {
|
constructor (page: Page) {
|
||||||
super(page)
|
super(page)
|
||||||
@ -42,6 +46,10 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
|||||||
this.buttonAddSubIssue = page.locator('#add-sub-issue')
|
this.buttonAddSubIssue = page.locator('#add-sub-issue')
|
||||||
this.textRelated = page.locator('//span[text()="Related"]/following-sibling::div[1]/div//span')
|
this.textRelated = page.locator('//span[text()="Related"]/following-sibling::div[1]/div//span')
|
||||||
this.buttonCollaborators = page.locator('//span[text()="Collaborators"]/following-sibling::div[1]/button')
|
this.buttonCollaborators = page.locator('//span[text()="Collaborators"]/following-sibling::div[1]/button')
|
||||||
|
this.buttonIssueOnSearchForIssueModal = page.locator('div.popup div.tabs > div.tab:last-child')
|
||||||
|
this.inputSearchOnSearchForIssueModal = page.locator('div.popup input[type="text"]')
|
||||||
|
this.textBlockedBy = page.locator('//span[text()="Blocked by"]/following-sibling::div[1]/div/div/button/span')
|
||||||
|
this.textBlocks = page.locator('//span[text()="Blocks"]/following-sibling::div[1]/div/div/button/span')
|
||||||
}
|
}
|
||||||
|
|
||||||
async editIssue (data: Issue): Promise<void> {
|
async editIssue (data: Issue): Promise<void> {
|
||||||
@ -110,6 +118,12 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
|||||||
if (data.relatedIssue != null) {
|
if (data.relatedIssue != null) {
|
||||||
await expect(this.textRelated).toContainText(data.relatedIssue)
|
await expect(this.textRelated).toContainText(data.relatedIssue)
|
||||||
}
|
}
|
||||||
|
if (data.blockedBy != null) {
|
||||||
|
await expect(this.textBlockedBy).toContainText(data.blockedBy)
|
||||||
|
}
|
||||||
|
if (data.blocks != null) {
|
||||||
|
await expect(this.textBlocks).toContainText(data.blocks)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async moreActionOnIssue (action: string): Promise<void> {
|
async moreActionOnIssue (action: string): Promise<void> {
|
||||||
@ -160,4 +174,17 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
|||||||
async checkComparingTextAdded (text: string): Promise<void> {
|
async checkComparingTextAdded (text: string): Promise<void> {
|
||||||
await expect(this.page.locator('span.text-editor-highlighted-node-add', { hasText: text }).first()).toBeVisible()
|
await expect(this.page.locator('span.text-editor-highlighted-node-add', { hasText: text }).first()).toBeVisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fillSearchForIssueModal (issueTitle: string): Promise<void> {
|
||||||
|
await this.buttonIssueOnSearchForIssueModal.click()
|
||||||
|
await this.inputSearchOnSearchForIssueModal.fill(issueTitle)
|
||||||
|
await this.page.locator('div.popup div.list-item', { hasText: issueTitle }).click()
|
||||||
|
}
|
||||||
|
|
||||||
|
async moreActionOnIssueWithSecondLevel (actionFirst: string, actionSecond: string): Promise<void> {
|
||||||
|
await this.buttonMoreActions.click()
|
||||||
|
await this.page.locator('button.antiPopup-submenu', { hasText: actionFirst }).hover()
|
||||||
|
await this.page.locator('button.antiPopup-submenu', { hasText: actionFirst }).click()
|
||||||
|
await this.selectFromDropdown(this.page, actionSecond)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@ export interface Issue {
|
|||||||
filePath?: string
|
filePath?: string
|
||||||
parentIssue?: string
|
parentIssue?: string
|
||||||
relatedIssue?: string
|
relatedIssue?: string
|
||||||
|
blockedBy?: string
|
||||||
|
blocks?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NewProject {
|
export interface NewProject {
|
||||||
|
67
tests/sanity/tests/tracker/relations.spec.ts
Normal file
67
tests/sanity/tests/tracker/relations.spec.ts
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import { test } from '@playwright/test'
|
||||||
|
import { IssuesPage } from '../model/tracker/issues-page'
|
||||||
|
import { generateId, PlatformSetting, PlatformURI } from '../utils'
|
||||||
|
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'
|
||||||
|
|
||||||
|
test.use({
|
||||||
|
storageState: PlatformSetting
|
||||||
|
})
|
||||||
|
test.describe('Relations', () => {
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('Mark as blocked by', async ({ page }) => {
|
||||||
|
const firstIssue: NewIssue = {
|
||||||
|
title: `First. Mark as blocked by-${generateId()}`,
|
||||||
|
description: 'First. Mark as blocked by'
|
||||||
|
}
|
||||||
|
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 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)
|
||||||
|
await test.step('Set blocked by and check issue description', async () => {
|
||||||
|
await issuesDetailsPage.waitDetailsOpened(firstIssue.title)
|
||||||
|
await issuesDetailsPage.moreActionOnIssueWithSecondLevel('Relations', 'Mark as blocked by...')
|
||||||
|
await issuesDetailsPage.fillSearchForIssueModal(secondIssue.title)
|
||||||
|
|
||||||
|
await issuesDetailsPage.checkIssue({
|
||||||
|
...firstIssue,
|
||||||
|
blockedBy: 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,
|
||||||
|
blocks: firstIssueId
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user