Skip to content

Commit 976f633

Browse files
e2e tests: bump TestCafe version to 3.7.0 (#31320)
1 parent 1e1552b commit 976f633

35 files changed

Lines changed: 493 additions & 658 deletions

File tree

e2e/testcafe-devextreme/helpers/clearPage.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
const testCafe = require('testcafe');
33

44
module.exports = {
5-
clearTestPage: async function() {
5+
clearTestPage: async function(testController) {
66
const shadowDom = process.env.shadowDom === 'true';
77

8-
await testCafe.ClientFunction(() => {
8+
const clearTestPageFn = testCafe.ClientFunction(() => {
99
const widgetSelector = '.dx-widget';
1010
const $elements = $(widgetSelector)
1111
.filter((_, element) => $(element).parents(widgetSelector).length === 0);
@@ -46,6 +46,8 @@ module.exports = {
4646
dependencies: {
4747
shadowDom,
4848
}
49-
})();
49+
});
50+
51+
await clearTestPageFn.with({ boundTestRun: testController })();
5052
}
5153
};

e2e/testcafe-devextreme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"minimist": "1.2.8",
2828
"mockdate": "3.0.5",
2929
"nconf": "0.12.1",
30-
"testcafe": "2.5.0",
30+
"testcafe": "3.7.0",
3131
"ts-node": "10.9.2"
3232
}
3333
}

e2e/testcafe-devextreme/runner.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ const TESTCAFE_CONFIG: Partial<TestCafeConfigurationOptions> = {
3131
port2: 1438,
3232
};
3333

34+
const getCurrentTheme = async (t: TestController): Promise<string> => {
35+
// eslint-disable-next-line max-len
36+
const currentTheme = await ClientFunction(() => (window as any).DevExpress.ui.themes.current()).with({ boundTestRun: t })();
37+
38+
return currentTheme;
39+
};
40+
3441
const changeTheme = async (t: TestController, themeName: string): Promise<void> => {
3542
const changeThemeClientFn = ClientFunction(() => new Promise<void>((resolve) => {
3643
(window as any).DevExpress.ui.themes.ready(resolve);
@@ -237,7 +244,8 @@ createTestCafe(TESTCAFE_CONFIG)
237244
}
238245

239246
const runOptions: RunOptions = {
240-
quarantineMode: { successThreshold: 1, attemptLimit: 10 },
247+
quarantineMode: { successThreshold: 1, attemptLimit: 5 },
248+
disableNativeAutomation: true,
241249
// @ts-expect-error ts-error
242250
hooks: {
243251
test: {
@@ -251,12 +259,17 @@ createTestCafe(TESTCAFE_CONFIG)
251259
await addShadowRootTree(t);
252260
}
253261

254-
if (args.theme) {
255-
await changeTheme(t, args.theme);
262+
if (!componentFolder.includes('dataGrid')) {
263+
const currentTheme = await getCurrentTheme(t) || 'generic.light';
264+
const newTheme = args.theme || 'generic.light';
265+
266+
if (currentTheme !== newTheme) {
267+
await changeTheme(t, newTheme);
268+
}
256269
}
257270
},
258-
after: async () => {
259-
await testPageUtils.clearTestPage();
271+
after: async (t: TestController) => {
272+
await testPageUtils.clearTestPage(t);
260273
},
261274
},
262275
},
31 Bytes
Loading

e2e/testcafe-devextreme/tests/cardView/headerPanel/visual.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ test(
194194
width: 600,
195195
}));
196196

197-
test('render with horizontal scroll', async (t) => {
197+
test.meta({ unstable: true })('render with horizontal scroll', async (t) => {
198198
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
199199
const cardView = new CardView(CARD_VIEW_SELECTOR);
200200
const firstItem = cardView.getHeaderPanel().getHeaderItem(0);

e2e/testcafe-devextreme/tests/dataGrid/sticky/common/appearance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fixture.disablePageReloads`FixedColumns - appearance`
2828
([theme, showRowLines]) => {
2929
// T1268664
3030
const showRowLinesState = `showRowLines=${showRowLines ? 'true' : 'false'}`;
31-
test(`Row height for selected, focus and edit state should not differ from the default one if ${showRowLinesState}`, async (t) => {
31+
test.meta({ unstable: true })(`Row height for selected, focus and edit state should not differ from the default one if ${showRowLinesState}`, async (t) => {
3232
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
3333

3434
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
Loading
-5.19 KB
Loading
Loading
Loading

0 commit comments

Comments
 (0)