mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
TESTS-57: feat(tests): done Edit a Template test (#4079)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
99a56ba60b
commit
a3dcfe8f6c
BIN
tests/sanity-ws/000006/_migrations-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/_migrations-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/_migrations-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/_migrations-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/attachment-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/attachment-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/attachment-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/attachment-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/channel-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/channel-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/channel-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/channel-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/chunter-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/chunter-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/chunter-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/chunter-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/comment-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/comment-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/comment-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/comment-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/contact-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/contact-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/contact-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/contact-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/doc-index-state-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/doc-index-state-1701110562723-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000006/fulltext-blob-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/fulltext-blob-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/fulltext-blob-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/fulltext-blob-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/inventory-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/inventory-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/inventory-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/inventory-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/kanban-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/kanban-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/kanban-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/kanban-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/notification-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/notification-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/notification-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/notification-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/space-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/space-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/space-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/space-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/status-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/status-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/status-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/status-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/tags-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/tags-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/tags-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/tags-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/task-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/task-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/task-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/task-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/tracker-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/tracker-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/tracker-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/tracker-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/tx-1701110562723-0.snp.gz
Normal file
BIN
tests/sanity-ws/000006/tx-1701110562723-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000006/tx-data-1701110562723-1.tar.gz
Normal file
BIN
tests/sanity-ws/000006/tx-data-1701110562723-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
import { expect, type Locator, type Page } from '@playwright/test'
|
||||
import { CommonTrackerPage } from './common-tracker-page'
|
||||
import { NewIssue } from './types'
|
||||
import { Issue, NewIssue } from './types'
|
||||
|
||||
export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
readonly page: Page
|
||||
@ -11,7 +11,10 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
readonly buttonAddLabel: Locator
|
||||
readonly textLabels: Locator
|
||||
readonly buttonComponent: Locator
|
||||
readonly textEstimation: Locator
|
||||
readonly buttonEstimation: Locator
|
||||
readonly buttonDueDate: Locator
|
||||
readonly buttonSaveDueDate: Locator
|
||||
readonly textComment: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
super(page)
|
||||
@ -23,7 +26,10 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
this.textLabels = page.locator('div.menu-group span')
|
||||
this.buttonAddLabel = page.locator('//span[text()="Labels"]/../button[2]//span')
|
||||
this.buttonComponent = page.locator('//span[text()="Component"]/../div/div/button')
|
||||
this.textEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[3]')
|
||||
this.buttonEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[3]')
|
||||
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')
|
||||
}
|
||||
|
||||
async checkTemplate (data: NewIssue): Promise<void> {
|
||||
@ -43,7 +49,48 @@ export class TemplateDetailsPage extends CommonTrackerPage {
|
||||
await expect(this.buttonComponent).toHaveText(data.component)
|
||||
}
|
||||
if (data.estimation != null) {
|
||||
await expect(this.textEstimation).toHaveText(data.estimation)
|
||||
await expect(this.buttonEstimation).toHaveText(data.estimation)
|
||||
}
|
||||
}
|
||||
|
||||
async editTemplate (data: Issue): Promise<void> {
|
||||
if (data.priority != null) {
|
||||
await this.buttonPriority.click()
|
||||
await this.selectMenuItem(this.page, data.priority)
|
||||
}
|
||||
if (data.assignee != null) {
|
||||
await this.buttonAssignee.click()
|
||||
await this.selectAssignee(this.page, data.assignee)
|
||||
}
|
||||
if (data.labels != null && data.createLabel != null) {
|
||||
if (data.createLabel) {
|
||||
await this.buttonAddLabel.click()
|
||||
await this.pressCreateButtonSelectPopup(this.page)
|
||||
await this.addNewTagPopup(this.page, data.labels, 'Tag from edit template')
|
||||
}
|
||||
await this.checkFromDropdown(this.page, data.labels)
|
||||
await this.inputTitle.click({ force: true })
|
||||
}
|
||||
if (data.component != null) {
|
||||
await this.buttonComponent.click()
|
||||
await this.selectMenuItem(this.page, data.component)
|
||||
}
|
||||
if (data.estimation != null) {
|
||||
await this.buttonEstimation.click()
|
||||
await this.fillToSelectPopup(this.page, data.estimation)
|
||||
}
|
||||
if (data.duedate != null) {
|
||||
if (data.duedate === 'today') {
|
||||
await this.buttonDueDate.click()
|
||||
await this.buttonDatePopupToday.click()
|
||||
} else {
|
||||
await this.buttonDueDate.click()
|
||||
await this.buttonSaveDueDate.click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async checkCommentExist (comment: string): Promise<void> {
|
||||
await expect(this.textComment.filter({ hasText: comment })).toBeVisible()
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { test } from '@playwright/test'
|
||||
import { generateId, PlatformSetting, PlatformURI } from '../utils'
|
||||
import { LeftSideMenuPage } from '../model/left-side-menu-page'
|
||||
import { NewIssue } from '../model/tracker/types'
|
||||
import { Issue, NewIssue } from '../model/tracker/types'
|
||||
import { allure } from 'allure-playwright'
|
||||
import { TrackerNavigationMenuPage } from '../model/tracker/tracker-navigation-menu-page'
|
||||
import { TemplatePage } from '../model/tracker/templates-page'
|
||||
@ -46,4 +46,45 @@ test.describe('Tracker template tests', () => {
|
||||
estimation: '2h'
|
||||
})
|
||||
})
|
||||
|
||||
test('Edit a Template', async ({ page }) => {
|
||||
const newTemplate: NewIssue = {
|
||||
title: 'Template for edit',
|
||||
description: 'Created template for edit'
|
||||
}
|
||||
|
||||
const editTemplate: Issue = {
|
||||
priority: 'High',
|
||||
assignee: 'Dirak Kainin',
|
||||
createLabel: true,
|
||||
labels: `EDIT-TEMPLATE-${generateId()}`,
|
||||
component: 'No component',
|
||||
estimation: '8',
|
||||
duedate: 'today'
|
||||
}
|
||||
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
|
||||
await trackerNavigationMenuPage.buttonTemplates.click()
|
||||
|
||||
const templatePage = new TemplatePage(page)
|
||||
await templatePage.openTemplate(newTemplate.title)
|
||||
|
||||
const templateDetailsPage = new TemplateDetailsPage(page)
|
||||
await templateDetailsPage.editTemplate(editTemplate)
|
||||
|
||||
await templateDetailsPage.checkTemplate({
|
||||
...newTemplate,
|
||||
...editTemplate,
|
||||
estimation: '1d'
|
||||
})
|
||||
|
||||
await templateDetailsPage.checkCommentExist('Appleseed John created template')
|
||||
await templateDetailsPage.checkCommentExist('Appleseed John changed priority to High')
|
||||
await templateDetailsPage.checkCommentExist('Appleseed John changed assignee to Dirak Kainin')
|
||||
await templateDetailsPage.checkCommentExist('Appleseed John changed estimation to 1d')
|
||||
await templateDetailsPage.checkCommentExist('Appleseed John changed due date')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user