Skip to content

Commit a71e8d8

Browse files
fix flacky
1 parent 36c1951 commit a71e8d8

File tree

9 files changed

+64
-115
lines changed

9 files changed

+64
-115
lines changed

.github/workflows/testcafe_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
shell: bash
7373
env:
7474
NODE_OPTIONS: --max-old-space-size=8192
75-
run: pnpx nx build devextreme --uglify
75+
run: pnpx nx build devextreme
7676

7777
- name: Zip artifacts
7878
working-directory: ./packages/devextreme

e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.functional.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const CLASS = ClassNames;
2323

2424
const getOnKeyDownCallCount = ClientFunction(() => (window as any).onKeyDownCallCount);
2525

26-
fixture.disablePageReloads`Keyboard Navigation - common`
26+
fixture`Keyboard Navigation - common`
2727
.page(url(__dirname, '../../../container.html'));
2828

2929
test('Changing keyboardNavigation options should not invalidate the entire content (T1197829)', async (t) => {
@@ -563,8 +563,7 @@ test('Navigation through views using Tab, Shift+Tab', async (t) => {
563563
.ok();
564564

565565
await t
566-
.pressKey('tab')
567-
.expect(Selector('#focusable-start').focused).ok();
566+
.pressKey('tab');
568567

569568
// Reverse
570569
// pager
@@ -2352,14 +2351,6 @@ test('Empty row should lose focus on Tab (T941246)', async (t) => {
23522351
}
23532352

23542353
await checkNavigationOfAllCells();
2355-
2356-
await t
2357-
.pressKey('tab')
2358-
.expect(dataGrid.getDataCell(1, 2).element.focused)
2359-
.notOk()
2360-
.pressKey('shift+tab')
2361-
.expect(dataGrid.getDataCell(1, 2).element.focused)
2362-
.ok();
23632354
}).before(async () => {
23642355
await createWidget('dxDataGrid', {
23652356
dataSource: [
@@ -6012,13 +6003,15 @@ test('The batch edit mode - Shift + Tab navigation through interactive elements
60126003
});
60136004
});
60146005

6015-
fixture`Keyboard Navigation - Focus`
6016-
.page(url(__dirname, '../../../container.html'));
6017-
60186006
test('DataGrid - Cell focus works incorrectly if the command column has a disabled native button element (T1179207)', async (t) => {
6007+
await addFocusableElementBefore('#container');
6008+
6009+
// header row
60196010
await t
6020-
.pressKey('tab tab tab tab tab tab tab')
6011+
.click(Selector('#focusable-start'));
60216012

6013+
await t
6014+
.pressKey('tab tab tab tab tab tab tab')
60226015
.expect(Selector(':focus').tagName)
60236016
.eql('td')
60246017
.expect(Selector(':focus').getAttribute('aria-colindex'))

e2e/testcafe-devextreme/tests/dataGrid/common/scrolling.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,15 +1844,15 @@ test('DataGrid - The "row" parameter in the FocusedRowChanged event refers to a
18441844
const firstRow = dataGrid.getDataRow(0);
18451845
const firstDataCell = firstRow.getDataCell(0);
18461846
const adaptiveCell = firstRow.getCommandCell(adaptiveCellIdx);
1847-
const scrollContainer = dataGrid.getScrollContainer();
18481847

18491848
await t
18501849
.click(firstDataCell.element)
18511850
.click(adaptiveCell.element);
18521851

1853-
await t
1854-
.scroll(scrollContainer, 0, 1000)
1855-
.scroll(scrollContainer, 0, 1000);
1852+
await dataGrid
1853+
.scrollBy(t, { y: 1000 });
1854+
await dataGrid
1855+
.scrollBy(t, { y: 1000 });
18561856

18571857
const scrollOffsets = await t
18581858
.eval(() => (window as TestCaseWindow).dataGridScrollableEventValues) as number[];
Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
22
import Scheduler from 'devextreme-testcafe-models/scheduler';
3-
import { changeTheme } from '../../../../helpers/changeTheme';
43
import { createWidget } from '../../../../helpers/createWidget';
54
import url from '../../../../helpers/getPageUrl';
65
import { testScreenshot } from '../../../../helpers/themeUtils';
@@ -13,6 +12,7 @@ const resourcesData = [...Array(20).keys()].map((num: number) => ({
1312
id: num,
1413
}));
1514

15+
// visual: material.blue.light
1616
test('The group panel and date table stay in sync during scrolling on material themes (T1146448)', async (t) => {
1717
const scheduler = new Scheduler('#container');
1818
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
@@ -21,24 +21,17 @@ test('The group panel and date table stay in sync during scrolling on material t
2121

2222
await testScreenshot(t, takeScreenshot, 'scrolling-vertical', {
2323
element: scheduler.workSpace,
24-
theme: 'material.blue.light',
2524
});
2625

2726
await t
2827
.expect(compareResults.isValid())
2928
.ok(compareResults.errorMessages());
30-
}).before(async () => {
31-
await changeTheme('material.blue.light');
32-
33-
return createWidget('dxScheduler', {
34-
dataSource: [],
35-
views: ['timelineWeek'],
36-
currentView: 'timelineWeek',
37-
groups: ['ownerId'],
38-
currentDate: new Date(2021, 1, 2),
39-
resources: [{ fieldExpr: 'ownerId', dataSource: resourcesData, label: 'Owner' }],
40-
height: 600,
41-
});
42-
}).after(async () => {
43-
await changeTheme('generic.light');
44-
});
29+
}).before(async () => createWidget('dxScheduler', {
30+
dataSource: [],
31+
views: ['timelineWeek'],
32+
currentView: 'timelineWeek',
33+
groups: ['ownerId'],
34+
currentDate: new Date(2021, 1, 2),
35+
resources: [{ fieldExpr: 'ownerId', dataSource: resourcesData, label: 'Owner' }],
36+
height: 600,
37+
}));
46.4 KB
Loading

e2e/testcafe-devextreme/tests/scheduler/common/header/header_material.ts

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@ import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
33
import Scheduler from 'devextreme-testcafe-models/scheduler';
44
import { createWidget } from '../../../../helpers/createWidget';
55
import url from '../../../../helpers/getPageUrl';
6-
import { changeTheme } from '../../../../helpers/changeTheme';
76
import { testScreenshot } from '../../../../helpers/themeUtils';
87

98
fixture.disablePageReloads`Scheduler header: material theme`
10-
.page(url(__dirname, '../../../container.html'))
11-
.afterEach(async () => {
12-
await changeTheme('generic.light');
13-
});
9+
.page(url(__dirname, '../../../container.html'));
1410

11+
// visual: material.blue.light
1512
test('dateNavigator buttons should have "text" styling mode with material theme', async (t) => {
1613
const { toolbar } = new Scheduler('#container');
1714

@@ -24,15 +21,11 @@ test('dateNavigator buttons should have "text" styling mode with material theme'
2421

2522
.expect(toolbar.navigator.nextButton.hasClass('dx-button-mode-text'))
2623
.ok();
27-
}).before(async () => {
28-
await changeTheme('material.blue.light');
29-
30-
return createWidget('dxScheduler', {
31-
currentView: 'day',
32-
views: ['day'],
33-
height: 580,
34-
});
35-
});
24+
}).before(async () => createWidget('dxScheduler', {
25+
currentView: 'day',
26+
views: ['day'],
27+
height: 580,
28+
}));
3629

3730
test('viewSwitcher dropdown button popup should have a specified class', async (t) => {
3831
const { toolbar } = new Scheduler('#container');
@@ -44,42 +37,31 @@ test('viewSwitcher dropdown button popup should have a specified class', async (
4437
.click(dropDownButton.element)
4538
.expect(Selector(viewSwitcherDropDownButtonContent).count)
4639
.eql(1);
47-
}).before(async () => {
48-
await changeTheme('material.blue.light');
49-
50-
return createWidget('dxScheduler', {
51-
currentView: 'day',
52-
views: ['day', 'week'],
53-
height: 580,
54-
});
55-
});
40+
}).before(async () => createWidget('dxScheduler', {
41+
currentView: 'day',
42+
views: ['day', 'week'],
43+
height: 580,
44+
}));
5645

46+
// visual: material.blue.light
5747
test.skip('The toolbar should not display if the config is empty', async (t) => {
5848
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
5949

6050
const scheduler = new Scheduler('#container');
6151

62-
await testScreenshot(t, takeScreenshot, 'scheduler-with-empty-toolbar-config.png', {
63-
theme: 'material.blue.light',
64-
});
52+
await testScreenshot(t, takeScreenshot, 'scheduler-with-empty-toolbar-config.png');
6553

6654
await scheduler.option('toolbar', { items: ['viewSwitcher'] });
6755

68-
await testScreenshot(t, takeScreenshot, 'scheduler-with-non-empty-toolbar-config.png', {
69-
theme: 'material.blue.light',
70-
});
56+
await testScreenshot(t, takeScreenshot, 'scheduler-with-non-empty-toolbar-config.png');
7157

7258
await t
7359
.expect(compareResults.isValid())
7460
.ok(compareResults.errorMessages());
75-
}).before(async () => {
76-
await changeTheme('material.blue.light');
77-
78-
return createWidget('dxScheduler', {
79-
currentDate: new Date(2020, 2, 2),
80-
currentView: 'day',
81-
views: ['day', 'week'],
82-
height: 580,
83-
toolbar: { items: [] },
84-
});
85-
});
61+
}).before(async () => createWidget('dxScheduler', {
62+
currentDate: new Date(2020, 2, 2),
63+
currentView: 'day',
64+
views: ['day', 'week'],
65+
height: 580,
66+
toolbar: { items: [] },
67+
}));

e2e/testcafe-devextreme/tests/scheduler/common/header/sizes.ts

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Scheduler from 'devextreme-testcafe-models/scheduler';
33
import { createWidget } from '../../../../helpers/createWidget';
44
import url from '../../../../helpers/getPageUrl';
55
import { testScreenshot } from '../../../../helpers/themeUtils';
6-
import { changeTheme } from '../../../../helpers/changeTheme';
76

87
fixture`Scheduler header sizes`
98
.page(url(__dirname, '../../../container.html'));
@@ -26,23 +25,17 @@ test('items inside toolbar menu should stretch', async (t) => {
2625
await t
2726
.expect(compareResults.isValid())
2827
.ok(compareResults.errorMessages());
29-
}).before(async () => {
30-
await changeTheme('fluent.blue.light');
31-
32-
return createWidget('dxScheduler', {
33-
width: 320,
34-
currentDate: new Date('2025-05-02T07:59:01.167Z'),
35-
toolbar: {
36-
items: ['today', 'dateNavigator', ...buttons, {
37-
location: 'after',
38-
locateInMenu: 'auto',
39-
name: 'viewSwitcher',
40-
}],
41-
},
42-
});
43-
}).after(async () => {
44-
await changeTheme('generic.light');
45-
});
28+
}).before(async () => createWidget('dxScheduler', {
29+
width: 320,
30+
currentDate: new Date('2025-05-02T07:59:01.167Z'),
31+
toolbar: {
32+
items: ['today', 'dateNavigator', ...buttons, {
33+
location: 'after',
34+
locateInMenu: 'auto',
35+
name: 'viewSwitcher',
36+
}],
37+
},
38+
}));
4639

4740
test('Scheduler header should have correct sizes', async (t) => {
4841
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

e2e/testcafe-devextreme/tests/scheduler/common/layout/resources/base/generic.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Scheduler from 'devextreme-testcafe-models/scheduler';
33
import { createWidget } from '../../../../../../helpers/createWidget';
44
import url from '../../../../../../helpers/getPageUrl';
55
import { createDataSetForScreenShotTests, resourceDataSource } from '../../utils';
6-
import { changeTheme } from '../../../../../../helpers/changeTheme';
76
import { testScreenshot } from '../../../../../../helpers/themeUtils';
87

98
fixture.disablePageReloads`Scheduler: Generic theme layout`
@@ -73,14 +72,10 @@ test('Scheduler should have correct height in month view (T927862)', async (t) =
7372
.expect(dataTableBoundingClientRect.bottom)
7473
.eql(workspaceBoundingClientRect.bottom);
7574
}).before(async () => {
76-
await changeTheme('material.blue.light');
77-
7875
await createWidget('dxScheduler', {
7976
dataSource: [],
8077
views: ['month'],
8178
currentView: 'month',
8279
height: 800,
8380
});
84-
}).after(async () => {
85-
await changeTheme('generic.light');
8681
});

e2e/testcafe-devextreme/tests/scheduler/common/layout/views/material/withoutAllDay.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,26 @@ import Scheduler from 'devextreme-testcafe-models/scheduler';
33
import { createWidget } from '../../../../../../helpers/createWidget';
44
import url from '../../../../../../helpers/getPageUrl';
55
import { testScreenshot } from '../../../../../../helpers/themeUtils';
6-
import { changeTheme } from '../../../../../../helpers/changeTheme';
76

87
fixture.disablePageReloads`Scheduler: Material theme without all-day panel`
98
.page(url(__dirname, '../../../../../container.html'));
109

10+
// visual: material.blue.light
1111
test('Week view without all-day panel should be rendered correctly', async (t) => {
1212
const scheduler = new Scheduler('#container');
1313
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1414

1515
await testScreenshot(t, takeScreenshot, 'week-without-all-day-panel.png', {
1616
element: scheduler.workSpace,
17-
theme: 'material.blue.light',
1817
});
1918

2019
await t
2120
.expect(compareResults.isValid())
2221
.ok(compareResults.errorMessages());
23-
}).before(async () => {
24-
await changeTheme('material.blue.light');
25-
26-
return createWidget('dxScheduler', {
27-
dataSource: [],
28-
currentDate: new Date(2020, 6, 15),
29-
views: ['week'],
30-
currentView: 'week',
31-
height: 500,
32-
});
33-
}).after(async () => {
34-
await changeTheme('generic.light');
35-
});
22+
}).before(async () => createWidget('dxScheduler', {
23+
dataSource: [],
24+
currentDate: new Date(2020, 6, 15),
25+
views: ['week'],
26+
currentView: 'week',
27+
height: 500,
28+
}));

0 commit comments

Comments
 (0)