Skip to content

Commit e6e1fa0

Browse files
author
marker dao ®
committed
TestCafe: Move cursor before test
1 parent c83f4d7 commit e6e1fa0

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed
Binary file not shown.
Binary file not shown.

apps/demos/testing/widgets/tagbox/GroupedItems.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
2+
// import { Selector as $ } from 'testcafe';
23
import { runManualTest } from '../../../utils/visual-tests/matrix-test-helper';
34
import { testScreenshot } from '../../../utils/visual-tests/helpers/theme-utils';
45

@@ -11,6 +12,8 @@ runManualTest('TagBox', 'Grouping', (test) => {
1112
test('Grouping', async (t) => {
1213
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1314

15+
// await t.click($('body'), { offsetX: 0, offsetY: 0 });
16+
1417
await t
1518
.pressKey('tab')
1619
.pressKey('alt+down');

apps/demos/utils/visual-tests/testcafe-runner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ async function main() {
106106
// eslint-disable-next-line no-undef
107107
before: async (t: TestController) => {
108108
await ClientFunction(() => {
109+
document.body.dispatchEvent(new MouseEvent('click', { clientX: 0, clientY: 0 }));
109110
if (document.activeElement && document.activeElement !== document.body) {
110111
(document.activeElement as HTMLElement).blur();
111112
}

e2e/testcafe-devextreme/runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable spellcheck/spell-checker */
21
import createTestCafe, { ClientFunction } from 'testcafe';
32
import * as fs from 'fs';
43
import * as process from 'process';
@@ -265,6 +264,7 @@ async function main() {
265264
const { meta } = t.testRun.test;
266265

267266
await ClientFunction(() => {
267+
document.body.dispatchEvent(new MouseEvent('click', { clientX: 0, clientY: 0 }));
268268
if (document.activeElement && document.activeElement !== document.body) {
269269
(document.activeElement as HTMLElement).blur();
270270
}

0 commit comments

Comments
 (0)