diff --git a/app/client/cypress/support/Constants.js b/app/client/cypress/support/Constants.js index 0fe95fd43976..30c6272abe0a 100644 --- a/app/client/cypress/support/Constants.js +++ b/app/client/cypress/support/Constants.js @@ -119,6 +119,7 @@ export const TABLE_DATA_STATIC = ` export const WALKTHROUGH_TEST_PAGE = "WALKTHROUGH_TEST_PAGE"; export const ANVIL_EDITOR_TEST = "ANVIL_EDITOR_TEST"; +export const AI_AGENTS_TEST = "AI_AGENTS_TEST"; export const DEFAULT_COLUMN_NAME = "Table Column"; export const FEATURE_WALKTHROUGH_INDEX_KEY = "FEATURE_WALKTHROUGH"; export const USER_SIGN_UP_INDEX_KEY = "USER_SIGN_UP"; diff --git a/app/client/cypress/support/Pages/AggregateHelper.ts b/app/client/cypress/support/Pages/AggregateHelper.ts index e91fc6fd5219..fa74ea5a239f 100644 --- a/app/client/cypress/support/Pages/AggregateHelper.ts +++ b/app/client/cypress/support/Pages/AggregateHelper.ts @@ -2094,4 +2094,60 @@ export class AggregateHelper { return fetchEmail(); } + + public getCanvasWidgetStateByWidgetName(widgetName: string): any { + return cy + .window() + .its("store") + .invoke("getState") + .then((state) => { + const widgets = state.entities.canvasWidgets; + + const widgetId = Object.keys(widgets).find((widgetId) => { + if (widgets[widgetId].widgetName === widgetName) { + return widgets[widgetId]; + } + }); + + if (!widgetId) return null; + + return widgets[widgetId]; + }); + } + + public getDatasourceStateByName(datasourceName: string): any { + return cy + .window() + .its("store") + .invoke("getState") + .then((state) => { + const datasources = state.entities.datasources.list; + + const datasource = datasources.find( + (datasource: any) => datasource.name === datasourceName, + ); + + if (!datasource) return null; + + return datasource; + }); + } + + public getActionStateByName(actionName: string): any { + return cy + .window() + .its("store") + .invoke("getState") + .then((state) => { + const actions = state.entities.actions; + + const action = actions.find( + (action: any) => action.config.name === actionName, + ); + + if (!action) return null; + + return action; + }); + } } diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index d3e25fdc1be9..96dba3434e3d 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -1,7 +1,7 @@ /* eslint-disable cypress/no-unnecessary-waiting */ /* eslint-disable cypress/no-assigning-return-values */ /* This file is used to maintain comman methods across tests , refer other *.js files for adding common methods */ -import { ANVIL_EDITOR_TEST } from "./Constants.js"; +import { ANVIL_EDITOR_TEST, AI_AGENTS_TEST } from "./Constants.js"; import advancedFormat from "dayjs/plugin/advancedFormat"; import EditorNavigation, { @@ -741,7 +741,10 @@ Cypress.Commands.add("startServerAndRoutes", () => { cy.intercept("PUT", "/api/v1/git/discard/app/*").as("discardChanges"); cy.intercept("GET", "/api/v1/libraries/*").as("getLibraries"); - if (Cypress.currentTest.titlePath[0].includes(ANVIL_EDITOR_TEST)) { + if ( + Cypress.currentTest.titlePath[0].includes(ANVIL_EDITOR_TEST) || + Cypress.currentTest.titlePath[0].includes(AI_AGENTS_TEST) + ) { // intercept features call for creating pages that support Anvil + WDS tests featureFlagIntercept({ release_anvil_enabled: true }, false); } else { diff --git a/app/client/cypress/tags.js b/app/client/cypress/tags.js index d40eb2e43e29..be931a646a04 100644 --- a/app/client/cypress/tags.js +++ b/app/client/cypress/tags.js @@ -73,5 +73,6 @@ module.exports = { "@tag.Workspace", "@tag.airgap", "@tag.excludeForAirgap", + "@tag.AIAgents", ], }; diff --git a/app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx b/app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx index 6fc6c23c2f93..7da5c0b2298e 100644 --- a/app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx +++ b/app/client/packages/design-system/widgets/src/components/TextArea/src/TextArea.tsx @@ -21,6 +21,7 @@ interface Size { export function TextArea(props: TextAreaProps) { const { contextualHelp, + "data-testid": dataTestId, errorMessage, fieldClassName, inputClassName, @@ -141,6 +142,7 @@ export function TextArea(props: TextAreaProps) { ; maxRows?: number; + "data-testid"?: string; }