Skip to content

DataGrid - AI Assistant: error handling e2e tests#33809

Open
Alyar666 wants to merge 2 commits into
DevExpress:26_1from
Alyar666:ai_assistant_e2e_error_handling_26_1
Open

DataGrid - AI Assistant: error handling e2e tests#33809
Alyar666 wants to merge 2 commits into
DevExpress:26_1from
Alyar666:ai_assistant_e2e_error_handling_26_1

Conversation

@Alyar666
Copy link
Copy Markdown
Contributor

@Alyar666 Alyar666 commented Jun 2, 2026

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.sendRequest is mocked to return deterministic responses; assertions check chat status and grid state via POM accessors. The PR also includes the shared testHelpers.ts and AI Assistant testcafe-models POM accessors the suite depends on.

How can we verify these changes?

pnpm nx test devextreme-testcafe-tests -- --componentFolder dataGrid/common/aiAssistant --file errorHandling.functional --browsers 'chrome:headless' --concurrency 1

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>
Copilot AI review requested due to automatic review settings June 2, 2026 22:31
@Alyar666 Alyar666 requested a review from a team as a code owner June 2, 2026 22:31
@Alyar666 Alyar666 self-assigned this Jun 2, 2026
Copy link
Copy Markdown
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

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.ts covering AI Assistant negative/error paths with deterministic mocked provider responses.
  • Extended devextreme-testcafe-models DataGrid + AI Assistant chat models with new accessors/helpers used by the suite.
  • Added shared testHelpers.ts utilities 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>
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.

2 participants