DataGrid - AI Assistant: Add e2e tests#33740
Open
Alyar666 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
AIAssistantChatTestCafe 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
Selectoris 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 (preferimport 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: { |
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.