Skip to content

e2e: Move cursor before test#32787

Open
marker-dao wants to merge 7 commits intoDevExpress:26_1from
marker-dao:26_1_chat_tagbox_fix_flucky_tests
Open

e2e: Move cursor before test#32787
marker-dao wants to merge 7 commits intoDevExpress:26_1from
marker-dao:26_1_chat_tagbox_fix_flucky_tests

Conversation

@marker-dao
Copy link
Contributor

No description provided.

@marker-dao marker-dao force-pushed the 26_1_chat_tagbox_fix_flucky_tests branch from 02287a2 to b6822e5 Compare March 4, 2026 16:38
@marker-dao marker-dao marked this pull request as ready for review March 4, 2026 16:38
Copilot AI review requested due to automatic review settings March 4, 2026 16:38
EugeniyKiyashko
EugeniyKiyashko previously approved these changes Mar 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the TestCafe runners to attempt to reset UI state before each test by programmatically dispatching a click event on document.body inside the test.before hook.

Changes:

  • Dispatch a synthetic MouseEvent('click') at (0,0) before blurring the active element in the main e2e TestCafe runner.
  • Apply the same synthetic click in the demos visual-tests TestCafe runner.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
e2e/testcafe-devextreme/runner.ts Adds a synthetic body click in the per-test before hook, alongside existing focus/selection cleanup.
apps/demos/utils/visual-tests/testcafe-runner.ts Adds the same synthetic body click in the per-test before hook for the demos visual-test runner.

r-farkhutdinov
r-farkhutdinov previously approved these changes Mar 4, 2026
@marker-dao marker-dao changed the title TestCafe: Move cursor before test e2e: Move cursor before test Mar 4, 2026
@marker-dao marker-dao requested a review from Copilot March 4, 2026 17:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings March 4, 2026 20:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

}).with({ boundTestRun: t })();

await t.hover('html');
await t.hover('html', { offsetX: 1, offsetY: 1 });
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hover offset values (1,1) are magic numbers here. Consider introducing a small named constant (e.g., a MOUSE_RESET_OFFSET) or adding a brief inline comment explaining why these specific offsets are required (e.g., avoiding edge/scrollbar coordinates) to make the intent clearer and avoid accidental changes later.

Copilot uses AI. Check for mistakes.
window.getSelection()?.removeAllRanges();
}).with({ boundTestRun: t })();

await t.hover('html', { offsetX: 1, offsetY: 1 });
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a hard-coded hover offset (1,1). To improve readability/maintainability, consider using a named constant for the offset (or add a short comment for why this specific coordinate is chosen) so future changes don’t unintentionally reintroduce cursor-related flakiness.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants