mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
feat(tests): TESTS-58 dont test delete template (#4125)
This commit is contained in:
parent
676abfb67c
commit
591fef6555
@ -15,6 +15,8 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
readonly buttonDueDate: Locator
|
||||
readonly buttonSaveDueDate: Locator
|
||||
readonly textComment: Locator
|
||||
readonly buttonMoreActions: Locator
|
||||
readonly buttonDelete: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
super(page)
|
||||
@ -30,6 +32,8 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
this.buttonDueDate = page.locator('(//span[text()="Due date"]/../div/button)[2]')
|
||||
this.buttonSaveDueDate = page.locator('div.footer > button')
|
||||
this.textComment = page.locator('div.labels-row')
|
||||
this.buttonMoreActions = page.locator('div.popupPanel-title > div > button:nth-child(1)')
|
||||
this.buttonDelete = page.locator('button[class*="menuItem"] > span', { hasText: 'Delete' })
|
||||
}
|
||||
|
||||
async checkTemplate (data: NewIssue): Promise<void> {
|
||||
@ -94,4 +98,10 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
async checkCommentExist (comment: string): Promise<void> {
|
||||
await expect(this.textComment.filter({ hasText: comment })).toBeVisible()
|
||||
}
|
||||
|
||||
async deleteTemplate (): Promise<void> {
|
||||
await this.buttonMoreActions.click()
|
||||
await this.buttonDelete.click()
|
||||
await this.pressYesDeletePopup(this.page)
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { type Locator, type Page } from '@playwright/test'
|
||||
import { expect, type Locator, type Page } from '@playwright/test'
|
||||
import { CommonTrackerPage } from './common-tracker-page'
|
||||
import { NewIssue } from './types'
|
||||
|
||||
@ -82,4 +82,8 @@ export class TemplatePage extends CommonTrackerPage {
|
||||
async openTemplate (templateName: string): Promise<void> {
|
||||
await this.page.locator('span.issuePresenterRoot > span', { hasText: templateName }).click()
|
||||
}
|
||||
|
||||
async checkTemplateNotExist (templateName: string): Promise<void> {
|
||||
await expect(this.page.locator('span.issuePresenterRoot > span').filter({ hasText: templateName })).toHaveCount(0)
|
||||
}
|
||||
}
|
||||
|
@ -111,4 +111,27 @@ test.describe('Tracker template tests', () => {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
test('Delete Template', async ({ page }) => {
|
||||
const deleteTemplate: NewIssue = {
|
||||
title: `Template for delete-${generateId()}`,
|
||||
description: 'Created template for delete'
|
||||
}
|
||||
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
|
||||
await trackerNavigationMenuPage.buttonTemplates.click()
|
||||
|
||||
let templatePage = new TemplatePage(page)
|
||||
await templatePage.createNewTemplate(deleteTemplate)
|
||||
await templatePage.openTemplate(deleteTemplate.title)
|
||||
|
||||
const templateDetailsPage = new TemplateDetailsPage(page)
|
||||
await templateDetailsPage.deleteTemplate()
|
||||
|
||||
templatePage = new TemplatePage(page)
|
||||
await templatePage.checkTemplateNotExist(deleteTemplate.title)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user