mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-26 04:23:58 +03:00
TESTS-51: feat(tests): done Delete a component test (#4234)
Signed-off-by: Alex Velichko <nestor_007@mail.ru>
This commit is contained in:
parent
b5bb679998
commit
fa077d71a2
BIN
tests/sanity-ws/000005/activity-1703183593552-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/activity-1703183593552-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/activity-data-1703183593552-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/activity-data-1703183593552-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/doc-index-state-1703183593552-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/doc-index-state-1703183593552-0.snp.gz
Normal file
Binary file not shown.
Binary file not shown.
BIN
tests/sanity-ws/000005/fulltext-blob-1703183593552-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/fulltext-blob-1703183593552-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/fulltext-blob-data-1703183593552-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/fulltext-blob-data-1703183593552-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/tracker-1703183593552-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/tracker-1703183593552-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/tracker-data-1703183593552-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/tracker-data-1703183593552-1.tar.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/tx-1703183593552-0.snp.gz
Normal file
BIN
tests/sanity-ws/000005/tx-1703183593552-0.snp.gz
Normal file
Binary file not shown.
BIN
tests/sanity-ws/000005/tx-data-1703183593552-1.tar.gz
Normal file
BIN
tests/sanity-ws/000005/tx-data-1703183593552-1.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -12,6 +12,7 @@ export class CommonTrackerPage extends CalendarPage {
|
|||||||
readonly buttonMoveIssuesModal: Locator
|
readonly buttonMoveIssuesModal: Locator
|
||||||
readonly buttonKeepOriginalMoveIssuesModal: Locator
|
readonly buttonKeepOriginalMoveIssuesModal: Locator
|
||||||
readonly inputKeepOriginalMoveIssuesModal: Locator
|
readonly inputKeepOriginalMoveIssuesModal: Locator
|
||||||
|
readonly buttonMoreActions: Locator
|
||||||
|
|
||||||
constructor (page: Page) {
|
constructor (page: Page) {
|
||||||
super(page)
|
super(page)
|
||||||
@ -27,6 +28,7 @@ export class CommonTrackerPage extends CalendarPage {
|
|||||||
this.buttonMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] button[type="submit"]')
|
this.buttonMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] button[type="submit"]')
|
||||||
this.buttonKeepOriginalMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] span.toggle-switch')
|
this.buttonKeepOriginalMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] span.toggle-switch')
|
||||||
this.inputKeepOriginalMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] input[type="checkbox"]')
|
this.inputKeepOriginalMoveIssuesModal = page.locator('form[id="tracker:string:MoveIssues"] input[type="checkbox"]')
|
||||||
|
this.buttonMoreActions = page.locator('div.popupPanel-title div.flex-row-center > button:first-child')
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectFilter (filter: string, filterSecondLevel?: string): Promise<void> {
|
async selectFilter (filter: string, filterSecondLevel?: string): Promise<void> {
|
||||||
|
@ -38,4 +38,10 @@ export class ComponentsDetailsPage extends CommonTrackerPage {
|
|||||||
await expect(this.buttonLead).toHaveText(data.lead)
|
await expect(this.buttonLead).toHaveText(data.lead)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async deleteComponent (): Promise<void> {
|
||||||
|
await this.buttonMoreActions.click()
|
||||||
|
await this.selectFromDropdown(this.page, 'Delete')
|
||||||
|
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 { NewComponent } from './types'
|
import { NewComponent } from './types'
|
||||||
import { CommonTrackerPage } from './common-tracker-page'
|
import { CommonTrackerPage } from './common-tracker-page'
|
||||||
|
|
||||||
@ -40,4 +40,8 @@ export class ComponentsPage extends CommonTrackerPage {
|
|||||||
async openComponentByName (componentName: string): Promise<void> {
|
async openComponentByName (componentName: string): Promise<void> {
|
||||||
await this.page.locator('div.row a', { hasText: componentName }).click()
|
await this.page.locator('div.row a', { hasText: componentName }).click()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async checkComponentNotExist (componentName: string): Promise<void> {
|
||||||
|
await expect(this.page.locator('div.row a', { hasText: componentName })).toHaveCount(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
|||||||
readonly buttonEstimation: Locator
|
readonly buttonEstimation: Locator
|
||||||
readonly buttonCreatedBy: Locator
|
readonly buttonCreatedBy: Locator
|
||||||
readonly buttonCloseIssue: Locator
|
readonly buttonCloseIssue: Locator
|
||||||
readonly buttonMoreActions: Locator
|
|
||||||
readonly textParentTitle: Locator
|
readonly textParentTitle: Locator
|
||||||
readonly buttonAddSubIssue: Locator
|
readonly buttonAddSubIssue: Locator
|
||||||
readonly textRelated: Locator
|
readonly textRelated: Locator
|
||||||
@ -38,7 +37,6 @@ export class IssuesDetailsPage extends CommonTrackerPage {
|
|||||||
this.buttonEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[3]')
|
this.buttonEstimation = page.locator('(//span[text()="Estimation"]/../div/button)[3]')
|
||||||
this.buttonCreatedBy = page.locator('(//span[text()="Assignee"]/../div/button)[1]')
|
this.buttonCreatedBy = page.locator('(//span[text()="Assignee"]/../div/button)[1]')
|
||||||
this.buttonCloseIssue = page.locator('div.popupPanel-title > button')
|
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.textParentTitle = page.locator('span.issue-title')
|
||||||
this.buttonAddSubIssue = page.locator('#add-sub-issue')
|
this.buttonAddSubIssue = page.locator('#add-sub-issue')
|
||||||
this.textRelated = page.locator('//span[text()="Related"]/following-sibling::div[1]/div//span')
|
this.textRelated = page.locator('//span[text()="Related"]/following-sibling::div[1]/div//span')
|
||||||
|
@ -9,7 +9,6 @@ export class MilestonesDetailsPage extends CommonTrackerPage {
|
|||||||
readonly buttonTargetDate: Locator
|
readonly buttonTargetDate: Locator
|
||||||
readonly inputMilestoneName: Locator
|
readonly inputMilestoneName: Locator
|
||||||
readonly inputDescription: Locator
|
readonly inputDescription: Locator
|
||||||
readonly buttonMoreActions: Locator
|
|
||||||
readonly buttonYesMoveAndDeleteMilestonePopup: Locator
|
readonly buttonYesMoveAndDeleteMilestonePopup: Locator
|
||||||
readonly buttonModalOk: Locator
|
readonly buttonModalOk: Locator
|
||||||
|
|
||||||
@ -21,7 +20,6 @@ export class MilestonesDetailsPage extends CommonTrackerPage {
|
|||||||
this.buttonTargetDate = page.locator('//span[text()="Target date"]/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.inputMilestoneName = page.locator('input[placeholder="Milestone name"]')
|
||||||
this.inputDescription = page.locator('div.inputMsg div.tiptap')
|
this.inputDescription = page.locator('div.inputMsg div.tiptap')
|
||||||
this.buttonMoreActions = page.locator('div.popupPanel-title > div:last-child > button:first-child')
|
|
||||||
this.buttonYesMoveAndDeleteMilestonePopup = page.locator(
|
this.buttonYesMoveAndDeleteMilestonePopup = page.locator(
|
||||||
'form[id="tracker:string:MoveAndDeleteMilestone"] button.primary'
|
'form[id="tracker:string:MoveAndDeleteMilestone"] button.primary'
|
||||||
)
|
)
|
||||||
|
@ -75,4 +75,26 @@ test.describe('Tracker component tests', () => {
|
|||||||
await componentsPage.openComponentByName(editComponent.name)
|
await componentsPage.openComponentByName(editComponent.name)
|
||||||
await componentsDetailsPage.checkComponent(editComponent)
|
await componentsDetailsPage.checkComponent(editComponent)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('Delete a component', async ({ page }) => {
|
||||||
|
const newComponent: NewComponent = {
|
||||||
|
name: 'Delete component test',
|
||||||
|
description: 'Delete component test description'
|
||||||
|
}
|
||||||
|
|
||||||
|
const leftSideMenuPage = new LeftSideMenuPage(page)
|
||||||
|
await leftSideMenuPage.buttonTracker.click()
|
||||||
|
|
||||||
|
const trackerNavigationMenuPage = new TrackerNavigationMenuPage(page)
|
||||||
|
await trackerNavigationMenuPage.openComponentsForProject('Default')
|
||||||
|
|
||||||
|
const componentsPage = new ComponentsPage(page)
|
||||||
|
await componentsPage.openComponentByName(newComponent.name)
|
||||||
|
|
||||||
|
const componentsDetailsPage = new ComponentsDetailsPage(page)
|
||||||
|
await componentsDetailsPage.checkComponent(newComponent)
|
||||||
|
await componentsDetailsPage.deleteComponent()
|
||||||
|
|
||||||
|
await componentsPage.checkComponentNotExist(newComponent.name)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user