-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T1186741: Add test cases for scheduler custom dnd demo.
- Loading branch information
Ilya Vinogradov
committed
Sep 6, 2023
1 parent
3cb63d8
commit 173a58a
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { runManualTest } from '../../../utils/visual-tests/matrix-test-helper'; | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
|
||
const LIST_SELECTOR = '#list.dx-draggable'; | ||
const LIST_ITEM_SELECTOR = '.dx-card.dx-draggable'; | ||
const DATE_TABLE_CELL_SELECTOR = '.dx-scheduler-date-table .dx-scheduler-date-table-cell'; | ||
const ALL_DAY_PANEL_CELL_SELECTOR = '.dx-scheduler-all-day-table .dx-scheduler-all-day-table-cell'; | ||
const DATE_TABLE_APPOINTMENT_SELECTOR = '.dx-scheduler-date-table-container .dx-scheduler-appointment'; | ||
const ALL_DAY_PANEL_APPOINTMENT_SELECTOR = '.dx-scheduler-all-day-panel .dx-scheduler-appointment'; | ||
|
||
const DRAG_MOUSE_OPTIONS = { speed: 0.5 }; | ||
|
||
fixture('Scheduler.CustomDragAndDrop') | ||
.page('http://localhost:8080/') | ||
.beforeEach(async (t) => { | ||
await t | ||
.resizeWindow(900, 600); | ||
}); | ||
|
||
[ | ||
[LIST_ITEM_SELECTOR, DATE_TABLE_CELL_SELECTOR, 'list', 'date-table'], | ||
[DATE_TABLE_APPOINTMENT_SELECTOR, LIST_SELECTOR, 'date-table', 'list'], | ||
[LIST_ITEM_SELECTOR, ALL_DAY_PANEL_CELL_SELECTOR, 'list', 'all-day-panel'], | ||
[ALL_DAY_PANEL_APPOINTMENT_SELECTOR, LIST_SELECTOR, 'all-day-panel', 'list'], | ||
].forEach(([ | ||
fromSelector, | ||
toSelector, | ||
fromName, | ||
toName, | ||
]) => { | ||
runManualTest('Scheduler', 'CustomDragAndDrop', ['jQuery', 'React', 'Vue', 'Angular'], (test) => { | ||
test(`Should drag-and-drop from ${fromName} to ${toName}`, async (t) => { | ||
const { | ||
takeScreenshot, | ||
compareResults | ||
} = createScreenshotsComparer(t); | ||
|
||
await t.dragToElement(fromSelector, toSelector, DRAG_MOUSE_OPTIONS); | ||
await takeScreenshot(`scheduler_custom-dnd_${fromName}_${toName}.png`); | ||
|
||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}); | ||
}); | ||
}); |