Skip to content

Commit 4126e53

Browse files
committed
Scheduler: use testScreenshot utility in e2e tests: dragAndDrop, virtualScrolling
1 parent 76b1a0e commit 4126e53

File tree

137 files changed

+194
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+194
-204
lines changed

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/T1017720.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ClientFunction } from 'testcafe';
22
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
33
import { extend } from 'devextreme/core/utils/extend';
44
import Scheduler from 'devextreme-testcafe-models/scheduler';
5+
import { testScreenshot } from '../../../../helpers/themeUtils';
56
import { createWidget } from '../../../../helpers/createWidget';
67
import url from '../../../../helpers/getPageUrl';
78

@@ -13,15 +14,15 @@ test('Drag-n-drop appointment above SVG element(T1017720)', async (t) => {
1314
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1415
const draggableAppointment = scheduler.getAppointment('text');
1516

16-
await t
17-
.drag(draggableAppointment.element, 330, 0)
18-
.expect(await takeScreenshot('drag-n-drop-to-right(T1017720).png', scheduler.workSpace))
19-
.ok()
17+
await t.drag(draggableAppointment.element, 330, 0);
18+
19+
await testScreenshot(t, takeScreenshot, 'drag-n-drop-to-right(T1017720).png', { element: scheduler.workSpace });
2020

21-
.drag(draggableAppointment.element, -330, 70)
22-
.expect(await takeScreenshot('drag-n-drop-to-left(T1017720).png', scheduler.workSpace))
23-
.ok()
21+
await t.drag(draggableAppointment.element, -330, 70);
2422

23+
await testScreenshot(t, takeScreenshot, 'drag-n-drop-to-left(T1017720).png', { element: scheduler.workSpace });
24+
25+
await t
2526
.expect(compareResults.isValid())
2627
.ok(compareResults.errorMessages());
2728
}).before(async () => {

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/appointmentCollector.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { appointmentCollectorData } from './init/widget.data';
44
import createScheduler from './init/widget.setup';
55
import { createWidget } from '../../../../helpers/createWidget';
66
import url from '../../../../helpers/getPageUrl';
7+
import { testScreenshot } from '../../../../helpers/themeUtils';
78

89
fixture.disablePageReloads`Drag-and-drop behaviour for the appointment tooltip`
910
.page(url(__dirname, '../../../container.html'));
@@ -55,9 +56,11 @@ test('Drag-n-drop to the cell on the left should work in week view (T1005115)',
5556
appointmentTooltipItem.element,
5657
scheduler.getDateTableCell(2, 2),
5758
{ speed: 0.5 },
58-
)
59-
.expect(await takeScreenshot('drag-n-drop-from-tooltip-to-left-cell-in-week.png', scheduler.workSpace))
60-
.ok()
59+
);
60+
61+
await testScreenshot(t, takeScreenshot, 'drag-n-drop-from-tooltip-to-left-cell-in-week.png', { element: scheduler.workSpace });
62+
63+
await t
6164
.expect(compareResults.isValid())
6265
.ok(compareResults.errorMessages());
6366
}).before(async () => createWidget('dxScheduler', {
@@ -118,11 +121,11 @@ test('Drag-n-drop to the cell below should work in month view (T1005115)', async
118121
appointmentTooltipItem.element,
119122
scheduler.getDateTableCell(1, 3),
120123
{ speed: 0.5 },
121-
)
124+
);
122125

123-
.expect(await takeScreenshot('drag-n-drop-from-tooltip-to-cell-below-in-month.png', scheduler.workSpace))
124-
.ok()
126+
await testScreenshot(t, takeScreenshot, 'drag-n-drop-from-tooltip-to-cell-below-in-month.png', { element: scheduler.workSpace });
125127

128+
await t
126129
.expect(compareResults.isValid())
127130
.ok(compareResults.errorMessages());
128131
}).before(async () => createWidget('dxScheduler', {

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/basic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Scheduler from 'devextreme-testcafe-models/scheduler';
33
import { dataSource } from './init/widget.data';
44
import createScheduler from './init/widget.setup';
55
import url from '../../../../helpers/getPageUrl';
6+
import { testScreenshot } from '../../../../helpers/themeUtils';
67

78
fixture.disablePageReloads`Drag-and-drop appointments in the Scheduler basic views`
89
.page(url(__dirname, '../../../container.html'));
@@ -125,7 +126,6 @@ test('Drag recurrent appointment occurrence from collector (T832887)', async (t)
125126

126127
test('Drag-n-drop the appointment to the left column to the cell that has the same time', async (t) => {
127128
const scheduler = new Scheduler('#container');
128-
const screenshotZone = scheduler.workSpace;
129129
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
130130
const draggableAppointment = scheduler.getAppointment('Test appointment');
131131

@@ -136,7 +136,7 @@ test('Drag-n-drop the appointment to the left column to the cell that has the sa
136136
{ speed: 0.5 },
137137
);
138138

139-
await takeScreenshot('drag-n-drop-appointment-to-left-column.png', screenshotZone);
139+
await testScreenshot(t, takeScreenshot, 'drag-n-drop-appointment-to-left-column.png', { element: scheduler.workSpace });
140140

141141
await t.expect(compareResults.isValid())
142142
.ok(compareResults.errorMessages());

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-appointment-to-left-column.png renamed to e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-appointment-to-left-column (generic.light).png

File renamed without changes.

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-from-tooltip-to-cell-below-in-month.png renamed to e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-from-tooltip-to-cell-below-in-month (generic.light).png

File renamed without changes.

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-from-tooltip-to-left-cell-in-week.png renamed to e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-from-tooltip-to-left-cell-in-week (generic.light).png

File renamed without changes.

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-previous-day-cell.png renamed to e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-previous-day-cell (generic.light).png

File renamed without changes.

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-to-left(T1017720).png renamed to e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-to-left(T1017720) (generic.light).png

File renamed without changes.

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-to-right(T1017720).png renamed to e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop-to-right(T1017720) (generic.light).png

File renamed without changes.

e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop_ko_T1046067.png renamed to e2e/testcafe-devextreme/tests/scheduler/common/dragAndDrop/etalons/drag-n-drop_ko_T1046067 (generic.light).png

File renamed without changes.

0 commit comments

Comments
 (0)