Skip to content

Commit 6ebc311

Browse files
author
marker dao ®
committed
feat(runners): Replace event call with testcafe click
1 parent b6822e5 commit 6ebc311

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ async function main() {
105105
test: {
106106
// eslint-disable-next-line no-undef
107107
before: async (t: TestController) => {
108+
await t.click('body', { offsetX: 0, offsetY: 0 });
109+
108110
await ClientFunction(() => {
109-
document.body.dispatchEvent(new MouseEvent('click', { clientX: 0, clientY: 0 }));
110111
if (document.activeElement && document.activeElement !== document.body) {
111112
(document.activeElement as HTMLElement).blur();
112113
}

e2e/testcafe-devextreme/runner.ts

Lines changed: 2 additions & 2 deletions
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';
@@ -264,8 +263,9 @@ async function main() {
264263
// @ts-expect-error ts-errors
265264
const { meta } = t.testRun.test;
266265

266+
await t.click('body', { offsetX: 0, offsetY: 0 });
267+
267268
await ClientFunction(() => {
268-
document.body.dispatchEvent(new MouseEvent('click', { clientX: 0, clientY: 0 }));
269269
if (document.activeElement && document.activeElement !== document.body) {
270270
(document.activeElement as HTMLElement).blur();
271271
}

0 commit comments

Comments
 (0)