TESTS-59: feat(tests): done Create an Issue from template test (#4212)

Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
Alex Velichko 2023-12-20 06:18:17 +03:00 committed by GitHub
parent 5803d8c5aa
commit cb53ddf26b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 42 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -29,6 +29,7 @@ export class IssuesPage extends CommonTrackerPage {
readonly buttonClearFilers: Locator
readonly issuesList: Locator
readonly buttonPopupCreateNewIssueParent: Locator
readonly buttonPopupCreateNewIssueTemplate: Locator
constructor (page: Page) {
super(page)
@ -68,6 +69,9 @@ export class IssuesPage extends CommonTrackerPage {
this.buttonClearFilers = page.locator('div.search-start > div:first-child button')
this.issuesList = page.locator('div.listGrid')
this.buttonPopupCreateNewIssueParent = page.locator('div#parentissue-editor button')
this.buttonPopupCreateNewIssueTemplate = page.locator(
'form[id="tracker:string:NewIssue"] div[class*="title"] > div > button'
)
}
async createNewIssue (data: NewIssue): Promise<void> {
@ -179,4 +183,9 @@ export class IssuesPage extends CommonTrackerPage {
expect(href).toContain(priorityName)
}
}
async selectTemplate (templateName: string): Promise<void> {
await this.buttonPopupCreateNewIssueTemplate.click()
await this.selectMenuItem(this.page, templateName)
}
}

View File

@ -1,4 +1,4 @@
import { test } from '@playwright/test'
import { expect, 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'
@ -255,4 +255,36 @@ test.describe('Tracker issue tests', () => {
await issuesDetailsPage.waitDetailsOpened(commentIssue.title)
await issuesDetailsPage.checkCommentExist(commentText)
})
test('Create an Issue from template', async ({ page }) => {
const templateName = 'New Issue'
const newIssue: NewIssue = {
title: `New Issue-${generateId(4)}`,
description: 'New Issue',
priority: 'Medium',
estimation: '1d',
component: 'Default component',
milestone: 'Edit Milestone'
}
const leftSideMenuPage = new LeftSideMenuPage(page)
await leftSideMenuPage.buttonTracker.click()
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
await trackerNavigationMenuPage.openIssuesForProject('Default')
const issuesPage = new IssuesPage(page)
await issuesPage.modelSelectorAll.click()
await issuesPage.buttonCreateNewIssue.click()
await issuesPage.selectTemplate(templateName)
await expect(issuesPage.buttonPopupCreateNewIssueTemplate).toHaveText(templateName)
await issuesPage.fillNewIssueForm({ description: newIssue.description, title: newIssue.title })
await issuesPage.buttonCreateIssue.click()
await issuesPage.searchIssueByName(newIssue.title)
await issuesPage.openIssueByName(newIssue.title)
const issuesDetailsPage = new IssuesDetailsPage(page)
await issuesDetailsPage.checkIssue(newIssue)
})
})