Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/client/cypress/support/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
56 changes: 56 additions & 0 deletions app/client/cypress/support/Pages/AggregateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}
}
7 changes: 5 additions & 2 deletions app/client/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -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, {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions app/client/cypress/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ module.exports = {
"@tag.Workspace",
"@tag.airgap",
"@tag.excludeForAirgap",
"@tag.AIAgents",
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface Size {
export function TextArea(props: TextAreaProps) {
const {
contextualHelp,
"data-testid": dataTestId,
errorMessage,
fieldClassName,
inputClassName,
Expand Down Expand Up @@ -141,6 +142,7 @@ export function TextArea(props: TextAreaProps) {
</FieldLabel>
<TextAreaInput
className={inputClassName}
data-testid={dataTestId}
isLoading={isLoading}
isReadOnly={isReadOnly}
ref={inputRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export interface TextAreaProps extends AriaTextFieldProps, FieldProps {
inputClassName?: string;
size?: Exclude<keyof typeof SIZES, "xSmall">;
maxRows?: number;
"data-testid"?: string;
}
Loading