feat: deprecate Parsing component and replace them in starter projects (#6697)
* fix: fixed the parser component * fix: fixed parser component test * fix: ruff error * chore: rename input * chore: remove beta attribute * update * updated template with legacy as true * updated templates * [autofix.ci] apply automated fixes * ✨ (freeze.spec.ts): add new test steps to check sidebar options and legacy switch functionality ✨ (similarity.spec.ts): add new test steps to check sidebar options and legacy switch functionality ✨ (loop-component.spec.ts): add new test steps to check sidebar options and legacy switch functionality, as well as zoom out and expand button modal functionality * remove-copy-numbers-from-template-titles * update-blog-writer-template-readme * update-document-qa-template-notes * update-market-research-template-notes * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * ✨ (filterEdge-shard-0.spec.ts, freeze.spec.ts, Portfolio Website Code Generator.spec.ts, decisionFlow.spec.ts, similarity.spec.ts, generalBugs-shard-9.spec.ts, codeAreaModalComponent.spec.ts, fileUploadComponent.spec.ts, nestedComponent.spec.ts, filterEdge-shard-1.spec.ts, loop-component.spec.ts, generalBugs-shard-12.spec.ts, add-legacy-components.ts): add function to handle legacy components in tests for improved test readability and maintainability * remove duplicated graph rag template * update changes * update Templates with new parser component * [autofix.ci] apply automated fixes * fix: remove name attribute * fix: autofix.ci patch * ✨ (stop-building.spec.ts): add new function addLegacyComponents to include legacy components in the test scenario 🔧 (decisionFlow.spec.ts): increase timeout from 500ms to 2000ms for better stability and reliability in waiting for selectors to appear --------- Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl <cristhian.lousa@gmail.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
This commit is contained in:
parent
85787cf53e
commit
017a0a463b
27 changed files with 4022 additions and 3811 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { adjustScreenView } from "../../utils/adjust-screen-view";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
|
||||
|
|
@ -12,13 +13,7 @@ test(
|
|||
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 addLegacyComponents(page);
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { zoomOut } from "../../utils/zoom-out";
|
||||
|
||||
|
|
@ -11,8 +12,9 @@ test(
|
|||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
//first component
|
||||
await addLegacyComponents(page);
|
||||
|
||||
//first component
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("text input");
|
||||
await page.waitForSelector('[data-testid="inputsText Input"]', {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { removeOldApiKeys } from "../../utils/remove-old-api-keys";
|
||||
import { updateOldComponents } from "../../utils/update-old-components";
|
||||
|
|
@ -11,6 +12,8 @@ test(
|
|||
await awaitBootstrapTest(page);
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await addLegacyComponents(page);
|
||||
|
||||
//first component
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ withEventDeliveryModes(
|
|||
|
||||
expect(concatAllText.length).toBeGreaterThan(200);
|
||||
|
||||
expect(concatAllText).toContain("div");
|
||||
expect(concatAllText).toContain("class=");
|
||||
expect(concatAllText).toContain("html");
|
||||
expect(concatAllText).toContain("body");
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { zoomOut } from "../../utils/zoom-out";
|
||||
|
||||
|
|
@ -23,17 +24,13 @@ test(
|
|||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page
|
||||
.getByTestId("sidebar-legacy-switch")
|
||||
.isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await addLegacyComponents(page);
|
||||
|
||||
//---------------------------------- CHAT INPUT
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat input");
|
||||
await page.waitForSelector('[data-testid="inputsChat Input"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
|
||||
await zoomOut(page, 6);
|
||||
|
|
@ -48,7 +45,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("list");
|
||||
await page.waitForSelector('[data-testid="helpersCreate List"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("helpersCreate List")
|
||||
|
|
@ -97,7 +94,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("data to message");
|
||||
await page.waitForSelector('[data-testid="processingData to Message"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("processingData to Message")
|
||||
|
|
@ -114,7 +111,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("pass");
|
||||
await page.waitForSelector('[data-testid="logicPass"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("logicPass")
|
||||
|
|
@ -122,13 +119,13 @@ test(
|
|||
targetPosition: { x: 800, y: 100 },
|
||||
});
|
||||
await page.waitForSelector('[data-testid="logicPass"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
//---------------------------------- PASS
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("pass");
|
||||
await page.waitForSelector('[data-testid="logicPass"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("logicPass")
|
||||
|
|
@ -136,13 +133,13 @@ test(
|
|||
targetPosition: { x: 50, y: 200 },
|
||||
});
|
||||
await page.waitForSelector('[data-testid="logicPass"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
//---------------------------------- PASS
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("pass");
|
||||
await page.waitForSelector('[data-testid="logicPass"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("logicPass")
|
||||
|
|
@ -150,13 +147,13 @@ test(
|
|||
targetPosition: { x: 200, y: 300 },
|
||||
});
|
||||
await page.waitForSelector('[data-testid="logicPass"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
//---------------------------------- PROMPT
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("prompt");
|
||||
await page.waitForSelector('[data-testid="promptsPrompt"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("promptsPrompt")
|
||||
|
|
@ -168,7 +165,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||
await page.waitForSelector('[data-testid="modelsOpenAI"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("modelsOpenAI")
|
||||
|
|
@ -180,7 +177,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("if else");
|
||||
await page.waitForSelector('[data-testid="logicIf-Else"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("logicIf-Else")
|
||||
|
|
@ -191,7 +188,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.waitForSelector('[data-testid="outputsChat Output"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("outputsChat Output")
|
||||
|
|
@ -199,13 +196,13 @@ test(
|
|||
targetPosition: { x: 800, y: 300 },
|
||||
});
|
||||
await page.waitForSelector('[data-testid="outputsChat Output"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
//---------------------------------- CHAT OUTPUT
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("chat output");
|
||||
await page.waitForSelector('[data-testid="outputsChat Output"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
await page
|
||||
.getByTestId("outputsChat Output")
|
||||
|
|
@ -213,7 +210,7 @@ test(
|
|||
targetPosition: { x: 800, y: 400 },
|
||||
});
|
||||
await page.waitForSelector('[data-testid="outputsChat Output"]', {
|
||||
timeout: 500,
|
||||
timeout: 2000,
|
||||
});
|
||||
//----------------------------------
|
||||
await page.getByTestId("fit_view").click();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { updateOldComponents } from "../../utils/update-old-components";
|
||||
import { zoomOut } from "../../utils/zoom-out";
|
||||
|
|
@ -16,7 +17,10 @@ test(
|
|||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await addLegacyComponents(page);
|
||||
|
||||
//first component
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("openai embedding");
|
||||
await page.waitForSelector("text=OpenAI Embeddings", {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { initialGPTsetup } from "../../utils/initialGPTsetup";
|
||||
test(
|
||||
|
|
@ -28,11 +29,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("message history");
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page
|
||||
.getByTestId("sidebar-legacy-switch")
|
||||
.isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await addLegacyComponents(page);
|
||||
|
||||
// Locate the canvas element
|
||||
const canvas = page.locator("#react-flow-id"); // Update the selector if needed
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
|
||||
test(
|
||||
|
|
@ -19,11 +20,7 @@ test(
|
|||
timeout: 3000,
|
||||
});
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
await page
|
||||
.getByTestId("sidebar-legacy-switch")
|
||||
.isVisible({ timeout: 5000 });
|
||||
await page.getByTestId("sidebar-legacy-switch").click();
|
||||
await addLegacyComponents(page);
|
||||
|
||||
await page.waitForSelector('[data-testid="prototypesPython Function"]', {
|
||||
timeout: 3000,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { adjustScreenView } from "../../utils/adjust-screen-view";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { generateRandomFilename } from "../../utils/generate-filename";
|
||||
|
|
@ -29,6 +30,8 @@ test(
|
|||
});
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await addLegacyComponents(page);
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("file");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { adjustScreenView } from "../../utils/adjust-screen-view";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
|
||||
|
|
@ -15,13 +16,7 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("alter metadata");
|
||||
|
||||
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 addLegacyComponents(page);
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { adjustScreenView } from "../../utils/adjust-screen-view";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
|
||||
|
|
@ -14,14 +15,7 @@ test(
|
|||
timeout: 3000,
|
||||
});
|
||||
|
||||
await page.getByTestId("sidebar-options-trigger").click();
|
||||
|
||||
await expect(page.getByTestId("sidebar-legacy-switch")).toBeVisible({
|
||||
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 addLegacyComponents(page);
|
||||
|
||||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("retrievalqa");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { zoomOut } from "../../utils/zoom-out";
|
||||
|
||||
|
|
@ -9,6 +10,8 @@ test(
|
|||
await awaitBootstrapTest(page);
|
||||
await page.getByTestId("blank-flow").click();
|
||||
|
||||
await addLegacyComponents(page);
|
||||
|
||||
await page.waitForSelector(
|
||||
'[data-testid="sidebar-custom-component-button"]',
|
||||
{
|
||||
|
|
@ -146,13 +149,23 @@ test(
|
|||
.first()
|
||||
.click();
|
||||
|
||||
await zoomOut(page, 4);
|
||||
|
||||
await page.getByTestId("div-generic-node").nth(5).click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.waitForSelector('[data-testid="more-options-modal"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("more-options-modal").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.waitForSelector('[data-testid="expand-button-modal"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("expand-button-modal").click();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { addLegacyComponents } from "../../utils/add-legacy-components";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
|
||||
test(
|
||||
|
|
@ -18,13 +19,7 @@ test(
|
|||
timeout: 30000,
|
||||
});
|
||||
|
||||
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 addLegacyComponents(page);
|
||||
|
||||
let modelElement = await page.getByTestId(
|
||||
"langchain_utilitiesRetrieverTool",
|
||||
|
|
|
|||
9
src/frontend/tests/utils/add-legacy-components.ts
Normal file
9
src/frontend/tests/utils/add-legacy-components.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { expect, Page } from "playwright/test";
|
||||
|
||||
export const addLegacyComponents = async (page: Page) => {
|
||||
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();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue