mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-10 09:22:23 +00:00
Add test for change panel category in panning
Signed-off-by: Alexander Manakov <novskt@gmail.com>
This commit is contained in:
parent
3a37a16fc8
commit
d270572056
@ -23,6 +23,14 @@ export class PlanningNavigationMenuPage {
|
||||
readonly accordionContainerToDoUnplanned = (): Locator =>
|
||||
this.page.locator('div.toDos-container div.hulyAccordionItem-container', { hasText: 'Unplanned' })
|
||||
|
||||
readonly toDoPanelContainer = (): Locator => this.page.locator('div.toDos-container')
|
||||
|
||||
readonly accordionContainerByName = (toDoCategoryName: string): Locator =>
|
||||
this.toDoPanelContainer().locator('div.hulyAccordionItem-container', { hasText: toDoCategoryName })
|
||||
|
||||
readonly categoryProjectContainer = (category: string, project: string): Locator =>
|
||||
this.accordionContainerByName(category).locator(`div.hulyAccordionItem-container:has(button:has-text("${project}"))`)
|
||||
|
||||
async clickOnButtonToDoAll (): Promise<void> {
|
||||
await this.buttonToDoAll().click()
|
||||
}
|
||||
@ -43,4 +51,8 @@ export class PlanningNavigationMenuPage {
|
||||
const accCount = await this.accordionContainerToDoUnplanned().locator('button.hulyToDoLine-container').count()
|
||||
expect(accCount).toBe(navCount)
|
||||
}
|
||||
|
||||
async checkToDoCategory (toDoName: string, category: string, project: string): Promise<void> {
|
||||
await expect(this.categoryProjectContainer(category, project).locator(`div.hulyAccordionItem-content:has-text("${toDoName}")`)).toBeVisible()
|
||||
}
|
||||
}
|
||||
|
@ -115,6 +115,8 @@ export class PlanningPage extends CalendarPage {
|
||||
.locator('xpath=..')
|
||||
.locator('button.reference')
|
||||
|
||||
readonly buttonPanelSpaceSelector = (): Locator => this.panel().locator('button[id="space.selector"]')
|
||||
|
||||
async clickButtonPrevDayInSchedule (): Promise<void> {
|
||||
await this.buttonPrevDayInSchedule().click()
|
||||
}
|
||||
@ -417,4 +419,13 @@ export class PlanningPage extends CalendarPage {
|
||||
row.locator('div.dateEditor-container:first-child > div.min-w-28:first-child .hulyButton')
|
||||
).toContainText(dateEnd)
|
||||
}
|
||||
|
||||
async selectLstItem (itemLabel: string): Promise<void> {
|
||||
await this.popup().locator('div.list-container button.menu-item', { hasText: itemLabel }).click()
|
||||
}
|
||||
|
||||
public async addEventToSpace (projectName: string): Promise<void> {
|
||||
await this.buttonPanelSpaceSelector().click()
|
||||
await this.selectLstItem(projectName)
|
||||
}
|
||||
}
|
||||
|
@ -396,4 +396,34 @@ test.describe('Planning ToDo tests', () => {
|
||||
await sidebarPage.checkIfPlanerSidebarTabIsOpen(true)
|
||||
})
|
||||
})
|
||||
|
||||
test('Moving ToDo in scheduler panel', async ({ page }) => {
|
||||
const planningNavigationMenuPage = new PlanningNavigationMenuPage(page)
|
||||
await planningNavigationMenuPage.clickOnButtonToDoAll()
|
||||
const toDoName = `ToDo to moving in scheduler panel ${generateId()}`
|
||||
const planningPage = new PlanningPage(page)
|
||||
const unplannedCategory = 'Unplanned'
|
||||
const defaultSubCategory = 'Without project'
|
||||
await test.step(`New ToDo in "${unplannedCategory}" category "${defaultSubCategory}" subcategory`, async () => {
|
||||
await planningPage.createNewToDoFromInput(toDoName)
|
||||
await planningNavigationMenuPage.checkToDoCategory(toDoName, unplannedCategory, defaultSubCategory)
|
||||
})
|
||||
const projectName = 'Second Project'
|
||||
await test.step(`ToDo joined to project change "${projectName}" subcategory`, async () => {
|
||||
await planningPage.openToDoByName(toDoName)
|
||||
await planningPage.addEventToSpace(projectName)
|
||||
await planningNavigationMenuPage.checkToDoCategory(toDoName, unplannedCategory, projectName)
|
||||
})
|
||||
const scheduledCategory = 'Scheduled'
|
||||
await test.step(`Scheduled ToDo to "${scheduledCategory}" category`, async () => {
|
||||
await planningPage.openToDoByName(toDoName)
|
||||
await planningPage.clickButtonCreateAddSlot()
|
||||
await planningNavigationMenuPage.checkToDoCategory(toDoName, scheduledCategory, projectName)
|
||||
})
|
||||
const completedCategory = 'Done'
|
||||
await test.step(`completed ToDo move to "${completedCategory}" category`, async () => {
|
||||
await planningPage.markDoneInToDos(toDoName)
|
||||
await planningNavigationMenuPage.checkToDoCategory(toDoName, completedCategory, projectName)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user