DataGrid - AI Assistant: error handling e2e tests#33809
Open
Alyar666 wants to merge 2 commits into
Open
Conversation
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>
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. |
Comment on lines
+57
to
+59
| getAbortConfirmYesButton(): Selector { | ||
| return Selector(`.${CLASS.abortConfirmDialog} .dx-button`).withExactText('Yes'); | ||
| } |
Comment on lines
+141
to
+145
| isClearChatDisabled(): Promise<boolean> { | ||
| return this.getClearChatButton() | ||
| .parent('.dx-button') | ||
| .hasClass('dx-state-disabled'); | ||
| } |
Comment on lines
+74
to
+80
| const dataSourceSortParams = await dataGrid.apiGetDataSourceSortParams(); | ||
|
|
||
| await t.expect(aiChat.getMessages().count).eql(2); | ||
| await t.expect(aiChat.getSuccessMessages().count).eql(0); | ||
| await t.expect(aiChat.getErrorMessages().count).eql(1); | ||
| await t.expect(aiChat.getErrorActionItems(0).count).eql(1); | ||
| await t.expect(dataSourceSortParams).eql(null); |
…andling tests Wait for the AI integration global before creating the widget (fixes the CI page-load race) via a shared createWidgetWithAIIntegration helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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?