|
|
@ -1,4 +1,4 @@ |
|
|
|
import { test } from '@playwright/test'; |
|
|
|
import { Page, test } from '@playwright/test'; |
|
|
|
import { DashboardPage } from '../../../pages/Dashboard'; |
|
|
|
import { DashboardPage } from '../../../pages/Dashboard'; |
|
|
|
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar'; |
|
|
|
import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar'; |
|
|
|
|
|
|
|
|
|
|
@ -45,6 +45,23 @@ test.describe('View', () => { |
|
|
|
let dashboard: DashboardPage, toolbar: ToolbarPage, topbar: TopbarPage, calendarTopbar: CalendarTopbarPage; |
|
|
|
let dashboard: DashboardPage, toolbar: ToolbarPage, topbar: TopbarPage, calendarTopbar: CalendarTopbarPage; |
|
|
|
let context: any; |
|
|
|
let context: any; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function undo({ page, dashboard }: { page: Page; dashboard: DashboardPage }) { |
|
|
|
|
|
|
|
const isMac = await dashboard.grid.isMacOs(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (validateResponse) { |
|
|
|
|
|
|
|
await dashboard.grid.waitForResponse({ |
|
|
|
|
|
|
|
uiAction: () => page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'), |
|
|
|
|
|
|
|
httpMethodsToMatch: ['PATCH'], |
|
|
|
|
|
|
|
requestUrlPathToMatch: `/api/v1/db/data/noco/`, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
await page.keyboard.press(isMac ? 'Meta+z' : 'Control+z'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// allow time for undo to complete rendering
|
|
|
|
|
|
|
|
await page.waitForTimeout(500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
test.beforeEach(async ({ page }) => { |
|
|
|
test.beforeEach(async ({ page }) => { |
|
|
|
context = await setup({ page, isEmptyProject: false }); |
|
|
|
context = await setup({ page, isEmptyProject: false }); |
|
|
|
dashboard = new DashboardPage(page, context.base); |
|
|
|
dashboard = new DashboardPage(page, context.base); |
|
|
@ -255,7 +272,7 @@ test.describe('View', () => { |
|
|
|
await dashboard.viewSidebar.deleteView({ title: 'Calendar' }); |
|
|
|
await dashboard.viewSidebar.deleteView({ title: 'Calendar' }); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
test('Calendar Drag and Drop & Undo Redo Operations', async () => { |
|
|
|
test.only('Calendar Drag and Drop & Undo Redo Operations', async () => { |
|
|
|
await dashboard.viewSidebar.createCalendarView({ |
|
|
|
await dashboard.viewSidebar.createCalendarView({ |
|
|
|
title: 'Calendar', |
|
|
|
title: 'Calendar', |
|
|
|
}); |
|
|
|
}); |
|
|
@ -388,6 +405,7 @@ test.describe('View', () => { |
|
|
|
title: 'StartDate', |
|
|
|
title: 'StartDate', |
|
|
|
type: 'Date', |
|
|
|
type: 'Date', |
|
|
|
dateFormat: 'YYYY-MM-DD', |
|
|
|
dateFormat: 'YYYY-MM-DD', |
|
|
|
|
|
|
|
selectType: true, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
await dashboard.grid.column.save({ isUpdated: true }); |
|
|
|
await dashboard.grid.column.save({ isUpdated: true }); |
|
|
@ -432,5 +450,18 @@ test.describe('View', () => { |
|
|
|
await calendar.calendarWeekDate.selectDay({ dayIndex: 1 }); |
|
|
|
await calendar.calendarWeekDate.selectDay({ dayIndex: 1 }); |
|
|
|
|
|
|
|
|
|
|
|
await calendar.sideMenu.verifySideBarRecords({ records: [] }); |
|
|
|
await calendar.sideMenu.verifySideBarRecords({ records: [] }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await calendar.calendarWeekDate.dragAndDrop({ |
|
|
|
|
|
|
|
record: 'Team Catchup', |
|
|
|
|
|
|
|
dayIndex: 2, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await calendar.calendarWeekDate.selectDay({ dayIndex: 3 }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await calendar.calendarWeekDate.selectDay({ dayIndex: 2 }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await calendar.sideMenu.updateFilter({ filter: 'In selected date' }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await calendar.sideMenu.verifySideBarRecords({ records: ['Team Catchup'] }); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|