diff --git a/src/frontend/src/components/pageLayout/index.tsx b/src/frontend/src/components/pageLayout/index.tsx index fb10f9550..8d045e572 100644 --- a/src/frontend/src/components/pageLayout/index.tsx +++ b/src/frontend/src/components/pageLayout/index.tsx @@ -20,7 +20,10 @@ export default function PageLayout({
-

+

{title} {betaIcon && BETA}

diff --git a/src/frontend/tests/end-to-end/Basic Prompting.spec.ts b/src/frontend/tests/end-to-end/Basic Prompting.spec.ts index 8ee74c544..fbeb7d81f 100644 --- a/src/frontend/tests/end-to-end/Basic Prompting.spec.ts +++ b/src/frontend/tests/end-to-end/Basic Prompting.spec.ts @@ -13,7 +13,13 @@ test("Basic Prompting (Hello, World)", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -57,7 +63,7 @@ test("Basic Prompting (Hello, World)", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); await page.waitForSelector("text=built successfully", { timeout: 30000 }); diff --git a/src/frontend/tests/end-to-end/Blog Writer.spec.ts b/src/frontend/tests/end-to-end/Blog Writer.spec.ts index 859c9c786..139ea1bc6 100644 --- a/src/frontend/tests/end-to-end/Blog Writer.spec.ts +++ b/src/frontend/tests/end-to-end/Blog Writer.spec.ts @@ -13,7 +13,13 @@ test("Blog Writer", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -54,7 +60,7 @@ test("Blog Writer", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page .getByTestId("inputlist_str_urls_0") .nth(0) diff --git a/src/frontend/tests/end-to-end/Complex Agent.spec.ts b/src/frontend/tests/end-to-end/Complex Agent.spec.ts index 226516542..d75b939ea 100644 --- a/src/frontend/tests/end-to-end/Complex Agent.spec.ts +++ b/src/frontend/tests/end-to-end/Complex Agent.spec.ts @@ -18,7 +18,13 @@ test("Complex Agent", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -60,7 +66,7 @@ test("Complex Agent", async ({ page }) => { .last() .fill(process.env.BRAVE_SEARCH_API_KEY ?? ""); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); let openAiLlms = await page.getByText("OpenAI", { exact: true }).count(); @@ -85,7 +91,7 @@ test("Complex Agent", async ({ page }) => { await page.getByText("Playground", { exact: true }).click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); expect( page.getByText("Could you search info about AAPL?", { exact: true }).last(), diff --git a/src/frontend/tests/end-to-end/Document QA.spec.ts b/src/frontend/tests/end-to-end/Document QA.spec.ts index 5eb25d49a..62ad4e038 100644 --- a/src/frontend/tests/end-to-end/Document QA.spec.ts +++ b/src/frontend/tests/end-to-end/Document QA.spec.ts @@ -13,7 +13,13 @@ test("Document QA", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -54,14 +60,14 @@ test("Document QA", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); const fileChooserPromise = page.waitForEvent("filechooser"); await page.getByTestId("icon-FileSearch2").click(); const fileChooser = await fileChooserPromise; await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt")); await page.getByText("test_file.txt").isVisible(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); await page.waitForSelector("text=built successfully", { timeout: 30000 }); diff --git a/src/frontend/tests/end-to-end/Hierarchical Tasks Agent.spec.ts b/src/frontend/tests/end-to-end/Hierarchical Tasks Agent.spec.ts index 054116070..3752b24c4 100644 --- a/src/frontend/tests/end-to-end/Hierarchical Tasks Agent.spec.ts +++ b/src/frontend/tests/end-to-end/Hierarchical Tasks Agent.spec.ts @@ -18,7 +18,13 @@ test("Hierarchical Tasks Agent", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -68,19 +74,19 @@ test("Hierarchical Tasks Agent", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").first().click(); await page.getByTestId("gpt-4o-1-option").first().click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("dropdown_str_model_name").last().click(); await page.getByTestId("gpt-4o-1-option").last().click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page .getByTestId("popover-anchor-input-api_key") .last() .fill(process.env.BRAVE_SEARCH_API_KEY ?? ""); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); await page.waitForSelector("text=built successfully", { timeout: 60000 * 3 }); @@ -91,9 +97,7 @@ test("Hierarchical Tasks Agent", async ({ page }) => { await page.getByText("Playground", { exact: true }).click(); - await page.waitForTimeout(2000); - - expect(page.getByText("What is Langflow?", { exact: true })).toBeVisible(); + await page.waitForTimeout(3000); const textContents = await page .getByTestId("div-chat-message") diff --git a/src/frontend/tests/end-to-end/Memory Chatbot.spec.ts b/src/frontend/tests/end-to-end/Memory Chatbot.spec.ts index 781f9df0b..3bc88f3b5 100644 --- a/src/frontend/tests/end-to-end/Memory Chatbot.spec.ts +++ b/src/frontend/tests/end-to-end/Memory Chatbot.spec.ts @@ -13,7 +13,13 @@ test("Memory Chatbot", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -56,7 +62,7 @@ test("Memory Chatbot", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); await page.waitForSelector("text=built successfully", { timeout: 30000 }); diff --git a/src/frontend/tests/end-to-end/Sequential Tasks Agent.spec.ts b/src/frontend/tests/end-to-end/Sequential Tasks Agent.spec.ts index 0644dce84..d841ccab6 100644 --- a/src/frontend/tests/end-to-end/Sequential Tasks Agent.spec.ts +++ b/src/frontend/tests/end-to-end/Sequential Tasks Agent.spec.ts @@ -18,7 +18,13 @@ test("Sequential Tasks Agent", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -63,14 +69,14 @@ test("Sequential Tasks Agent", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page .getByTestId("popover-anchor-input-api_key") .last() .fill(process.env.BRAVE_SEARCH_API_KEY ?? ""); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); await page.waitForSelector("text=built successfully", { timeout: 60000 * 3 }); @@ -81,7 +87,7 @@ test("Sequential Tasks Agent", async ({ page }) => { await page.getByText("Playground", { exact: true }).click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); expect( page diff --git a/src/frontend/tests/end-to-end/Vector Store.spec.ts b/src/frontend/tests/end-to-end/Vector Store.spec.ts index 60c590d31..b7ea4cfc8 100644 --- a/src/frontend/tests/end-to-end/Vector Store.spec.ts +++ b/src/frontend/tests/end-to-end/Vector Store.spec.ts @@ -18,7 +18,13 @@ test("Vector Store RAG", async ({ page }) => { ); await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -93,7 +99,7 @@ test("Vector Store RAG", async ({ page }) => { await fileChooser.setFiles(path.join(__dirname, "/assets/test_file.txt")); await page.getByText("test_file.txt").isVisible(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_astra db").first().click(); await page.waitForSelector("text=built successfully", { timeout: 60000 * 2 }); diff --git a/src/frontend/tests/end-to-end/actionsMainPage-shard-1.spec.ts b/src/frontend/tests/end-to-end/actionsMainPage-shard-1.spec.ts index 89810e528..cc91cedb5 100644 --- a/src/frontend/tests/end-to-end/actionsMainPage-shard-1.spec.ts +++ b/src/frontend/tests/end-to-end/actionsMainPage-shard-1.spec.ts @@ -2,7 +2,13 @@ import { test } from "@playwright/test"; test("select and delete all", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -38,7 +44,13 @@ test("select and delete all", async ({ page }) => { test("select and delete a flow", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -73,7 +85,13 @@ test("select and delete a flow", async ({ page }) => { test("search flows", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -123,7 +141,13 @@ test("search flows", async ({ page }) => { test("search components", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -184,6 +208,12 @@ test("search components", async ({ page }) => { await page.getByTestId("icon-ChevronLeft").first().click(); + const exitButton = await page.getByText("Exit", { exact: true }).count(); + + if (exitButton > 0) { + await page.getByText("Exit", { exact: true }).click(); + } + await page .getByText("Components", { exact: true, diff --git a/src/frontend/tests/end-to-end/decisionFlow.spec.ts b/src/frontend/tests/end-to-end/decisionFlow.spec.ts index 072f560a8..e7cd231b1 100644 --- a/src/frontend/tests/end-to-end/decisionFlow.spec.ts +++ b/src/frontend/tests/end-to-end/decisionFlow.spec.ts @@ -13,8 +13,14 @@ test("should create a flow with decision", async ({ page }) => { } await page.goto("/"); - await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); - await page.waitForTimeout(2000); + + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts b/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts index 123800a7a..ee8faad6c 100644 --- a/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts +++ b/src/frontend/tests/end-to-end/filterEdge-shard-0.spec.ts @@ -119,7 +119,7 @@ test("user must see on handle hover a tooltip with possibility connections", asy await expect( page.getByTestId("available-input-models").first(), ).toBeVisible(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("icon-Search").click(); @@ -142,7 +142,7 @@ test("user must see on handle hover a tooltip with possibility connections", asy } await visibleElementHandle.hover().then(async () => { - await page.waitForTimeout(2000); + await page.waitForTimeout(2500); await expect( page.getByTestId("available-input-retrievers").first(), diff --git a/src/frontend/tests/end-to-end/filterSidebar.spec.ts b/src/frontend/tests/end-to-end/filterSidebar.spec.ts index ed4e24580..b4fafbc89 100644 --- a/src/frontend/tests/end-to-end/filterSidebar.spec.ts +++ b/src/frontend/tests/end-to-end/filterSidebar.spec.ts @@ -4,7 +4,13 @@ test("user must see on handle click the possibility connections - LLMChain", asy page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -34,7 +40,7 @@ test("user must see on handle click the possibility connections - LLMChain", asy await page.getByPlaceholder("Search").click(); await page.getByPlaceholder("Search").fill("api request"); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page .getByTestId("dataAPI Request") .dragTo(page.locator('//*[@id="react-flow-id"]')); diff --git a/src/frontend/tests/end-to-end/folders.spec.ts b/src/frontend/tests/end-to-end/folders.spec.ts index 32f794880..18ce4d8e4 100644 --- a/src/frontend/tests/end-to-end/folders.spec.ts +++ b/src/frontend/tests/end-to-end/folders.spec.ts @@ -3,7 +3,13 @@ import { readFileSync } from "fs"; test("CRUD folders", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -107,7 +113,13 @@ test("add folder by drag and drop", async ({ page }) => { test("change flow folder", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/end-to-end/freeze-path.spec.ts b/src/frontend/tests/end-to-end/freeze-path.spec.ts index 2f9716908..6f1fec40b 100644 --- a/src/frontend/tests/end-to-end/freeze-path.spec.ts +++ b/src/frontend/tests/end-to-end/freeze-path.spec.ts @@ -13,7 +13,13 @@ test("user must be able to freeze a path", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -64,11 +70,11 @@ test("user must be able to freeze a path", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("float-input").fill("1.0"); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); @@ -91,7 +97,7 @@ test("user must be able to freeze a path", async ({ page }) => { await page.getByTestId("float-input").fill("1.2"); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); await page.waitForSelector("text=built successfully", { timeout: 30000 }); diff --git a/src/frontend/tests/end-to-end/freeze.spec.ts b/src/frontend/tests/end-to-end/freeze.spec.ts index 09cf98b66..40aab7677 100644 --- a/src/frontend/tests/end-to-end/freeze.spec.ts +++ b/src/frontend/tests/end-to-end/freeze.spec.ts @@ -4,7 +4,13 @@ import path from "path"; test("user must be able to freeze a component", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -213,7 +219,7 @@ test("user must be able to freeze a component", async ({ page }) => { timeout: 15000, }); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("output-inspection-message").first().click(); @@ -236,7 +242,7 @@ test("user must be able to freeze a component", async ({ page }) => { timeout: 15000, }); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("output-inspection-message").first().click(); @@ -280,7 +286,7 @@ test("user must be able to freeze a component", async ({ page }) => { timeout: 15000, }); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("output-inspection-message").first().click(); @@ -315,7 +321,7 @@ test("user must be able to freeze a component", async ({ page }) => { timeout: 15000, }); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("output-inspection-message").first().click(); diff --git a/src/frontend/tests/end-to-end/generalBugs-shard-4.spec.ts b/src/frontend/tests/end-to-end/generalBugs-shard-4.spec.ts index 8ec4f36fa..3f2a4142b 100644 --- a/src/frontend/tests/end-to-end/generalBugs-shard-4.spec.ts +++ b/src/frontend/tests/end-to-end/generalBugs-shard-4.spec.ts @@ -10,7 +10,13 @@ test("should be able to move flow from folder, rename it and be displayed on cor await page.goto("/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/end-to-end/globalVariables.spec.ts b/src/frontend/tests/end-to-end/globalVariables.spec.ts index 192d85ad9..b9dcc4daf 100644 --- a/src/frontend/tests/end-to-end/globalVariables.spec.ts +++ b/src/frontend/tests/end-to-end/globalVariables.spec.ts @@ -4,7 +4,13 @@ test("user must be able to save or delete a global variable", async ({ page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -78,7 +84,7 @@ test("user must be able to save or delete a global variable", async ({ await page.getByText("Save Variable", { exact: true }).click(); expect(page.getByText(credentialName, { exact: true })).not.toBeNull(); await page.getByText(credentialName, { exact: true }).isVisible(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page .getByText(credentialName, { exact: true }) diff --git a/src/frontend/tests/end-to-end/group.spec.ts b/src/frontend/tests/end-to-end/group.spec.ts index ff58e7a9c..464749731 100644 --- a/src/frontend/tests/end-to-end/group.spec.ts +++ b/src/frontend/tests/end-to-end/group.spec.ts @@ -24,7 +24,7 @@ test.describe("group node test", () => { .getByRole("heading", { name: "Basic Prompting" }) .first() .click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByLabel("fit view").first().click(); await page.getByTestId("title-OpenAI").click(); diff --git a/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts b/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts index dbd811a7a..144ba785c 100644 --- a/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts +++ b/src/frontend/tests/end-to-end/keyPairListComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("KeypairListComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/end-to-end/logs.spec.ts b/src/frontend/tests/end-to-end/logs.spec.ts index a6d92f951..f162c8d90 100644 --- a/src/frontend/tests/end-to-end/logs.spec.ts +++ b/src/frontend/tests/end-to-end/logs.spec.ts @@ -13,7 +13,13 @@ test("should able to see and interact with logs", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -33,7 +39,7 @@ test("should able to see and interact with logs", async ({ page }) => { } await page.getByRole("heading", { name: "Basic Prompting" }).click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); let outdatedComponents = await page.getByTestId("icon-AlertTriangle").count(); @@ -55,7 +61,7 @@ test("should able to see and interact with logs", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").first().click(); await page.waitForSelector("text=built successfully", { timeout: 30000 }); diff --git a/src/frontend/tests/end-to-end/nestedComponent.spec.ts b/src/frontend/tests/end-to-end/nestedComponent.spec.ts index 0d55e587c..425ba76c0 100644 --- a/src/frontend/tests/end-to-end/nestedComponent.spec.ts +++ b/src/frontend/tests/end-to-end/nestedComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("NestedComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/end-to-end/saveComponents.spec.ts b/src/frontend/tests/end-to-end/saveComponents.spec.ts index 232a6e522..433a77ddd 100644 --- a/src/frontend/tests/end-to-end/saveComponents.spec.ts +++ b/src/frontend/tests/end-to-end/saveComponents.spec.ts @@ -59,6 +59,7 @@ test.describe("save component tests", () => { if (elementCount > 0) { expect(true).toBeTruthy(); } + await page .locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[3]') .click(); @@ -73,6 +74,11 @@ test.describe("save component tests", () => { await page.getByRole("button", { name: "Group" }).click(); + await page + .locator('//*[@id="react-flow-id"]') + .first() + .click({ button: "left" }); + let textArea = page.getByTestId("div-textarea-description"); let elementCountText = await textArea?.count(); if (elementCountText > 0) { @@ -90,21 +96,23 @@ test.describe("save component tests", () => { await page.getByTestId("icon-SaveAll").click(); + await page.waitForTimeout(1000); + const replaceButton = await page.getByTestId("replace-button").isVisible(); if (replaceButton) { await page.getByTestId("replace-button").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("group"); await page.waitForTimeout(1000); await page - .getByTestId("saved_componentsGroup") + .getByText("Group") .first() .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.mouse.up(); diff --git a/src/frontend/tests/end-to-end/store-shard-2.spec.ts b/src/frontend/tests/end-to-end/store-shard-2.spec.ts index f9e7cce55..d83f828fe 100644 --- a/src/frontend/tests/end-to-end/store-shard-2.spec.ts +++ b/src/frontend/tests/end-to-end/store-shard-2.spec.ts @@ -26,7 +26,7 @@ test("should filter by tag", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); await page.getByTestId("button-store").click(); @@ -76,11 +76,11 @@ test("should share component with share button", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); await page.getByText("My Collection").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); let modalCount = 0; try { diff --git a/src/frontend/tests/end-to-end/textInputOutput.spec.ts b/src/frontend/tests/end-to-end/textInputOutput.spec.ts index 88117c1c2..3bd06482b 100644 --- a/src/frontend/tests/end-to-end/textInputOutput.spec.ts +++ b/src/frontend/tests/end-to-end/textInputOutput.spec.ts @@ -13,7 +13,13 @@ test("TextInputOutputComponent", async ({ page }) => { } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -196,7 +202,7 @@ test("TextInputOutputComponent", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Playground", { exact: true }).click(); await page.getByText("Run Flow", { exact: true }).click(); diff --git a/src/frontend/tests/end-to-end/tweaksTest.spec.ts b/src/frontend/tests/end-to-end/tweaksTest.spec.ts index 0d5ea8287..385b52848 100644 --- a/src/frontend/tests/end-to-end/tweaksTest.spec.ts +++ b/src/frontend/tests/end-to-end/tweaksTest.spec.ts @@ -19,7 +19,7 @@ test("curl_api_generation", async ({ page, context }) => { } await page.getByRole("heading", { name: "Basic Prompting" }).click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("API", { exact: true }).click(); await page.getByRole("tab", { name: "cURL" }).click(); await page.getByTestId("icon-Copy").click(); @@ -58,7 +58,13 @@ test("check if tweaks are updating when someothing on the flow changes", async ( page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/actionsMainPage-shard-0.spec.ts b/src/frontend/tests/scheduled-end-to-end/actionsMainPage-shard-0.spec.ts index cc72ff1cc..e93be566b 100644 --- a/src/frontend/tests/scheduled-end-to-end/actionsMainPage-shard-0.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/actionsMainPage-shard-0.spec.ts @@ -4,7 +4,14 @@ test("user should be able to download a flow or a component", async ({ page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -37,7 +44,7 @@ test("user should be able to download a flow or a component", async ({ await page.getByTestId("more-options-modal").click(); await page.getByTestId("icon-SaveAll").first().click(); - await page.waitForTimeout(3000); + await page.waitForTimeout(1000); if (await page.getByTestId("replace-button").isVisible()) { await page.getByTestId("replace-button").click(); @@ -47,6 +54,12 @@ test("user should be able to download a flow or a component", async ({ timeout: 100000, }); + const exitButton = await page.getByText("Exit", { exact: true }).count(); + + if (exitButton > 0) { + await page.getByText("Exit", { exact: true }).click(); + } + await page.getByTestId("icon-ChevronLeft").last().click(); await page.getByRole("checkbox").nth(1).click(); await page.getByTestId("icon-FileDown").last().click(); @@ -70,7 +83,13 @@ test("user should be able to upload a flow or a component", async ({ page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -89,7 +108,13 @@ test("user should be able to duplicate a flow or a component", async ({ page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -121,7 +146,7 @@ test("user should be able to duplicate a flow or a component", async ({ await page.getByTestId("more-options-modal").click(); await page.getByTestId("icon-SaveAll").first().click(); - await page.waitForTimeout(3000); + await page.waitForTimeout(1000); if (await page.getByTestId("replace-button").isVisible()) { await page.getByTestId("replace-button").click(); @@ -130,6 +155,13 @@ test("user should be able to duplicate a flow or a component", async ({ await page.waitForSelector('[data-testid="icon-ChevronLeft"]', { timeout: 100000, }); + + const exitButton = await page.getByText("Exit", { exact: true }).count(); + + if (exitButton > 0) { + await page.getByText("Exit", { exact: true }).click(); + } + await page.getByTestId("icon-ChevronLeft").last().click(); await page.getByRole("checkbox").nth(1).click(); diff --git a/src/frontend/tests/scheduled-end-to-end/auto-save-off.spec.ts b/src/frontend/tests/scheduled-end-to-end/auto-save-off.spec.ts index 82979bf03..a5b60b350 100644 --- a/src/frontend/tests/scheduled-end-to-end/auto-save-off.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/auto-save-off.spec.ts @@ -20,7 +20,13 @@ test("user should be able to manually save a flow when the auto_save is off", as await page.goto("/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/chatInputOutput.spec.ts b/src/frontend/tests/scheduled-end-to-end/chatInputOutput.spec.ts index f835867a0..3ee89fdc4 100644 --- a/src/frontend/tests/scheduled-end-to-end/chatInputOutput.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/chatInputOutput.spec.ts @@ -3,7 +3,13 @@ import { expect, test } from "@playwright/test"; test("chat_io_teste", async ({ page }) => { await page.goto("/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-1.spec.ts index 26ed40939..e2d7839c7 100644 --- a/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-1.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-1.spec.ts @@ -58,7 +58,7 @@ test("user must be able to see output inspection", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").last().click(); await page.waitForSelector("text=built successfully", { timeout: 30000 }); diff --git a/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts b/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts index 12b358bc3..2ae96b3f7 100644 --- a/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/chatInputOutputUser-shard-2.spec.ts @@ -57,7 +57,7 @@ test("user must interact with chat with Input/Output", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Playground", { exact: true }).click(); await page.waitForSelector('[data-testid="input-chat-playground"]', { diff --git a/src/frontend/tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts index 4e7a89c0e..30938217c 100644 --- a/src/frontend/tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/codeAreaModalComponent.spec.ts @@ -2,7 +2,13 @@ import { test } from "@playwright/test"; test("CodeAreaModalComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/curlApiGeneration.spec.ts b/src/frontend/tests/scheduled-end-to-end/curlApiGeneration.spec.ts index 81b67d3e3..50c801daf 100644 --- a/src/frontend/tests/scheduled-end-to-end/curlApiGeneration.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/curlApiGeneration.spec.ts @@ -18,7 +18,7 @@ test("curl_api_generation", async ({ page, context }) => { modalCount = await page.getByTestId("modal-title")?.count(); } await page.getByRole("heading", { name: "Basic Prompting" }).click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("API", { exact: true }).click(); await page.getByRole("tab", { name: "cURL" }).click(); await page.getByTestId("icon-Copy").last().click(); diff --git a/src/frontend/tests/scheduled-end-to-end/deleteComponents.spec.ts b/src/frontend/tests/scheduled-end-to-end/deleteComponents.spec.ts index 21665016b..aa292ee6d 100644 --- a/src/frontend/tests/scheduled-end-to-end/deleteComponents.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/deleteComponents.spec.ts @@ -26,10 +26,10 @@ test("should delete a component", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Store").nth(0).click(); await page.getByTestId("install-Basic RAG").click(); await page.waitForTimeout(5000); diff --git a/src/frontend/tests/scheduled-end-to-end/deleteFlows.spec.ts b/src/frontend/tests/scheduled-end-to-end/deleteFlows.spec.ts index 566781e0c..1d37ec9cd 100644 --- a/src/frontend/tests/scheduled-end-to-end/deleteFlows.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/deleteFlows.spec.ts @@ -25,7 +25,7 @@ test("should delete a flow", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); await page.waitForSelector("text=Store", { timeout: 30000 }); diff --git a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts index f1ac3e451..f9b7a2f7c 100644 --- a/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/dropdownComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("dropDownComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/fileUploadComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/fileUploadComponent.spec.ts index a9cdbd449..89c8488fb 100644 --- a/src/frontend/tests/scheduled-end-to-end/fileUploadComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/fileUploadComponent.spec.ts @@ -3,7 +3,13 @@ import path from "path"; test("should be able to upload a file", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/filterEdge-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/filterEdge-shard-1.spec.ts index 65c9a13d0..b58489a5d 100644 --- a/src/frontend/tests/scheduled-end-to-end/filterEdge-shard-1.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/filterEdge-shard-1.spec.ts @@ -4,7 +4,13 @@ test("user must see on handle click the possibility connections - RetrievalQA", page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/floatComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/floatComponent.spec.ts index 83f43431d..d1efbb38f 100644 --- a/src/frontend/tests/scheduled-end-to-end/floatComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/floatComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("FloatComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -42,10 +48,10 @@ test("FloatComponent", async ({ page }) => { await page.getByTitle("zoom out").click(); await page.getByTitle("zoom out").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.locator('//*[@id="float-input"]').click(); await page.locator('//*[@id="float-input"]').fill(""); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.locator('//*[@id="float-input"]').fill("3"); let value = await page.locator('//*[@id="float-input"]').inputValue(); @@ -54,10 +60,10 @@ test("FloatComponent", async ({ page }) => { expect(false).toBeTruthy(); } - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.locator('//*[@id="float-input"]').click(); await page.locator('//*[@id="float-input"]').fill(""); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.locator('//*[@id="float-input"]').fill("-3"); value = await page.locator('//*[@id="float-input"]').inputValue(); diff --git a/src/frontend/tests/scheduled-end-to-end/flowPage.spec.ts b/src/frontend/tests/scheduled-end-to-end/flowPage.spec.ts index b06d36218..4bbb08955 100644 --- a/src/frontend/tests/scheduled-end-to-end/flowPage.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/flowPage.spec.ts @@ -3,7 +3,13 @@ import { test } from "@playwright/test"; test.describe("Flow Page tests", () => { test("save", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/flowSettings.spec.ts b/src/frontend/tests/scheduled-end-to-end/flowSettings.spec.ts index b7abe7261..1102ed93f 100644 --- a/src/frontend/tests/scheduled-end-to-end/flowSettings.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/flowSettings.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("flowSettings", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts index 8bb9b4cd3..a298ad701 100644 --- a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-0.spec.ts @@ -55,7 +55,7 @@ test("erase button should clear the chat messages", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Playground", { exact: true }).click(); await page.waitForSelector('[data-testid="input-chat-playground"]', { @@ -88,7 +88,7 @@ test("erase button should clear the chat messages", async ({ page }) => { await page.getByText("Start a conversation").isVisible(); await page.getByText("Langflow Chat").isVisible(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByPlaceholder("Send a message...").fill("My name is John"); await page.waitForSelector('[data-testid="icon-LucideSend"]', { diff --git a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts index 8414eb49f..cec5acbac 100644 --- a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts @@ -11,7 +11,13 @@ test("should delete rows from table message", async ({ page }) => { dotenv.config({ path: path.resolve(__dirname, "../../.env") }); } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -55,7 +61,7 @@ test("should delete rows from table message", async ({ page }) => { await page.getByTestId("dropdown_str_model_name").click(); await page.getByTestId("gpt-4o-1-option").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button_run_chat output").click(); await page.waitForSelector("text=built successfully", { timeout: 30000 }); diff --git a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-11.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-11.spec.ts index 1d67a5554..b60f3f86f 100644 --- a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-11.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-11.spec.ts @@ -4,7 +4,13 @@ test("user should be able to use ComposIO without getting api_key error", async page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -51,7 +57,13 @@ test("user should be able to use ComposIO without getting api_key error", async test("user should be able to use connect tools", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-2.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-2.spec.ts index 966be4a3b..09672bc54 100644 --- a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-2.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-2.spec.ts @@ -11,7 +11,13 @@ test("should use webhook component on API", async ({ page }) => { dotenv.config({ path: path.resolve(__dirname, "../../.env") }); } await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -55,7 +61,7 @@ test("should use webhook component on API", async ({ page }) => { await page.getByTitle("zoom out").click(); await page.getByTitle("zoom out").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("API", { exact: true }).click(); await page.getByText("Webhook cURL", { exact: true }).click(); diff --git a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-3.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-3.spec.ts index 45d18c05b..d0494e250 100644 --- a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-3.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-3.spec.ts @@ -14,7 +14,13 @@ test("should copy code from playground modal", async ({ page }) => { await page.goto("/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -200,7 +206,13 @@ test("should copy code from playground modal", async ({ page }) => { test("playground button should be enabled or disabled", async ({ page }) => { await page.goto("/"); await page.locator("span").filter({ hasText: "My Collection" }).isVisible(); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { @@ -227,14 +239,14 @@ test("playground button should be enabled or disabled", async ({ page }) => { timeout: 30000, }); - await page.getByTestId("playground-btn-flow").click({ force: true }); + 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.waitForTimeout(2000); + await page.waitForTimeout(1000); await page .locator('//*[@id="outputsChat Output"]') @@ -245,7 +257,7 @@ test("playground button should be enabled or disabled", async ({ page }) => { timeout: 100000, }); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("playground-btn-flow-io").click({ force: true }); diff --git a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-8.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-8.spec.ts index 689420777..d5a47d12c 100644 --- a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-8.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-8.spec.ts @@ -2,7 +2,13 @@ import { test } from "@playwright/test"; test("should interact with api request", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/inputComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/inputComponent.spec.ts index 49ac35799..6f3091d02 100644 --- a/src/frontend/tests/scheduled-end-to-end/inputComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/inputComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("InputComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/intComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/intComponent.spec.ts index da6225272..ea4d773bf 100644 --- a/src/frontend/tests/scheduled-end-to-end/intComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/intComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("IntComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/promptModalComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/promptModalComponent.spec.ts index 67413c50f..67afc6a42 100644 --- a/src/frontend/tests/scheduled-end-to-end/promptModalComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/promptModalComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("PromptTemplateComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/pythonApiGeneration.spec.ts b/src/frontend/tests/scheduled-end-to-end/pythonApiGeneration.spec.ts index 4ffdfc02f..ef6611188 100644 --- a/src/frontend/tests/scheduled-end-to-end/pythonApiGeneration.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/pythonApiGeneration.spec.ts @@ -2,6 +2,13 @@ import { expect, test } from "@playwright/test"; test("python_api_generation", async ({ page, context }) => { await page.goto("/"); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { const modalTitleElement = await page?.getByTestId("modal-title"); @@ -18,7 +25,7 @@ test("python_api_generation", async ({ page, context }) => { modalCount = await page.getByTestId("modal-title")?.count(); } await page.getByRole("heading", { name: "Basic Prompting" }).click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("API", { exact: true }).click(); await page.getByRole("tab", { name: "Python API" }).click(); await page.getByTestId("icon-Copy").click(); diff --git a/src/frontend/tests/scheduled-end-to-end/store-shard-0.spec.ts b/src/frontend/tests/scheduled-end-to-end/store-shard-0.spec.ts index 134859ac3..758934764 100644 --- a/src/frontend/tests/scheduled-end-to-end/store-shard-0.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/store-shard-0.spec.ts @@ -13,7 +13,7 @@ test("should not have an API key", async ({ page }) => { await page.waitForTimeout(1000); await page.getByTestId("button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("API Key Error").isVisible(); }); diff --git a/src/frontend/tests/scheduled-end-to-end/store-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/store-shard-1.spec.ts index 6deebf10a..7db30cba1 100644 --- a/src/frontend/tests/scheduled-end-to-end/store-shard-1.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/store-shard-1.spec.ts @@ -46,10 +46,10 @@ test("should like and add components and flows", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("button-store").click(); await page.waitForTimeout(5000); @@ -74,7 +74,7 @@ test("should like and add components and flows", async ({ page }) => { .innerText(); await page.getByTestId("install-Website Content QA").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Flow Installed Successfully").isVisible(); await page.waitForTimeout(5000); @@ -87,7 +87,7 @@ test("should like and add components and flows", async ({ page }) => { } await page.getByTestId("install-Basic RAG").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Component Installed Successfully").isVisible(); await page.waitForTimeout(5000); @@ -122,7 +122,7 @@ test("should find a searched Component on Store", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); await page.waitForTimeout(1000); diff --git a/src/frontend/tests/scheduled-end-to-end/store-shard-3.spec.ts b/src/frontend/tests/scheduled-end-to-end/store-shard-3.spec.ts index 82d937b92..c1cf62667 100644 --- a/src/frontend/tests/scheduled-end-to-end/store-shard-3.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/store-shard-3.spec.ts @@ -26,7 +26,7 @@ test("should order the visualization", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); await page.waitForTimeout(1000); @@ -37,7 +37,7 @@ test("should order the visualization", async ({ page }) => { await page.getByText("Basic RAG").isVisible(); await page.getByTestId("select-order-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Alphabetical").click(); await page.getByText("Album Cover Builder").isVisible(); @@ -72,7 +72,7 @@ test("should filter by type", async ({ page }) => { await page.getByTestId("api-key-save-button-store").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Success! Your API Key has been saved.").isVisible(); await page.getByTestId("button-store").click(); @@ -99,9 +99,9 @@ test("should filter by type", async ({ page }) => { await page.waitForTimeout(8000); let iconGroupAllCount = await page.getByTestId("icon-Group")?.count(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); let toyBrickAllCount = await page.getByTestId("icon-ToyBrick")?.count(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); if (iconGroupAllCount === 0 || toyBrickAllCount === 0) { expect(false).toBe(true); diff --git a/src/frontend/tests/scheduled-end-to-end/toggleComponent.spec.ts b/src/frontend/tests/scheduled-end-to-end/toggleComponent.spec.ts index f652686ff..5a3c59338 100644 --- a/src/frontend/tests/scheduled-end-to-end/toggleComponent.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/toggleComponent.spec.ts @@ -2,7 +2,13 @@ import { expect, test } from "@playwright/test"; test("ToggleComponent", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/twoEdges.spec.ts b/src/frontend/tests/scheduled-end-to-end/twoEdges.spec.ts index 705b48e88..988e34117 100644 --- a/src/frontend/tests/scheduled-end-to-end/twoEdges.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/twoEdges.spec.ts @@ -4,7 +4,13 @@ test("user should be able to see multiple edges and interact with them", async ( page, }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); let modalCount = 0; try { diff --git a/src/frontend/tests/scheduled-end-to-end/userSettings.spec.ts b/src/frontend/tests/scheduled-end-to-end/userSettings.spec.ts index 5dc15199c..0b8b32d04 100644 --- a/src/frontend/tests/scheduled-end-to-end/userSettings.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/userSettings.spec.ts @@ -2,7 +2,13 @@ import { test } from "@playwright/test"; test("should see general profile gradient", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); await page.getByTestId("user-profile-settings").click(); await page.waitForTimeout(1000); @@ -17,7 +23,7 @@ test("should interact with global variables", async ({ page }) => { const randomName = Math.random().toString(36).substring(2); await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("user-profile-settings").click(); await page.getByText("Settings").click(); await page.getByText("Global Variables").click(); @@ -29,12 +35,12 @@ test("should interact with global variables", async ({ page }) => { .fill(randomName); await page.getByTestId("popover-anchor-type-global-variables").click(); await page.getByPlaceholder("Search options...").fill("Generic"); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByText("Generic", { exact: true }).last().isVisible(); await page.getByText("Generic", { exact: true }).last().click(); await page.getByTestId("popover-anchor-type-global-variables").click(); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByPlaceholder("Search options...").fill("Generic"); await page.getByText("Generic", { exact: true }).last().isVisible(); await page.getByText("Generic", { exact: true }).last().click(); @@ -86,7 +92,13 @@ test("should interact with global variables", async ({ page }) => { test("should see shortcuts", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForSelector('[data-testid="mainpage_title"]', { + timeout: 30000, + }); + + await page.waitForSelector('[id="new-project-btn"]', { + timeout: 30000, + }); await page.getByTestId("user-profile-settings").click(); await page.waitForTimeout(1000); @@ -119,10 +131,10 @@ test("should see shortcuts", async ({ page }) => { test("should interact with API Keys", async ({ page }) => { await page.goto("/"); - await page.waitForTimeout(2000); + await page.waitForTimeout(1000); await page.getByTestId("user-profile-settings").click(); await page.getByText("Settings").click(); - await page.getByText("Langflow API").click(); + await page.getByText("Langflow API").first().click(); await page.getByText("Langflow API", { exact: true }).nth(1).isVisible(); await page.getByText("Add New").click(); await page.getByPlaceholder("Insert a name for your API Key").isVisible();