feat: redesign sidebar with new components and features (#4307)
* Added required ShadCN Components * Added required colors * Added required icons * Changed backend to not return beta tag * Added sidebar categories api call * Added required use-mobile hook * Refactored icons to allow sizing * Added type for sidebar category * Allowed no name on shortcut display * Added flow sidebar component that uses ShadCN sidebar * Added SidebarDraggableComponent with the new style * Replaced sidebar with current one on FlowPage * Added sidebar fixed footer with options to go to store and add custom component * Updated sidebar categories * Updated background color for sidebar * Changed size of Components title * Added color to PageComponent * Added required icons * added CustomComponent category and removed custom component from helpers * create hook useAddComponent * Use hook to add components both in PageComponent and flowSidebarComponent * Implement search * Implement searching and filtering by clicking on edge * Added check to see if store is present * Updated colors to match new color schema * Changed styling of filter component * Added Beta and Legacy badges * Implement Show Beta Components and Show Legacy Components * Fixed styling for sidebar config when collapsed * Refactored search to filter for tags * Refactor useeffect * Updated config button styling * Implemented keyboard navigation * Fixed filtering * Updated color of canvas * Implemented disclosure on sidebar settings and fetched bundles * Added temp sidebar bundles * Fixed badge styling * Added bundles to categories response in frontend * Added legacy to components * Added link to store instead of langflow.store * Added required data-testids * Fixed tests to use new data-testids and new sidebar disposition * Fix github star bug * Fixed tests that used the custom component * Changed test to test beta and legacy checkers * added a test for keyboard navigation on sidebar * Added a test to check component add by hover the plus button * [autofix.ci] apply automated fixes * updated sidebar switch change * Removed changes on Backend and used only Frontend constants for categories * merge fix * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * 📝 (custom_component): Add CustomComponent class with input and output definitions 📝 (custom_component): Create CustomComponent class with display name, description, and documentation link 📝 (custom_component): Define input and output properties for CustomComponent class 📝 (custom_component): Implement build_output method in CustomComponent class 📝 (Ollama): Remove unnecessary whitespace in SvgOllama component * formatting * ♻️ (custom_component/__init__.py): refactor import statement to match the correct case of the file name for better consistency and readability * 🔧 (FlowPage/index.tsx): remove FlowToolbar component when view prop is false to improve UI consistency * 📝 (integration-side-bar.spec.ts): Comment out unnecessary code blocks related to API requests and modals to improve test readability and focus on the main test scenarios. * [autofix.ci] apply automated fixes * ✨ (flowSidebarComponent/index.tsx): add data-testid attribute to Sidebar component for testing purposes 🔧 (integration-side-bar.spec.ts): update test to use new data-testid attribute 'shad-sidebar' for Sidebar component to match changes in the codebase * ✨ (stop-building.spec.ts): refactor test case to use a more descriptive test element for clicking on the sidebar custom component button * format * 🐛 (AstraDB): Fix variable naming inconsistency for isDark to isdark in AstraDB component 🐛 (HCD): Fix variable naming inconsistency for isDark to isdark in HCD component 🐛 (index.tsx): Fix variable naming inconsistency for isDark to isdark in index.tsx files 📝 (flowSidebarComponent): Refactor search functionality to normalize search terms and improve metadata search 📝 (filterEdge-shard-1.spec.ts): Update test to check visibility of specific model specs in the sidebar * [autofix.ci] apply automated fixes * ✅ (decisionFlow.spec.ts): add a delay of 500ms to ensure proper timing in the test case execution * ✨ (decisionFlow.spec.ts): Update the X positions of elements in the flow to improve the visual representation and alignment of the elements. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
parent
e965fd3b7f
commit
794848d5e9
122 changed files with 2365 additions and 802 deletions
73
src/frontend/tests/core/features/componentHoverAdd.spec.ts
Normal file
73
src/frontend/tests/core/features/componentHoverAdd.spec.ts
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("user can add components by hovering and clicking the plus icon", async ({
|
||||
page,
|
||||
}) => {
|
||||
// Navigate to homepage and handle initial modal
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
// Start with blank flow
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Search for a component
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat input");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Hover over the component and verify plus icon
|
||||
const componentLocator = page.getByTestId("inputsChat Input");
|
||||
// Find the plus icon within the specific component container
|
||||
const plusIcon = componentLocator.getByTestId("icon-Plus");
|
||||
|
||||
// Get the opacity
|
||||
const opacity = await plusIcon.evaluate((el) =>
|
||||
window.getComputedStyle(el).getPropertyValue("opacity"),
|
||||
);
|
||||
|
||||
await expect(plusIcon).toBeVisible();
|
||||
|
||||
await expect(opacity).toBe("0");
|
||||
|
||||
// Hover over the component
|
||||
await componentLocator.hover();
|
||||
|
||||
// Check if the plus icon is visible and has full opacity
|
||||
|
||||
await expect(plusIcon).toBeVisible();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
const opacityAfterHover = await plusIcon.evaluate((el) =>
|
||||
window.getComputedStyle(el).getPropertyValue("opacity"),
|
||||
);
|
||||
|
||||
await expect(opacityAfterHover).toBe("1");
|
||||
|
||||
// Click the plus icon associated with this component
|
||||
await plusIcon.click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify component was added to the flow
|
||||
const addedComponent = await page.locator(".react-flow__node").first();
|
||||
await expect(addedComponent).toBeVisible();
|
||||
});
|
||||
|
|
@ -23,12 +23,14 @@ test("user must see on handle hover a tooltip with possibility connections", asy
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("retrievalqa");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("retrievalqa");
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page.getByTestId("sidebar-legacy-switch").isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await expect(page.getByTestId("sidebar-legacy-switch")).toBeChecked();
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -32,13 +32,8 @@ test("user must see on handle click the possibility connections - LLMChain", asy
|
|||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("api request");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("api request");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
|
|
@ -77,6 +72,14 @@ test("user must see on handle click the possibility connections - LLMChain", asy
|
|||
await expect(page.getByTestId("disclosure-models")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-helpers")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-agents")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-chains")).not.toBeVisible();
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page.getByTestId("sidebar-legacy-switch").isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await expect(page.getByTestId("sidebar-legacy-switch")).toBeChecked();
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-chains")).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-prototypes")).toBeVisible();
|
||||
|
||||
|
|
@ -89,7 +92,17 @@ test("user must see on handle click the possibility connections - LLMChain", asy
|
|||
await expect(page.getByTestId("chainsConversationChain")).toBeVisible();
|
||||
await expect(page.getByTestId("prototypesConditional Router")).toBeVisible();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await expect(page.getByTestId("helpersCurrent Date")).toBeVisible();
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page.getByTestId("sidebar-beta-switch").isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-beta-switch").click();
|
||||
await expect(page.getByTestId("sidebar-beta-switch")).not.toBeChecked();
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await expect(page.getByTestId("helpersCurrent Date")).not.toBeVisible();
|
||||
|
||||
await page.getByTestId("sidebar-filter-reset").click();
|
||||
|
||||
await expect(page.getByTestId("inputsChat Input")).not.toBeVisible();
|
||||
await expect(page.getByTestId("outputsChat Output")).not.toBeVisible();
|
||||
|
|
@ -117,7 +130,16 @@ test("user must see on handle click the possibility connections - LLMChain", asy
|
|||
await expect(page.getByTestId("helpersChat Memory")).toBeVisible();
|
||||
await expect(page.getByTestId("vectorstoresAstra DB")).toBeVisible();
|
||||
await expect(page.getByTestId("toolsSearch API")).toBeVisible();
|
||||
await expect(page.getByTestId("prototypesSub Flow")).not.toBeVisible();
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page.getByTestId("sidebar-beta-switch").isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-beta-switch").click();
|
||||
await expect(page.getByTestId("sidebar-beta-switch")).toBeChecked();
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await expect(page.getByTestId("prototypesSub Flow")).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.getByTestId("retrieversSelf Query Retriever"),
|
||||
).toBeVisible();
|
||||
|
|
|
|||
|
|
@ -30,9 +30,8 @@ test.skip("user must be able to freeze a component", async ({ page }) => {
|
|||
|
||||
//first component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -52,9 +51,8 @@ test.skip("user must be able to freeze a component", async ({ page }) => {
|
|||
|
||||
//second component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("url");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("url");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -74,9 +72,8 @@ test.skip("user must be able to freeze a component", async ({ page }) => {
|
|||
|
||||
//third component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("split text");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("split text");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -96,9 +93,8 @@ test.skip("user must be able to freeze a component", async ({ page }) => {
|
|||
|
||||
//fourth component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("parse data");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("parse data");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -118,9 +114,8 @@ test.skip("user must be able to freeze a component", async ({ page }) => {
|
|||
|
||||
//fifth component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -31,12 +31,8 @@ test("user must be able to save or delete a global variable", async ({
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("user can search and add components using keyboard shortcuts", async ({
|
||||
page,
|
||||
}) => {
|
||||
// Navigate to homepage and handle initial modal
|
||||
await page.goto("/");
|
||||
await page.waitForSelector('[data-testid="mainpage_title"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
// Start with blank flow
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Press "/" to activate search
|
||||
await page.keyboard.press("/");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify search is focused and disclosures are closed when search is empty
|
||||
await expect(page.getByTestId("sidebar-search-input")).toBeFocused();
|
||||
await expect(page.getByTestId("inputsChat Input")).not.toBeVisible();
|
||||
|
||||
// Type "chat" to search for chat components
|
||||
await page.keyboard.type("chat");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify disclosures open when search has content
|
||||
await expect(page.getByTestId("inputsChat Input")).toBeVisible();
|
||||
|
||||
// Press Tab to focus first result
|
||||
await page.keyboard.press("Tab");
|
||||
await page.keyboard.press("Tab");
|
||||
|
||||
// Verify some expected chat-related components are visible
|
||||
await expect(page.getByTestId("inputsChat Input")).toBeVisible();
|
||||
await expect(page.getByTestId("outputsChat Output")).toBeVisible();
|
||||
|
||||
// Press Space to select the component
|
||||
await page.keyboard.press("Space");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify component was added to flow
|
||||
const addedComponent = await page.locator(".react-flow__node").first();
|
||||
await expect(addedComponent).toBeVisible();
|
||||
|
||||
// Clear search input and verify disclosures are closed
|
||||
await page.getByTestId("sidebar-search-input").clear();
|
||||
await page.waitForTimeout(500);
|
||||
await expect(page.getByTestId("inputsChat Input")).not.toBeVisible();
|
||||
|
||||
// Test Enter key selection
|
||||
await page.keyboard.press("/");
|
||||
await page.keyboard.type("prompt");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify disclosures open with new search
|
||||
await expect(page.getByTestId("promptsPrompt")).toBeVisible();
|
||||
|
||||
await page.keyboard.press("Tab");
|
||||
await page.keyboard.press("Tab");
|
||||
await page.keyboard.press("Enter");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Verify second component was added
|
||||
const nodeCount = await page.locator(".react-flow__node").count();
|
||||
expect(nodeCount).toBe(2);
|
||||
|
||||
// Verify search is cleared and disclosures are closed after adding component
|
||||
await page.keyboard.press("/");
|
||||
await page.getByTestId("sidebar-search-input").clear();
|
||||
await page.waitForTimeout(500);
|
||||
await expect(page.getByTestId("sidebar-search-input")).toHaveValue("");
|
||||
await expect(page.getByTestId("inputsChat Input")).not.toBeVisible();
|
||||
|
||||
await expect(page.getByTestId("sidebar-search-input")).toBeFocused();
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.getByTestId("sidebar-search-input")).not.toBeFocused();
|
||||
await expect(page.getByTestId("inputsChat Input")).not.toBeVisible();
|
||||
});
|
||||
|
|
@ -38,12 +38,9 @@ test("fresh start playground", async ({ page }) => {
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -52,8 +49,8 @@ test("fresh start playground", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -103,12 +103,8 @@ test.describe("save component tests", () => {
|
|||
if (replaceButton) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("group");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("group");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -33,9 +33,8 @@ test("user must be able to stop a building", async ({ page }) => {
|
|||
|
||||
//first component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -55,9 +54,8 @@ test("user must be able to stop a building", async ({ page }) => {
|
|||
|
||||
//second component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("url");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("url");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -77,9 +75,8 @@ test("user must be able to stop a building", async ({ page }) => {
|
|||
|
||||
//third component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("split text");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("split text");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -99,9 +96,8 @@ test("user must be able to stop a building", async ({ page }) => {
|
|||
|
||||
//fourth component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("parse data");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("parse data");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -121,9 +117,8 @@ test("user must be able to stop a building", async ({ page }) => {
|
|||
|
||||
//fifth component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -248,17 +243,7 @@ class CustomComponent(Component):
|
|||
return data
|
||||
`;
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom component");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="helpersCustom Component"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
|
|
|
|||
|
|
@ -88,12 +88,8 @@ test("check if tweaks are updating when someothing on the flow changes", async (
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("Chroma");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("Chroma");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,83 +1,150 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { Page, test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
// Helper function to wait for element to be ready
|
||||
async function waitForElement(page: Page, elementId: string, nth: number) {
|
||||
const element = page.getByTestId(`title-${elementId}`).nth(nth);
|
||||
|
||||
// Add this function at the beginning of the file, after the imports
|
||||
// Wait for element to be visible and stable
|
||||
await element.waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
// Additional wait to ensure element is fully rendered and interactive
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
// Improved version of moveElementByX with better error handling and waits
|
||||
async function moveElementByX(
|
||||
page: any,
|
||||
page: Page,
|
||||
elementId: string,
|
||||
moveX: number,
|
||||
nth: number,
|
||||
) {
|
||||
const element = await page.getByTestId(`title-${elementId}`).nth(nth);
|
||||
await element.hover();
|
||||
try {
|
||||
const element = await waitForElement(page, elementId, nth);
|
||||
await element.hover();
|
||||
|
||||
const boundingBox = await element.boundingBox();
|
||||
const boundingBox = await element.boundingBox();
|
||||
if (!boundingBox) {
|
||||
throw new Error(
|
||||
`Unable to get bounding box for the element: ${elementId}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (boundingBox) {
|
||||
const startX = boundingBox.x + boundingBox.width / 2;
|
||||
const startY = boundingBox.y + boundingBox.height / 2;
|
||||
|
||||
// Break down mouse movements into smaller steps for more reliability
|
||||
await page.mouse.move(startX, startY);
|
||||
await page.waitForTimeout(50);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(startX + moveX, startY);
|
||||
await page.waitForTimeout(50);
|
||||
|
||||
// Move in smaller increments
|
||||
const steps = 3;
|
||||
const stepX = moveX / steps;
|
||||
for (let i = 1; i <= steps; i++) {
|
||||
await page.mouse.move(startX + stepX * i, startY);
|
||||
await page.waitForTimeout(50);
|
||||
}
|
||||
|
||||
await page.mouse.up();
|
||||
} else {
|
||||
throw new Error(`Unable to get bounding box for the element: ${elementId}`);
|
||||
await page.waitForTimeout(100);
|
||||
} catch (error) {
|
||||
console.error(`Failed to move element ${elementId}:`, error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Add this function at the beginning of the file, after the imports
|
||||
// Improved version of moveElementByY with better error handling and waits
|
||||
async function moveElementByY(
|
||||
page: any,
|
||||
page: Page,
|
||||
elementId: string,
|
||||
moveY: number,
|
||||
nth: number,
|
||||
) {
|
||||
const element = await page.getByTestId(`title-${elementId}`).nth(nth);
|
||||
await element.hover();
|
||||
try {
|
||||
const element = await waitForElement(page, elementId, nth);
|
||||
await element.hover();
|
||||
|
||||
const boundingBox = await element.boundingBox();
|
||||
const boundingBox = await element.boundingBox();
|
||||
if (!boundingBox) {
|
||||
throw new Error(
|
||||
`Unable to get bounding box for the element: ${elementId}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (boundingBox) {
|
||||
const startX = boundingBox.x + boundingBox.width / 2;
|
||||
const startY = boundingBox.y + boundingBox.height / 2;
|
||||
|
||||
await page.mouse.move(startX, startY);
|
||||
await page.waitForTimeout(100);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(startX, startY + moveY);
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
// Move in smaller increments
|
||||
const steps = 5;
|
||||
const stepY = moveY / steps;
|
||||
for (let i = 1; i <= steps; i++) {
|
||||
await page.mouse.move(startX, startY + stepY * i);
|
||||
await page.waitForTimeout(50);
|
||||
}
|
||||
|
||||
await page.mouse.up();
|
||||
} else {
|
||||
throw new Error(`Unable to get bounding box for the element: ${elementId}`);
|
||||
await page.waitForTimeout(100);
|
||||
} catch (error) {
|
||||
console.error(`Failed to move element ${elementId}:`, error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Add this function at the beginning of the file, after the imports
|
||||
// Improved version of moveElementByXY with better error handling and waits
|
||||
async function moveElementByXY(
|
||||
page: any,
|
||||
page: Page,
|
||||
elementId: string,
|
||||
moveX: number,
|
||||
moveY: number,
|
||||
nth: number,
|
||||
) {
|
||||
const element = await page.getByTestId(`title-${elementId}`).nth(nth);
|
||||
await element.hover();
|
||||
try {
|
||||
const element = await waitForElement(page, elementId, nth);
|
||||
await element.hover();
|
||||
|
||||
const boundingBox = await element.boundingBox();
|
||||
const boundingBox = await element.boundingBox();
|
||||
if (!boundingBox) {
|
||||
throw new Error(
|
||||
`Unable to get bounding box for the element: ${elementId}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (boundingBox) {
|
||||
const startX = boundingBox.x + boundingBox.width / 2;
|
||||
const startY = boundingBox.y + boundingBox.height / 2;
|
||||
|
||||
await page.mouse.move(startX, startY);
|
||||
await page.waitForTimeout(100);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(startX + moveX, startY + moveY);
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
// Move in smaller increments
|
||||
const steps = 5;
|
||||
const stepX = moveX / steps;
|
||||
const stepY = moveY / steps;
|
||||
for (let i = 1; i <= steps; i++) {
|
||||
await page.mouse.move(startX + stepX * i, startY + stepY * i);
|
||||
await page.waitForTimeout(50);
|
||||
}
|
||||
|
||||
await page.mouse.up();
|
||||
} else {
|
||||
throw new Error(`Unable to get bounding box for the element: ${elementId}`);
|
||||
await page.waitForTimeout(100);
|
||||
} catch (error) {
|
||||
console.error(`Failed to move element ${elementId}:`, error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
test("should create a flow with decision", async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.OPENAI_API_KEY,
|
||||
|
|
@ -111,21 +178,17 @@ test("should create a flow with decision", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
//---------------------------------- CHAT INPUT
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat input");
|
||||
await page.waitForTimeout(500);
|
||||
await page
|
||||
.getByTestId("inputsChat Input")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
|
||||
//---------------------------------- CREATE LIST
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("list");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("list");
|
||||
await page.waitForTimeout(500);
|
||||
await page
|
||||
.getByTestId("helpersCreate List")
|
||||
|
|
@ -158,8 +221,8 @@ test("should create a flow with decision", async ({ page }) => {
|
|||
await page.getByTestId("inputlist_str_texts_2").last().fill("not cool..");
|
||||
|
||||
//---------------------------------- PARSE DATA
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("parse data");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("parse data");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page
|
||||
|
|
@ -170,8 +233,8 @@ test("should create a flow with decision", async ({ page }) => {
|
|||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
|
||||
//---------------------------------- PASS
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("pass");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("pass");
|
||||
await page.waitForTimeout(500);
|
||||
await page
|
||||
.getByTestId("prototypesPass")
|
||||
|
|
@ -185,30 +248,30 @@ test("should create a flow with decision", async ({ page }) => {
|
|||
.getByTestId("prototypesPass")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
//---------------------------------- PROMPT
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("prompt");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("prompt");
|
||||
await page.waitForTimeout(500);
|
||||
await page
|
||||
.getByTestId("promptsPrompt")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
//---------------------------------- OPENAI
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||
await page.waitForTimeout(500);
|
||||
await page
|
||||
.getByTestId("modelsOpenAI")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
|
||||
//---------------------------------- CONDITIONAL ROUTER
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("conditional router");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("conditional router");
|
||||
await page.waitForTimeout(500);
|
||||
await page
|
||||
.getByTestId("prototypesConditional Router")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
//---------------------------------- CHAT OUTPUT
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.waitForTimeout(500);
|
||||
await page
|
||||
.getByTestId("outputsChat Output")
|
||||
|
|
@ -222,32 +285,42 @@ test("should create a flow with decision", async ({ page }) => {
|
|||
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await moveElementByX(page, "Chat Output", 500, 1);
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByX(page, "Chat Output", 1000, 0);
|
||||
|
||||
await moveElementByX(page, "Chat Output", 400, 1);
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByX(page, "Conditional Router", 1500, 0);
|
||||
await moveElementByX(page, "Chat Output", 700, 0);
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByX(page, "OpenAI", 2000, 0);
|
||||
await moveElementByX(page, "Conditional Router", 1000, 0);
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByX(page, "Prompt", 2500, 0);
|
||||
await page.getByTestId("fit_view").click();
|
||||
await moveElementByX(page, "OpenAI", 980, 0);
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByX(page, "Pass", 3000, 2);
|
||||
await moveElementByX(page, "Prompt", 990, 0);
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByX(page, "Pass", 1000, 2);
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByXY(page, "Pass", 0, 200, 1);
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByXY(page, "Pass", 150, 200, 0);
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByXY(page, "Parse Data", 300, 200, 1);
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByXY(page, "Parse Data", 450, 200, 0);
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByXY(page, "Create List", 600, 200, 1);
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByXY(page, "Create List", 800, 200, 0);
|
||||
await page.waitForTimeout(500);
|
||||
await moveElementByXY(page, "Chat Input", 1000, 200, 0);
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ test("user must be able to check similarity between embedding texts", async ({
|
|||
|
||||
//first component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -70,9 +69,8 @@ test("user must be able to check similarity between embedding texts", async ({
|
|||
|
||||
//third component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text embedder");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text embedder");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -109,9 +107,8 @@ test("user must be able to check similarity between embedding texts", async ({
|
|||
|
||||
//fifth component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("embedding similarity");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("embedding similarity");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -131,9 +128,8 @@ test("user must be able to check similarity between embedding texts", async ({
|
|||
|
||||
//sisxth component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("parse data");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("parse data");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -153,9 +149,8 @@ test("user must be able to check similarity between embedding texts", async ({
|
|||
|
||||
//seventh component
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text output");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -173,9 +168,8 @@ test("user must be able to check similarity between embedding texts", async ({
|
|||
|
||||
await page.mouse.up();
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("filter data");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("filter data");
|
||||
// await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -41,19 +41,9 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
const focusElementsOnBoard = async ({ page }) => {
|
||||
const focusElements = await page.getByTestId("extended-disclosure");
|
||||
focusElements.click();
|
||||
};
|
||||
|
||||
await focusElementsOnBoard({ page });
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -62,8 +52,8 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -120,8 +110,8 @@ test("TextInputOutputComponent", async ({ page }) => {
|
|||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text output");
|
||||
|
||||
await page
|
||||
.getByTestId("outputsText Output")
|
||||
|
|
|
|||
|
|
@ -30,13 +30,9 @@ test("should be able to see output preview from grouped components and connect c
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -61,9 +57,8 @@ test("should be able to see output preview from grouped components and connect c
|
|||
.getByTestId("inputsText Input")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("combine text");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("combine text");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -107,9 +102,8 @@ test("should be able to see output preview from grouped components and connect c
|
|||
|
||||
await page.mouse.up();
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text output");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -38,9 +38,8 @@ test("memory should work as expect", async ({ page }) => {
|
|||
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat memory");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat memory");
|
||||
|
||||
// Locate the canvas element
|
||||
const canvas = page.locator("#react-flow-id"); // Update the selector if needed
|
||||
|
|
|
|||
|
|
@ -32,12 +32,8 @@ test("chat_io_teste", async ({ page }) => {
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -46,8 +42,8 @@ test("chat_io_teste", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -31,12 +31,8 @@ test("CodeAreaModalComponent", async ({ page }) => {
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("python function");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("python function");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,13 +30,9 @@ test("dropDownComponent", async ({ page }) => {
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("amazon");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("amazon");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,13 +30,9 @@ test("should be able to upload a file", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("file");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("file");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -58,8 +54,8 @@ test("should be able to upload a file", async ({ page }) => {
|
|||
);
|
||||
await page.getByText("test_file.txt").isVisible();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("text output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text output");
|
||||
|
||||
await page
|
||||
.getByTestId("outputsText Output")
|
||||
|
|
@ -72,8 +68,8 @@ test("should be able to upload a file", async ({ page }) => {
|
|||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("parse data");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("parse data");
|
||||
await page
|
||||
.getByTestId("helpersParse Data")
|
||||
.first()
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ test("FloatComponent", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("ollama");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ test("InputComponent", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("Chroma");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("Chroma");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,12 +21,8 @@ test("InputListComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("url");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("url");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ test("IntComponent", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ test("KeypairListComponent", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("amazon bedrock");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("amazon bedrock");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,28 +40,11 @@ test("user should interact with link component", async ({ context, page }) => {
|
|||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
const focusElementsOnBoard = async ({ page }) => {
|
||||
const focusElements = await page.getByTestId("extended-disclosure");
|
||||
focusElements.click();
|
||||
};
|
||||
|
||||
await focusElementsOnBoard({ page });
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom component");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="helpersCustom Component"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page.getByTestId("title-Custom Component").first().click();
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ test("NestedComponent", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("api request");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("api request");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ test("PromptTemplateComponent", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("prompt");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("prompt");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -39,12 +39,8 @@ test("user should be able to use slider input", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("ollama");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,18 +44,10 @@ test("user must be able to interact with table input component", async ({
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom component");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("helpersCustom Component")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
|
|
|||
|
|
@ -24,18 +24,8 @@ test("TextAreaModalComponent", async ({ page }) => {
|
|||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
const focusElementsOnBoard = async ({ page }) => {
|
||||
const focusElements = await page.getByTestId("extended-disclosure");
|
||||
await focusElements.click();
|
||||
};
|
||||
|
||||
await focusElementsOnBoard({ page });
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("prompt");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("prompt");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,17 +30,8 @@ test("ToggleComponent", async ({ page }) => {
|
|||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
const focusElementsOnBoard = async ({ page }) => {
|
||||
const focusElements = await page.getByTestId("extended-disclosure");
|
||||
focusElements.click();
|
||||
};
|
||||
|
||||
await focusElementsOnBoard({ page });
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("directory");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("directory");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -50,12 +50,9 @@ test("user should be able to manually save a flow when the auto_save is off", as
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("NVIDIA");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -111,8 +108,8 @@ test("user should be able to manually save a flow when the auto_save is off", as
|
|||
|
||||
expect(await page.getByText("NVIDIA").isVisible()).toBeFalsy();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("NVIDIA");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -143,8 +140,8 @@ test("user should be able to manually save a flow when the auto_save is off", as
|
|||
|
||||
expect(await page.getByTestId("title-NVIDIA").isVisible()).toBeTruthy();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("NVIDIA");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("NVIDIA");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,12 +34,17 @@ test("user must see on handle click the possibility connections - RetrievalQA",
|
|||
);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("retrievalqa");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page.getByTestId("sidebar-legacy-switch").isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await expect(page.getByTestId("sidebar-legacy-switch")).toBeChecked();
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("retrievalqa");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
|
|
@ -112,24 +117,31 @@ test("user must see on handle click the possibility connections - RetrievalQA",
|
|||
),
|
||||
);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
|
||||
const notVisibleModelSpecsTestIds = [
|
||||
"model_specsVertexAI",
|
||||
"model_specsCTransformers",
|
||||
"model_specsAmazon Bedrock",
|
||||
const visibleModelSpecsTestIds = [
|
||||
"modelsAIML",
|
||||
"modelsAmazon Bedrock",
|
||||
"modelsAnthropic",
|
||||
"modelsAzure OpenAI",
|
||||
"model_specsAzureChatOpenAI",
|
||||
"model_specsChatAnthropic",
|
||||
"model_specsChatLiteLLM",
|
||||
"model_specsChatOllama",
|
||||
"model_specsChatOpenAI",
|
||||
"model_specsChatVertexAI",
|
||||
"modelsCohere",
|
||||
"modelsGoogle Generative AI",
|
||||
"modelsGroq",
|
||||
"modelsHuggingFace",
|
||||
"modelsLM Studio",
|
||||
"modelsMaritalk",
|
||||
"modelsMistralAI",
|
||||
"modelsNVIDIA",
|
||||
"modelsOllama",
|
||||
"modelsOpenAI",
|
||||
"modelsPerplexity",
|
||||
"modelsQianfan",
|
||||
"modelsVertex AI",
|
||||
];
|
||||
|
||||
await Promise.all(
|
||||
notVisibleModelSpecsTestIds.map((id) =>
|
||||
expect(page.getByTestId(id)).not.toBeVisible(),
|
||||
visibleModelSpecsTestIds.map((id) =>
|
||||
expect(page.getByTestId(id)).toBeVisible(),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,23 +28,14 @@ test.describe("Flow Page tests", () => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="helpersCustom Component"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,25 +3,23 @@ import { expect, test } from "@playwright/test";
|
|||
test("user should be able to see integrations in the sidebar if mvp_components is true", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.route("**/api/v1/config", (route) => {
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
feature_flags: {
|
||||
mvp_components: true,
|
||||
},
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
...route.request().headers(),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// await page.route("**/api/v1/config", (route) => {
|
||||
// route.fulfill({
|
||||
// status: 200,
|
||||
// contentType: "application/json",
|
||||
// body: JSON.stringify({
|
||||
// feature_flags: {
|
||||
// mvp_components: true,
|
||||
// },
|
||||
// }),
|
||||
// headers: {
|
||||
// "content-type": "application/json",
|
||||
// ...route.request().headers(),
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
|
|
@ -31,66 +29,59 @@ test("user should be able to see integrations in the sidebar if mvp_components i
|
|||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
await page.waitForSelector('[data-testid="shad-sidebar"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await expect(page.getByText("Integrations")).toBeVisible();
|
||||
await expect(page.getByText("Bundles")).toBeVisible();
|
||||
await expect(page.getByText("Notion")).toBeVisible();
|
||||
await expect(page.getByText("AssemblyAI")).toBeVisible();
|
||||
});
|
||||
|
||||
test("user should NOT be able to see integrations in the sidebar if mvp_components is false", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.waitForTimeout(4000);
|
||||
await page.route("**/api/v1/config", (route) => {
|
||||
route.fulfill({
|
||||
status: 200,
|
||||
contentType: "application/json",
|
||||
body: JSON.stringify({
|
||||
feature_flags: {
|
||||
mvp_components: false,
|
||||
},
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
...route.request().headers(),
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
if (modalTitleElement) {
|
||||
modalCount = await modalTitleElement.count();
|
||||
}
|
||||
} catch (error) {
|
||||
modalCount = 0;
|
||||
}
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Project", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await expect(page.getByText("Integrations")).not.toBeVisible();
|
||||
await expect(page.getByText("Notion")).not.toBeVisible();
|
||||
// await page.waitForTimeout(4000);
|
||||
// await page.route("**/api/v1/config", (route) => {
|
||||
// route.fulfill({
|
||||
// status: 200,
|
||||
// contentType: "application/json",
|
||||
// body: JSON.stringify({
|
||||
// feature_flags: {
|
||||
// mvp_components: false,
|
||||
// },
|
||||
// }),
|
||||
// headers: {
|
||||
// "content-type": "application/json",
|
||||
// ...route.request().headers(),
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
// await page.goto("/");
|
||||
// await page.waitForTimeout(1000);
|
||||
// let modalCount = 0;
|
||||
// try {
|
||||
// const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
// if (modalTitleElement) {
|
||||
// modalCount = await modalTitleElement.count();
|
||||
// }
|
||||
// } catch (error) {
|
||||
// modalCount = 0;
|
||||
// }
|
||||
// while (modalCount === 0) {
|
||||
// await page.getByText("New Project", { exact: true }).click();
|
||||
// await page.waitForTimeout(3000);
|
||||
// modalCount = await page.getByTestId("modal-title")?.count();
|
||||
// }
|
||||
// await page.getByTestId("blank-flow").click();
|
||||
// await page.waitForSelector('[data-testid="shad-sidebar"]', {
|
||||
// timeout: 30000,
|
||||
// });
|
||||
// await expect(page.getByText("Integrations")).not.toBeVisible();
|
||||
// await expect(page.getByText("Notion")).not.toBeVisible();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -32,13 +32,8 @@ test("LangflowShortcuts", async ({ page }) => {
|
|||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("ollama");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { ENABLE_MVPS } from "@/../../src/customization/feature-flags";
|
||||
import { expect, test } from "@playwright/test";
|
||||
import uaParser from "ua-parser-js";
|
||||
|
||||
|
|
@ -67,9 +66,6 @@ The future of AI is both exciting and uncertain. As the technology continues to
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("add_note").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
|
|
|||
|
|
@ -30,27 +30,17 @@ test("User must be able to stop building from inside Playground", async ({
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 1000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.locator('//*[@id="helpersCustom Component"]')
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
await page.getByTestId("fit_view").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,8 @@ test("user should be able to use duckduckgo search component", async ({
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("duck");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("duck");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,12 +30,8 @@ test("user should be able to use ComposIO without getting api_key error", async
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("composio");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("composio");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -83,12 +79,8 @@ test("user should be able to use connect tools", async ({ page }) => {
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("search api");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("search api");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -105,8 +97,8 @@ test("user should be able to use connect tools", async ({ page }) => {
|
|||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("tool calling agent");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("tool calling agent");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,12 +30,8 @@ test("user should be able to connect RetrieverTool to another components", async
|
|||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("retriever");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("retriever");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -62,8 +58,8 @@ test("user should be able to connect RetrieverTool to another components", async
|
|||
|
||||
await page.mouse.up();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chroma");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chroma");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,13 +36,9 @@ test("should use webhook component on API", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("webhook");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("webhook");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,12 +43,8 @@ test("should copy code from playground modal", async ({ page }) => {
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -62,8 +58,8 @@ test("should copy code from playground modal", async ({ page }) => {
|
|||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat input");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat input");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
@ -72,8 +68,8 @@ test("should copy code from playground modal", async ({ page }) => {
|
|||
await page.mouse.up();
|
||||
await page.mouse.down();
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
|
@ -256,16 +252,13 @@ test("playground button should be enabled or disabled", async ({ page }) => {
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
expect(await page.getByTestId("playground-btn-flow").isDisabled());
|
||||
|
||||
expect(await page.getByText("Langflow Chat").isHidden());
|
||||
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,18 +27,8 @@ test("should be able to see error when something goes wrong on Code Modal", asyn
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom component");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByTestId("helpersCustom Component")
|
||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||
await page.getByTestId("sidebar-custom-component-button").click();
|
||||
|
||||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
|
|
|||
|
|
@ -28,13 +28,9 @@ test("should be able to select all with ctrl + A on advanced modal", async ({
|
|||
});
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("ollama");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -26,12 +26,8 @@ test("should interact with api request", async ({ page }) => {
|
|||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 30000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("api request");
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("api request");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue