Skip to content

Commit

Permalink
Corrected test in the Planner (#6260)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Platov <[email protected]>
  • Loading branch information
SasLord authored Aug 5, 2024
1 parent 94b87ce commit b96c2e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/sanity/tests/model/planning/planning-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tests/sanity/tests/planning/plan.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -201,15 +201,15 @@ 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()
await planningPage.buttonPopupSave().click()

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()
Expand Down

0 comments on commit b96c2e9

Please sign in to comment.