DataGrid - AI Assistant: error handling e2e tests#33809
Open
Alyar666 wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new TestCafe e2e suite that validates DataGrid AI Assistant error-handling behavior (invalid response formats, validation failures, per-command execution failures, and provider rejections) using a mocked aiIntegration.sendRequest. The PR also extends the shared TestCafe page models to expose AI Assistant chat UI/state and a couple of DataGrid API helpers needed by the tests.
Changes:
- Added
errorHandling.functional.tscovering AI Assistant negative/error paths with deterministic mocked provider responses. - Extended
devextreme-testcafe-modelsDataGrid + AI Assistant chat models with new accessors/helpers used by the suite. - Added shared
testHelpers.tsutilities for AI Assistant e2e tests (page URL, localization lookup).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/testcafe-models/dataGrid/index.ts | Adds DataGrid client-side helper to read DataSource sort params + a focus helper for the AI Assistant button. |
| packages/testcafe-models/dataGrid/aiAssistantChat.ts | Extends AI Assistant chat POM with input/message/suggestion helpers and abort-confirm dialog accessors. |
| packages/testcafe-models/chat.ts | Adds a reusable getMessageBubbles() accessor and reuses it in getMessage(). |
| e2e/testcafe-devextreme/tests/dataGrid/common/aiAssistant/testHelpers.ts | New shared constants + client-side helpers (page URL, formatMessage, request inspection hook). |
| e2e/testcafe-devextreme/tests/dataGrid/common/aiAssistant/errorHandling.functional.ts | New comprehensive e2e test file for AI Assistant error-handling across layers. |
fad0c0b to
6d10edb
Compare
6d10edb to
d542046
Compare
error handling across layers — AI-integration, response-format, validation and per-command execution failures, plus the negative/rejection cases; predefined error text is asserted by localization key (plan §2, §4) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ed POM methods Extract shared setup/assertion helpers (grid factory, openChatAndSubmit, expectInvalidResponse) into the test file; add missing grid-state and error-text assertions for empty-actions, provider rejection, 4.3.11 and 4.4.4 searching; align fixtures with the commands suite. Remove POM/testHelpers methods added but not used by this PR (focusAIAssistantButton, abort-confirm/suggestion/disabled accessors, getUserMessages, getTitle, getRequestColumnNames).
…nt keys Add the required preserve arg so the command runs instead of failing schema validation; assert it succeeds and selects no rows (Copilot review).
82ef58f to
01316d8
Compare
Use the canonical getMessages (chat bubbles) / getAIMessages semantics and keep only the POM methods this PR's tests use (functional + visual), dropping unused ones.
added 2 commits
June 8, 2026 13:33
Replace the kind-based mock with the shared queue helper (raw response / FAIL); keep a local no-integration grid factory for the missing-aiIntegration case.
Collapse the per-section fixtures into a single named fixture; keep the // === §X === markers as in-file section dividers.
…ync grid reads to t.expect Restore the scoped getWrapper override; drop await inside t.expect so TestCafe retries async grid-state assertions (Copilot review).
| const { dataGrid, aiChat } = await openChatAndSubmit(t, 'Sort by name'); | ||
|
|
||
| await expectInvalidResponse(t, aiChat, dataGrid); | ||
| }).before(async () => createGridWithAIAssistant(baseGrid, [{ actions: [{ name: 'sorting', args: { dataField: 'name', sortOrder: 123 } }] }])); |
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.
What does the PR change?
Adds e2e TestCafe tests for the DataGrid AI Assistant — error handling across layers — AI-integration, response-format, validation and per-command execution failures, plus the negative/rejection cases; predefined error text is asserted by localization key (plan §2, §4).
Part of splitting the AI Assistant e2e suite into per-area pull requests.
How did you achieve this?
aiAssistant.aiIntegration.sendRequestis mocked to return deterministic responses; assertions check chat status and grid state via POM accessors. The PR also includes the sharedtestHelpers.tsand AI Assistanttestcafe-modelsPOM accessors the suite depends on.How can we verify these changes?