Skip to content

Commit 56e56aa

Browse files
authored
CI optimization: reduce the number of scenarios in TestCafe testing (unstable) (#31357)
1 parent e5541ef commit 56e56aa

22 files changed

Lines changed: 139 additions & 110 deletions
Loading
Loading

e2e/testcafe-devextreme/tests/editors/button/floatingAction.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable no-restricted-syntax */
22
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
33
import { ClientFunction, Selector } from 'testcafe';
4-
import { getThemePostfix, testScreenshot } from '../../../helpers/themeUtils';
4+
import { getThemePostfix, isMaterial, testScreenshot } from '../../../helpers/themeUtils';
55
import url from '../../../helpers/getPageUrl';
66
import { createWidget } from '../../../helpers/createWidget';
7-
import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils';
7+
import { appendElementTo, insertStylesheetRulesToPage, setStyleAttribute } from '../../../helpers/domUtils';
88
import { changeTheme } from '../../../helpers/changeTheme';
99

1010
const OVERLAY_CONTENT_CLASS = 'dx-overlay-content';
@@ -78,6 +78,9 @@ for (const label of ['Add Row', '']) {
7878
.ok(compareResults.errorMessages());
7979
}).before(async () => {
8080
await setStyleAttribute(Selector('#container'), 'width: 300px; height: 300px;');
81+
if (isMaterial()) {
82+
await insertStylesheetRulesToPage('.dx-overlay-wrapper { font-family: sans-serif !important; }');
83+
}
8184
await appendElementTo('#container', 'div', 'speed-dial-action');
8285

8386
await setGlobalConfig();

e2e/testcafe-devextreme/tests/editors/dateRangeBox/calendar.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
22
import DateRangeBox from 'devextreme-testcafe-models/dateRangeBox';
33
import {
44
appendElementTo,
5+
insertStylesheetRulesToPage,
56
setAttribute,
67
} from '../../../helpers/domUtils';
78
import url from '../../../helpers/getPageUrl';
@@ -325,6 +326,7 @@ test('Selected range if endDate = startDate, currentSelection: startDate', async
325326
}).before(async () => {
326327
await appendElementTo('#container', 'div', 'dateRangeBox');
327328
await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;');
329+
await insertStylesheetRulesToPage('* { caret-color: transparent !important; }');
328330

329331
return createWidget('dxDateRangeBox', {
330332
value: [new Date(2021, 9, 18), new Date(2021, 9, 18)],
@@ -449,6 +451,7 @@ test('Start date cell in selected range', async (t) => {
449451
}).before(async () => {
450452
await appendElementTo('#container', 'div', 'dateRangeBox');
451453
await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;');
454+
await insertStylesheetRulesToPage('* { caret-color: transparent !important; }');
452455

453456
return createWidget('dxDateRangeBox', {
454457
value: [new Date(2021, 9, 17), new Date(2021, 10, 6)],
@@ -562,6 +565,7 @@ test('End date cell in selected range', async (t) => {
562565
}).before(async () => {
563566
await appendElementTo('#container', 'div', 'dateRangeBox');
564567
await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;');
568+
await insertStylesheetRulesToPage('* { caret-color: transparent !important; }');
565569

566570
return createWidget('dxDateRangeBox', {
567571
value: [new Date(2021, 9, 17), new Date(2021, 9, 23)],
@@ -662,17 +666,20 @@ test('Disabled dates on inputs focus (disableOutOfRangeSelection: true)', async
662666
const dateRangeBox = new DateRangeBox('#dateRangeBox');
663667

664668
await t
665-
.click(dateRangeBox.getStartDateBox().input);
669+
.click(dateRangeBox.getStartDateBox().input)
670+
.hover(dateRangeBox.getStartDateBox().input);
666671

667672
await testScreenshot(t, takeScreenshot, 'DRB disabled dates on popup opening.png', { element: '#container' });
668673

669674
await t
670-
.click(dateRangeBox.getEndDateBox().input);
675+
.click(dateRangeBox.getEndDateBox().input)
676+
.hover(dateRangeBox.getEndDateBox().input);
671677

672678
await testScreenshot(t, takeScreenshot, 'DRB disabled dates on end date input focus.png', { element: '#container' });
673679

674680
await t
675-
.click(dateRangeBox.getStartDateBox().input);
681+
.click(dateRangeBox.getStartDateBox().input)
682+
.hover(dateRangeBox.getStartDateBox().input);
676683

677684
await testScreenshot(t, takeScreenshot, 'DRB disabled dates on start date input focus.png', { element: '#container' });
678685

@@ -682,6 +689,7 @@ test('Disabled dates on inputs focus (disableOutOfRangeSelection: true)', async
682689
}).before(async () => {
683690
await appendElementTo('#container', 'div', 'dateRangeBox');
684691
await setAttribute('#container', 'style', 'width: 800px; height: 500px; padding-top: 10px;');
692+
await insertStylesheetRulesToPage('* { caret-color: transparent !important; }');
685693

686694
return createWidget('dxDateRangeBox', {
687695
value: [new Date('2020/02/20'), new Date('2020/02/22')],

e2e/testcafe-devextreme/tests/editors/dropDownBox/T1245111_dropDownBox_height.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ fixture.disablePageReloads`Grid on Drop Down Box`.page(
1212
// T1245111
1313
safeSizeTest('DataGrid on dropDownBox should appear correctly on window resize', async (t) => {
1414
const dropDownBox = Selector('#container');
15+
const overlay = Selector('.dx-overlay-content');
1516
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1617

1718
await t.click(dropDownBox);
19+
await t.hover(overlay);
1820
await t.resizeWindow(800, 800);
1921
await testScreenshot(t, takeScreenshot, 'T1245111-dropDownBox-resize.png');
2022
await t
111 Bytes
Loading
76 Bytes
Loading
116 Bytes
Loading

e2e/testcafe-devextreme/tests/editors/lookup/common.ts

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from '../../../helpers/domUtils';
1313

1414
const LOOKUP_FIELD_CLASS = 'dx-lookup-field';
15+
const OVERLAY_CLASS = 'dx-overlay-content';
1516

1617
const stylingModes = ['outlined', 'underlined', 'filled'];
1718
const labelModes = ['static', 'floating', 'hidden', 'outside'];
@@ -89,37 +90,47 @@ if (!isMaterialBased()) {
8990
safeSizeTest('Check popup height with no found data option', async (t) => {
9091
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
9192
await t.click(Selector(`.${LOOKUP_FIELD_CLASS}`));
93+
await t.hover(`.${OVERLAY_CLASS}`);
9294

9395
await testScreenshot(t, takeScreenshot, 'Lookup with no found data.png');
9496

9597
await t
9698
.expect(compareResults.isValid())
9799
.ok(compareResults.errorMessages());
98-
}, [300, 400]).before(async () => createWidget('dxLookup', { dataSource: [], searchEnabled: true }));
100+
}, [300, 400]).before(async () => {
101+
await insertStylesheetRulesToPage('* { caret-color: transparent !important; }');
102+
103+
return createWidget('dxLookup', { dataSource: [], searchEnabled: true });
104+
});
99105

100106
safeSizeTest('Check popup height in loading state', async (t) => {
101107
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
102108

103109
await t.click(Selector(`.${LOOKUP_FIELD_CLASS}`));
110+
await t.hover(`.${OVERLAY_CLASS}`);
104111

105112
await testScreenshot(t, takeScreenshot, 'Lookup in loading.png');
106113

107114
await t
108115
.expect(compareResults.isValid())
109116
.ok(compareResults.errorMessages());
110-
}, [300, 400]).before(async () => createWidget('dxLookup', {
111-
dataSource: {
112-
load() {
113-
return new Promise((resolve) => {
114-
setTimeout(() => {
115-
resolve([1, 2, 3]);
116-
}, 5000);
117-
});
117+
}, [300, 400]).before(async () => {
118+
await insertStylesheetRulesToPage('* { caret-color: transparent !important; }');
119+
120+
return createWidget('dxLookup', {
121+
dataSource: {
122+
load() {
123+
return new Promise((resolve) => {
124+
setTimeout(() => {
125+
resolve([1, 2, 3]);
126+
}, 5000);
127+
});
128+
},
118129
},
119-
},
120-
valueExpr: 'id',
121-
displayExpr: 'text',
122-
}));
130+
valueExpr: 'id',
131+
displayExpr: 'text',
132+
});
133+
});
123134

124135
test('Placeholder is visible after items option change when value is not chosen (T1099804)', async (t) => {
125136
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
635 Bytes
Loading

0 commit comments

Comments
 (0)