Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce TestCafe E2E test flakiness by ensuring widget readiness checks (isReady()) are performed via retryable TestCafe assertions rather than being awaited as a one-shot boolean check, and by adding an ESLint rule to enforce that pattern going forward.
Changes:
- Replaced
await <widget>.isReady()withawait t.expect(<widget>.isReady()).ok()across several DataGrid/TreeList/FilterBuilder/CardView tests. - Fixed a couple of
beforehooks to properlyawait createWidget(...)so widget initialization completes before the test runs. - Added a custom ESLint rule (
no-is-ready-without-expect) and enabled it (currently scoped to DataGrid and CardView tests).
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| e2e/testcafe-devextreme/tests/dataGrid/sticky/common/withGrouping.ts | Switches readiness check to retryable t.expect(...).ok() to reduce flakiness. |
| e2e/testcafe-devextreme/tests/dataGrid/common/toast.ts | Uses t.expect(...).ok() for readiness and awaits createWidget in before hook. |
| e2e/testcafe-devextreme/tests/dataGrid/common/markup/T1163515_alternateRowGroupBorders.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/dataGrid/common/headerFilter/headerFilter.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/dataGrid/common/grouping/calculateGroupValueRuntimeChanges.ts | Converts multiple readiness checks to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/dataGrid/common/filterRow/visual.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/dataGrid/common/filterRow/functional.ts | Converts readiness checks to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/dataGrid/common/editing/visual.ts | Adds an eslint-disable for a local helper returning isReady() (see review comment re: retry behavior). |
| e2e/testcafe-devextreme/tests/dataGrid/common/columnChooser.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/dataGrid/common/adaptivity/functional.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/common/treeList/toast.ts | Uses t.expect(...).ok() for readiness and awaits createWidget in before hook. |
| e2e/testcafe-devextreme/tests/common/treeList/rowDragging.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/common/treeList/adaptiveRow.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/common/filterBuilder/filterBuilderScrolling.ts | Converts readiness check to t.expect(...).ok(). |
| e2e/testcafe-devextreme/tests/cardView/editing/editing.functional.ts | Converts readiness checks to t.expect(...).ok() for CardView. |
| e2e/testcafe-devextreme/eslint.config.mjs | Registers and enables the new local ESLint rule (currently scoped to DataGrid + CardView test globs). |
| e2e/testcafe-devextreme/eslint-rules/no-is-ready-without-expect.js | Adds custom ESLint rule to disallow calling .isReady() outside of t.expect(). |
Comments suppressed due to low confidence (1)
e2e/testcafe-devextreme/tests/dataGrid/common/editing/visual.ts:316
scrollToreturnsdataGrid.isReady(), but the caller doest.expect(await scrollTo(...)).ok(). Because the promise is awaited before passing intot.expect, TestCafe won’t retry the readiness check and this can still be flaky after scrolling. Consider makingscrollToperform the scroll and then assert readiness viat.expect(dataGrid.isReady()).ok(...)(or pass the promise directly tot.expectwithout awaiting) so readiness is retried with TestCafe’s assertion timeout.
const scrollTo = async (y) => {
await dataGrid.scrollTo(t, { y });
// eslint-disable-next-line local/no-is-ready-without-expect
return dataGrid.isReady();
};
const screenshotName = `grid-new-row_position-${newRowPosition}_scroll-mode-${scrollMode}_top-${scrollTop}.png`;
await t
.expect(await scrollTo(scrollTop))
.ok(`scrollTo ${scrollTop}`)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.