Skip to content

DataGrid - AI Assistant: Add e2e tests#33740

Closed
Alyar666 wants to merge 7 commits into
DevExpress:26_1from
Alyar666:ai_assistant_add_e2e_tests_26_1
Closed

DataGrid - AI Assistant: Add e2e tests#33740
Alyar666 wants to merge 7 commits into
DevExpress:26_1from
Alyar666:ai_assistant_add_e2e_tests_26_1

Conversation

@Alyar666
Copy link
Copy Markdown
Contributor

No description provided.

@Alyar666 Alyar666 self-assigned this May 27, 2026
Copilot AI review requested due to automatic review settings May 27, 2026 07:45
@Alyar666 Alyar666 requested a review from a team as a code owner May 27, 2026 07:45
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 end-to-end (TestCafe) coverage for the DataGrid AI Assistant feature, extending the existing TestCafe models to support new UI elements (suggestions/title) and introducing positive/negative functional scenarios.

Changes:

  • Extended the AIAssistantChat TestCafe model with selectors for suggestions and header/title access.
  • Added a large “positive cases” functional suite covering toolbar entry, command execution, suggestions, customization hooks, request-creating hook, and regenerate flow.
  • Added a “negative cases” functional suite for empty actions, unknown fields, impossible state commands, and provider errors; also added new AI-assistant helper modules (currently unused).

Reviewed changes

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

Show a summary per file
File Description
packages/testcafe-models/dataGrid/aiAssistantChat.ts Adds selectors/helpers for chat suggestions and title access (but currently breaks TS due to missing Selector import).
e2e/testcafe-devextreme/tests/dataGrid/common/aiAssistant/positiveCases.functional.ts New comprehensive positive-path functional coverage for AI Assistant behaviors.
e2e/testcafe-devextreme/tests/dataGrid/common/aiAssistant/negativeCases.functional.ts New negative-path functional coverage for AI Assistant error/edge scenarios.
e2e/testcafe-devextreme/tests/dataGrid/common/aiAssistant/helpers/testData.ts Adds shared test data/grid config helpers (currently unused).
e2e/testcafe-devextreme/tests/dataGrid/common/aiAssistant/helpers/aiMock.ts Adds AIIntegration mock helpers (currently unused; includes a doc example referencing a nonexistent helper).
Comments suppressed due to low confidence (1)

packages/testcafe-models/dataGrid/aiAssistantChat.ts:35

  • Selector is referenced in method signatures/returns (e.g., getWrapper(): Selector) but it's no longer imported in this file, which will cause a TypeScript compile error. Add back an import (prefer import type { Selector } from 'testcafe'; if it’s type-only).
export class AIAssistantChat extends Popup {
  getWrapper(): Selector {
    return this.element;
  }

Comment on lines +653 to +656
await t
.typeText(chat.getInput(), 'Sort by name')
.pressKey('enter');

Comment on lines +1 to +36
export const GRID_SELECTOR = '#container';

export const SIMPLE_DATA = [
{ id: 1, name: 'Alice', value: 30 },
{ id: 2, name: 'Bob', value: 20 },
{ id: 3, name: 'Charlie', value: 10 },
];

export const PAGED_DATA = Array.from({ length: 20 }, (_, i) => ({
id: i + 1,
name: `Name ${i + 1}`,
value: (i + 1) * 10,
}));

export const DEFAULT_COLUMNS = ['id', 'name', 'value'];

export function getBaseGridConfig(): Record<string, unknown> {
return {
dataSource: SIMPLE_DATA,
keyExpr: 'id',
columns: DEFAULT_COLUMNS,
showBorders: true,
};
}

export function getPagedGridConfig(): Record<string, unknown> {
return {
dataSource: PAGED_DATA,
keyExpr: 'id',
columns: DEFAULT_COLUMNS,
showBorders: true,
paging: {
pageSize: 5,
},
};
}
Comment on lines +1 to +6
interface MockSendRequestOptions {
response?: Record<string, unknown>;
reject?: boolean;
error?: Error | string;
delay?: number;
}
Comment on lines +12 to +19
* @example
* ```ts
* await createWidget('dxDataGrid', () => ({
* ...getGridConfig(),
* aiAssistant: {
* enabled: true,
* aiIntegration: createAIIntegrationMock({
* response: {
Copilot AI review requested due to automatic review settings June 2, 2026 22:05
@Alyar666 Alyar666 force-pushed the ai_assistant_add_e2e_tests_26_1 branch from 9885c51 to 2b3c2b5 Compare June 2, 2026 22:05
Alyar and others added 7 commits June 3, 2026 02:05
Split positiveCases/negativeCases/edgeCases into functional-area files
(toolbarAndPopup, commands, chatExperience, requestLifecycle,
requestCustomization, regenerate, errorHandling) and extract shared
constants into testHelpers.ts. No test behavior changed; all 86 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add §4.1–§4.4 coverage to errorHandling.functional.ts: AI-integration
failures, response-format and validation rejections, and per-command
execution failures. Assert the predefined error text via a shared
formatMessage helper (matched by localization key, not wording).

4.1.1 locks current behavior (shows invalid-response instead of the
expected unexpected-error — issue 4284). Cases not reproducible through
the public mock (sync throw, async reject, reentrancy) are documented
inline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add §5.1 cancellation cases (onAIAssistantRequestCreating cancel) to
requestCustomization.functional.ts and a new interruption.functional.ts
covering §5.2 (popup close mid-request, abort, ignored late resolution)
and §5.5 (dispose mid-request/mid-execution, re-create after dispose).

§5.3/§5.4 (close mid-execution) are documented as not e2e-reproducible
(issue 4282 + synchronous command execution). 5.1.4 locks current
behavior (cancel-aborted message shows Regenerate, cf. 1.12.11).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add treeList/aiAssistant/functional.ts verifying that grid_core AI
Assistant commands behave identically on TreeList (sorting, searching,
paging, column visibility, selection, row focusing), error paths and the
in-flight lock, plus the TreeList-only schema differences (grouping and
summary commands absent). Includes hierarchical-data cases.

columnsReorder (issue 4294) and summary (unsupported) are documented as
not exercised.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Alyar666 Alyar666 force-pushed the ai_assistant_add_e2e_tests_26_1 branch from 2b3c2b5 to 1553c73 Compare June 2, 2026 22:06
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

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);
Comment on lines +56 to +59
// eslint-disable-next-line class-methods-use-this
getAbortConfirmYesButton(): Selector {
return Selector(`.${CLASS.abortConfirmDialog} .dx-button`).withExactText('Yes');
}
Comment on lines +69 to +71
getUserMessages(): Selector {
return this.getMessages().filter((node) => !node.querySelector('.dx-ai-chat__message'));
}
@Alyar666 Alyar666 closed this Jun 2, 2026
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