TESTS-46: feat(tests): done New related issue test (#4192)

Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
Alex Velichko 2023-12-18 10:33:58 +03:00 committed by GitHub
parent ff3990c001
commit 0cd007e08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 1 deletions

View File

@ -20,6 +20,7 @@ export class IssuesDetailsPage extends CommonTrackerPage {
readonly buttonMoreActions: Locator
readonly textParentTitle: Locator
readonly buttonAddSubIssue: Locator
readonly textRelated: Locator
constructor (page: Page) {
super(page)
@ -33,13 +34,14 @@ export class IssuesDetailsPage extends CommonTrackerPage {
this.buttonAddLabel = page.locator('button.tag-button')
this.buttonComponent = page.locator('//span[text()="Component"]/following-sibling::div[1]/div/button')
this.buttonMilestone = page.locator('//span[text()="Milestone"]/following-sibling::div[1]/div/button')
this.textEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[4]')
this.textEstimation = page.locator('//span[text()="Estimation"]/following-sibling::div[1]/button/span')
this.buttonEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[3]')
this.buttonCreatedBy = page.locator('(//span[text()="Assignee"]/../div/button)[1]')
this.buttonCloseIssue = page.locator('div.popupPanel-title > button')
this.buttonMoreActions = page.locator('div.popupPanel-title div.flex-row-center > button:first-child')
this.textParentTitle = page.locator('span.issue-title')
this.buttonAddSubIssue = page.locator('#add-sub-issue')
this.textRelated = page.locator('//span[text()="Related"]/following-sibling::div[1]/div//span')
}
async editIssue (data: Issue): Promise<void> {
@ -105,6 +107,9 @@ export class IssuesDetailsPage extends CommonTrackerPage {
if (data.parentIssue != null) {
await expect(this.textParentTitle).toHaveText(data.parentIssue)
}
if (data.relatedIssue != null) {
await expect(this.textRelated).toContainText(data.relatedIssue)
}
}
async moreActionOnIssue (action: string): Promise<void> {

View File

@ -15,6 +15,7 @@ export interface Issue {
duedate?: string
filePath?: string
parentIssue?: string
relatedIssue?: string
}
export interface NewProject {

View File

@ -0,0 +1,66 @@
import { test } from '@playwright/test'
import { generateId, PlatformSetting, PlatformURI } from '../utils'
import { LeftSideMenuPage } from '../model/left-side-menu-page'
import { IssuesPage } from '../model/tracker/issues-page'
import { IssuesDetailsPage } from '../model/tracker/issues-details-page'
import { NewIssue } from '../model/tracker/types'
import { allure } from 'allure-playwright'
import { TrackerNavigationMenuPage } from '../model/tracker/tracker-navigation-menu-page'
test.use({
storageState: PlatformSetting
})
test.describe('Tracker related issue tests', () => {
test.beforeEach(async ({ page }) => {
await allure.parentSuite('Tracker tests')
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished()
})
test('New related issue', async ({ page }) => {
const newIssue: NewIssue = {
title: `New Issue with related issue-${generateId()}`,
description: 'Description New Issue with related issue'
}
const relatedIssue: NewIssue = {
title: `New Related issue-${generateId()}`,
description: 'Description New Related issue',
status: 'Done',
priority: 'High',
createLabel: true,
labels: `RELATED-ISSUE-${generateId()}`,
component: 'No component',
estimation: '12',
milestone: 'Milestone',
duedate: 'today'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll.click()
await issuesPage.createNewIssue(newIssue)
await issuesPage.searchIssueByName(newIssue.title)
await issuesPage.openIssueByName(newIssue.title)
const issuesDetailsPage = new IssuesDetailsPage(page)
await issuesDetailsPage.moreActionOnIssue('New related issue')
await issuesPage.fillNewIssueForm(relatedIssue)
await issuesPage.buttonCreateIssue.click()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openIssuesForProject('Default')
await issuesPage.searchIssueByName(relatedIssue.title)
await issuesPage.openIssueByName(relatedIssue.title)
await issuesDetailsPage.waitDetailsOpened(relatedIssue.title)
await issuesDetailsPage.checkIssue({
...newIssue,
...relatedIssue,
estimation: '1d 4h',
relatedIssue: 'TSK'
})
})
})