Skip to content

Commit 2c593e5

Browse files
e2e tests: bump TestCafe version to 3.7.0 (#31291)
1 parent 577d4e9 commit 2c593e5

33 files changed

Lines changed: 459 additions & 687 deletions

File tree

e2e/testcafe-devextreme/helpers/clearPage.js

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

33
module.exports = {
4-
clearTestPage: async function() {
4+
clearTestPage: async function(testController) {
55
const shadowDom = process.env.shadowDom === 'true';
66

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

e2e/testcafe-devextreme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"minimist": "1.2.8",
2020
"mockdate": "3.0.5",
2121
"nconf": "0.12.1",
22-
"testcafe": "2.5.0",
22+
"testcafe": "3.7.0",
2323
"ts-node": "10.9.2",
2424
"eslint": "catalog:",
2525
"@eslint/eslintrc": "catalog:",

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 @stylistic/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);
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)