mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
feat(tests): TESTS-54 done Edit a Milestone test (#4175)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
166606640a
commit
c804d88b3f
Binary file not shown.
BIN
tests/sanity-ws/000001/_migrations-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/_migrations-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/_migrations-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/_migrations-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/attachment-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/attachment-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/blob-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/blob-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/channel-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/channel-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/chunter-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/chunter-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/comment-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/comment-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/comment-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/comment-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/contact-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/contact-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/contact-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/contact-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/doc-index-state-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/doc-index-state-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/fulltext-blob-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/fulltext-blob-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/fulltext-blob-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/fulltext-blob-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/inventory-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/inventory-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/kanban-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/kanban-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/notification-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/notification-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/notification-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/notification-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/space-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/space-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/status-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/status-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/tags-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/tags-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/task-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/task-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/tracker-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/tracker-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/tracker-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/tracker-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/tx-1702322310672-0.snp.gz
Normal file
BIN
tests/sanity-ws/000001/tx-1702322310672-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000001/tx-data-1702322310672-1.tar.gz
Normal file
BIN
tests/sanity-ws/000001/tx-data-1702322310672-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -41,8 +41,8 @@ test.describe('actions tests', () => {
|
||||
|
||||
await page.click('div.actionsHeader input.actionsInput')
|
||||
await page.fill('div.actionsHeader input.actionsInput', 'go to ')
|
||||
expect(await page.locator('div.selectPopup :text("Go To Vacancies")').count()).toBe(1)
|
||||
await page.click('div.selectPopup :text("Go To Vacancies")', { delay: 100 })
|
||||
expect(await page.locator('div.selectPopup div.list-item :text("Go To Vacancies")').count()).toBe(1)
|
||||
await page.click('div.selectPopup div.list-item :text("Go To Vacancies")', { delay: 100 })
|
||||
|
||||
await expect(page).toHaveURL(`${PlatformURI}/workbench/sanity-ws/recruit/vacancies`)
|
||||
})
|
||||
|
@ -4,11 +4,19 @@ import { CalendarPage } from '../calendar-page'
|
||||
export class CommonTrackerPage extends CalendarPage {
|
||||
readonly page: Page
|
||||
readonly buttonFilter: Locator
|
||||
readonly inputComment: Locator
|
||||
readonly buttonSendComment: Locator
|
||||
readonly textComment: Locator
|
||||
readonly textActivity: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
super(page)
|
||||
this.page = page
|
||||
this.buttonFilter = page.locator('div.search-start > div:first-child button')
|
||||
this.inputComment = page.locator('div.text-input div.tiptap')
|
||||
this.buttonSendComment = page.locator('g#Send')
|
||||
this.textComment = page.locator('div.showMore-content p')
|
||||
this.textActivity = page.locator('div.header')
|
||||
}
|
||||
|
||||
async selectFilter (filter: string, filterSecondLevel?: string): Promise<void> {
|
||||
@ -58,4 +66,17 @@ export class CommonTrackerPage extends CalendarPage {
|
||||
|
||||
await this.page.locator('div.date-popup-container button[type="submit"]').click({ delay: 100 })
|
||||
}
|
||||
|
||||
async addComment (comment: string): Promise<void> {
|
||||
await this.inputComment.fill(comment)
|
||||
await this.buttonSendComment.click()
|
||||
}
|
||||
|
||||
async checkCommentExist (comment: string): Promise<void> {
|
||||
await expect(this.textComment.filter({ hasText: comment })).toBeVisible()
|
||||
}
|
||||
|
||||
async checkActivityExist (activity: string): Promise<void> {
|
||||
await expect(this.textActivity.filter({ hasText: activity })).toBeVisible()
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,53 @@
|
||||
import { type Locator, type Page } from '@playwright/test'
|
||||
import { expect, type Locator, type Page } from '@playwright/test'
|
||||
import { CommonTrackerPage } from './common-tracker-page'
|
||||
import { NewMilestone } from './types'
|
||||
|
||||
export class MilestonesDetailsPage extends CommonTrackerPage {
|
||||
readonly page: Page
|
||||
readonly inputTitle: Locator
|
||||
readonly buttonStatus: Locator
|
||||
readonly buttonTargetDate: Locator
|
||||
readonly inputMilestoneName: Locator
|
||||
readonly inputDescription: Locator
|
||||
|
||||
constructor (page: Page) {
|
||||
super(page)
|
||||
this.page = page
|
||||
this.inputTitle = page.locator('div.popupPanel-body input[type="text"]')
|
||||
this.buttonStatus = page.locator('//span[text()="Status"]/following-sibling::div[1]/button')
|
||||
this.buttonTargetDate = page.locator('//span[text()="Target date"]/following-sibling::div[1]/button')
|
||||
this.inputMilestoneName = page.locator('input[placeholder="Milestone name"]')
|
||||
this.inputDescription = page.locator('div.inputMsg div.tiptap')
|
||||
}
|
||||
|
||||
async checkIssue (data: NewMilestone): Promise<void> {
|
||||
await expect(this.inputTitle).toHaveValue(data.name)
|
||||
if (data.description != null) {
|
||||
await expect(this.inputDescription).toHaveText(data.description)
|
||||
}
|
||||
if (data.status != null) {
|
||||
await expect(this.buttonStatus).toHaveText(data.status)
|
||||
}
|
||||
}
|
||||
|
||||
async editIssue (data: NewMilestone): Promise<void> {
|
||||
if (data.name != null) {
|
||||
await this.inputTitle.fill(data.name)
|
||||
}
|
||||
if (data.description != null) {
|
||||
await this.inputDescription.fill(data.description)
|
||||
}
|
||||
if (data.status != null) {
|
||||
await this.buttonStatus.click()
|
||||
await this.selectFromDropdown(this.page, data.status)
|
||||
}
|
||||
if (data.targetDate != null) {
|
||||
await this.buttonTargetDate.click()
|
||||
await this.fillDatePopup(data.targetDate.day, data.targetDate.month, data.targetDate.year)
|
||||
}
|
||||
if (data.targetDateInDays != null) {
|
||||
await this.buttonTargetDate.click()
|
||||
await this.fillDatePopupInDays(data.targetDateInDays)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { expect, test } from '@playwright/test'
|
||||
import { test } from '@playwright/test'
|
||||
import { generateId, PlatformSetting, PlatformURI } from '../utils'
|
||||
import { allure } from 'allure-playwright'
|
||||
import { LeftSideMenuPage } from '../model/left-side-menu-page'
|
||||
@ -36,6 +36,36 @@ test.describe('Tracker milestone tests', () => {
|
||||
await milestonesPage.openMilestoneByName(newMilestone.name)
|
||||
|
||||
const milestonesDetailsPage = new MilestonesDetailsPage(page)
|
||||
await expect(milestonesDetailsPage.inputTitle).toHaveValue(newMilestone.name)
|
||||
await milestonesDetailsPage.checkIssue(newMilestone)
|
||||
})
|
||||
|
||||
test('Edit a Milestone', async ({ page }) => {
|
||||
const commentText: 'Edit Milestone comment' = 'Edit Milestone comment'
|
||||
const editMilestone: NewMilestone = {
|
||||
name: 'Edit Milestone',
|
||||
description: 'Edit Milestone Description',
|
||||
status: 'Completed',
|
||||
targetDateInDays: 'in 30 days'
|
||||
}
|
||||
|
||||
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||
await leftSideMenuPage.buttonTracker.click()
|
||||
|
||||
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
|
||||
await trackerNavigationMenuPage.openMilestonesForProject('Default')
|
||||
|
||||
const milestonesPage = new MilestonesPage(page)
|
||||
await milestonesPage.openMilestoneByName(editMilestone.name)
|
||||
|
||||
const milestonesDetailsPage = new MilestonesDetailsPage(page)
|
||||
await milestonesDetailsPage.editIssue(editMilestone)
|
||||
await milestonesDetailsPage.checkIssue(editMilestone)
|
||||
|
||||
await milestonesDetailsPage.addComment(commentText)
|
||||
await milestonesDetailsPage.checkCommentExist(commentText)
|
||||
await milestonesDetailsPage.checkActivityExist('created milestone')
|
||||
await milestonesDetailsPage.checkActivityExist('changed target date in')
|
||||
await milestonesDetailsPage.checkActivityExist('changed status in')
|
||||
await milestonesDetailsPage.checkActivityExist('changed description in')
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user