Skip to content

Commit 1c62ead

Browse files
authored
Fix scheduler flaky test
1 parent e6e4d1f commit 1c62ead

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

e2e/testcafe-devextreme/tests/scheduler/common/appointmentForm/recurrence-form.visual.ts

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { ClientFunction } from 'testcafe';
44
import AppointmentPopup from 'devextreme-testcafe-models/scheduler/appointment/popup';
55
import { createWidget } from '../../../../helpers/createWidget';
66
import url from '../../../../helpers/getPageUrl';
7-
import { safeSizeTest } from '../../../../helpers/safeSizeTest';
8-
import { changeTheme } from '../../../../helpers/changeTheme';
97

108
fixture`Appointment Form: Recurrence Form`
119
.page(url(__dirname, '../../../container.html'));
@@ -674,7 +672,14 @@ test.clientScripts([
674672
})();
675673
});
676674

677-
safeSizeTest('recurrence form with icons', async (t) => {
675+
test.clientScripts([
676+
{ module: 'mockdate' },
677+
{ content: 'window.MockDate = MockDate;' },
678+
])(`recurrence form with icons (${theme})`, async (t) => {
679+
await ClientFunction(() => {
680+
(window as any).MockDate.set('2025/10/29');
681+
})();
682+
678683
const appointment = {
679684
text: 'Appointment',
680685
startDate: new Date('2021-04-26T16:30:00.000Z'),
@@ -698,19 +703,18 @@ safeSizeTest('recurrence form with icons', async (t) => {
698703
await t
699704
.expect(compareResults.isValid())
700705
.ok(compareResults.errorMessages());
701-
}, [1500, 1500]).before(async () => {
702-
await changeTheme(theme);
703-
return createWidget('dxScheduler', {
704-
dataSource: [],
705-
views: ['week'],
706-
currentView: 'week',
707-
currentDate: new Date(2021, 2, 25),
708-
editing: {
709-
form: {
710-
iconsShowMode: 'both',
711-
},
706+
}).before(async () => createWidget('dxScheduler', {
707+
dataSource: [],
708+
views: ['week'],
709+
currentView: 'week',
710+
currentDate: new Date(2021, 2, 25),
711+
editing: {
712+
form: {
713+
iconsShowMode: 'both',
712714
},
713-
});
714-
}).after(async () => {
715-
await changeTheme('generic.light');
715+
},
716+
})).after(async () => {
717+
await ClientFunction(() => {
718+
(window as any).MockDate.reset();
719+
})();
716720
});

0 commit comments

Comments
 (0)