mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
Corrected test in the Planner (#6260)
Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
parent
94b87cea8f
commit
b96c2e9b89
@ -81,7 +81,7 @@ export class PlanningPage extends CalendarPage {
|
||||
readonly eventInSchedule = (title: string): Locator =>
|
||||
this.schedule().locator('div.event-container', { hasText: title })
|
||||
|
||||
async dragdropTomorrow (title: string, time: string): Promise<void> {
|
||||
async dragdropTomorrow (title: string, time: string, addHalf: boolean = false): Promise<void> {
|
||||
await this.toDosContainer().getByRole('button', { name: title }).hover()
|
||||
|
||||
await expect(async () => {
|
||||
@ -90,7 +90,7 @@ export class PlanningPage extends CalendarPage {
|
||||
expect(boundingBox).toBeTruthy()
|
||||
if (boundingBox != null) {
|
||||
await this.page.mouse.move(boundingBox.x + 10, boundingBox.y + 10)
|
||||
await this.page.mouse.move(boundingBox.x + 10, boundingBox.y + 20)
|
||||
await this.page.mouse.move(boundingBox.x + 10, boundingBox.y + (addHalf ? 40 : 20))
|
||||
await this.page.mouse.up()
|
||||
}
|
||||
}).toPass(retryOptions)
|
||||
|
@ -182,8 +182,8 @@ test.describe('Planning ToDo tests', () => {
|
||||
let hour = new Date().getHours()
|
||||
const ampm = hour < 13 ? 'am' : 'pm'
|
||||
hour = hour < 1 ? 1 : hour >= 11 && hour < 13 ? 11 : hour >= 22 ? 10 : hour > 12 ? hour - 12 : hour
|
||||
const timeV = `${hour}${ampm}`
|
||||
const timeI = `${hour + 1}${ampm}`
|
||||
const time = `${hour}${ampm}`
|
||||
// const timeI = `${hour + 1}${ampm}`
|
||||
|
||||
const leftSideMenuPage: LeftSideMenuPage = new LeftSideMenuPage(page)
|
||||
const loginPage: LoginPage = new LoginPage(page)
|
||||
@ -201,7 +201,7 @@ test.describe('Planning ToDo tests', () => {
|
||||
|
||||
await planningPage.selectInputToDo().fill(titleV)
|
||||
await planningPage.selectInputToDo().press('Enter')
|
||||
await planningPage.dragdropTomorrow(titleV, timeV)
|
||||
await planningPage.dragdropTomorrow(titleV, time)
|
||||
await planningPage.eventInSchedule(titleV).click()
|
||||
await planningPage.buttonPopupCreateVisible().click()
|
||||
await planningPage.buttonPopupVisibleToEveryone().click()
|
||||
@ -209,7 +209,7 @@ test.describe('Planning ToDo tests', () => {
|
||||
|
||||
await planningPage.selectInputToDo().fill(titleI)
|
||||
await planningPage.selectInputToDo().press('Enter')
|
||||
await planningPage.dragdropTomorrow(titleI, timeI)
|
||||
await planningPage.dragdropTomorrow(titleI, time, true)
|
||||
await planningPage.eventInSchedule(titleI).click()
|
||||
await planningPage.buttonPopupCreateVisible().click()
|
||||
await planningPage.buttonPopupOnlyVisibleToYou().click()
|
||||
|
Loading…
Reference in New Issue
Block a user