@@ -11,7 +11,7 @@ export const GithubStarComponent = () => {
Star
- {stars.toLocaleString() ?? 0}
+ {stars?.toLocaleString() ?? 0}
diff --git a/src/frontend/src/components/genericIconComponent/index.tsx b/src/frontend/src/components/genericIconComponent/index.tsx
index ef327176788..39dab1d0d14 100644
--- a/src/frontend/src/components/genericIconComponent/index.tsx
+++ b/src/frontend/src/components/genericIconComponent/index.tsx
@@ -36,9 +36,9 @@ export const ForwardedIconComponent = memo(
nodeIconsLucide[name] ||
nodeIconsLucide[
name
- .split("-")
- .map((x) => String(x[0]).toUpperCase() + String(x).slice(1))
- .join("")
+ ?.split("-")
+ ?.map((x) => String(x[0]).toUpperCase() + String(x).slice(1))
+ ?.join("")
];
if (!TargetIcon) {
if (!dynamicIconImports[name]) {
diff --git a/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts b/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts
index bfde1d1e4d7..1b2784ee774 100644
--- a/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts
+++ b/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts
@@ -141,9 +141,9 @@ test("search components", async ({ page }) => {
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.getByText("Chat Input").first().click();
+ await page.waitForTimeout(500);
await page.getByTestId("more-options-modal").click();
await page.getByTestId("icon-SaveAll").first().click();
diff --git a/src/frontend/tests/core/features/auto-login-off.spec.ts b/src/frontend/tests/core/features/auto-login-off.spec.ts
index da395b9b8d9..61e9b14cc1c 100644
--- a/src/frontend/tests/core/features/auto-login-off.spec.ts
+++ b/src/frontend/tests/core/features/auto-login-off.spec.ts
@@ -55,6 +55,8 @@ test("when auto_login is false, admin can CRUD user's and should see just your o
await page.waitForSelector("text=new user added", { timeout: 30000 });
+ await page.waitForTimeout(1000);
+
expect(await page.getByText(randomName, { exact: true }).isVisible()).toBe(
true,
);
@@ -64,6 +66,8 @@ test("when auto_login is false, admin can CRUD user's and should see just your o
await page.waitForSelector("text=user deleted", { timeout: 30000 });
+ await page.waitForTimeout(1000);
+
expect(await page.getByText(randomName, { exact: true }).isVisible()).toBe(
false,
);
@@ -147,7 +151,7 @@ test("when auto_login is false, admin can CRUD user's and should see just your o
state: "visible",
});
- await page.waitForTimeout(2000);
+ await page.waitForTimeout(1000);
await page.getByTestId("icon-ChevronLeft").first().click();
@@ -156,10 +160,14 @@ test("when auto_login is false, admin can CRUD user's and should see just your o
state: "visible",
});
+ await page.waitForTimeout(2000);
+
expect(
await page.getByText(randomFlowName, { exact: true }).last().isVisible(),
).toBe(true);
+ await page.waitForTimeout(500);
+
await page.getByTestId("user-profile-settings").click();
await page.getByText("Logout", { exact: true }).click();
@@ -232,6 +240,8 @@ test("when auto_login is false, admin can CRUD user's and should see just your o
await page.getByText(secondRandomFlowName, { exact: true }).isVisible(),
).toBe(true);
+ await page.waitForTimeout(500);
+
expect(
await page.getByText(randomFlowName, { exact: true }).isVisible(),
).toBe(false);
@@ -258,6 +268,8 @@ test("when auto_login is false, admin can CRUD user's and should see just your o
expect(
await page.getByText(secondRandomFlowName, { exact: true }).isVisible(),
).toBe(false);
+ await page.waitForTimeout(500);
+
expect(
await page.getByText(randomFlowName, { exact: true }).isVisible(),
).toBe(true);
diff --git a/src/frontend/tests/core/features/freeze-path.spec.ts b/src/frontend/tests/core/features/freeze-path.spec.ts
index f8702c04e66..4fbdaddfc03 100644
--- a/src/frontend/tests/core/features/freeze-path.spec.ts
+++ b/src/frontend/tests/core/features/freeze-path.spec.ts
@@ -129,7 +129,7 @@ test("user must be able to freeze a path", async ({ page }) => {
await page.waitForTimeout(3000);
- await page.getByText("openai").first().click();
+ await page.getByText("OpenAI", { exact: true }).last().click();
await page.waitForTimeout(1000);
diff --git a/src/frontend/tests/core/features/freeze.spec.ts b/src/frontend/tests/core/features/freeze.spec.ts
index adf46e84dcd..5ed418803ff 100644
--- a/src/frontend/tests/core/features/freeze.spec.ts
+++ b/src/frontend/tests/core/features/freeze.spec.ts
@@ -255,7 +255,7 @@ test("user must be able to freeze a component", async ({ page }) => {
await page.getByText("Close").last().click();
await page.getByText("Close").last().click();
- await page.getByText("Split Text", { exact: true }).click();
+ await page.getByText("Split Text", { exact: true }).last().click();
await page.waitForTimeout(1000);
diff --git a/src/frontend/tests/core/features/playground.spec.ts b/src/frontend/tests/core/features/playground.spec.ts
index 4c15b8a3e55..79c821b4d35 100644
--- a/src/frontend/tests/core/features/playground.spec.ts
+++ b/src/frontend/tests/core/features/playground.spec.ts
@@ -269,7 +269,7 @@ test("fresh start playground", async ({ page }) => {
await page.getByTestId("input-chat-playground").click();
await page.getByTestId("input-chat-playground").fill("second session");
await page.keyboard.press("Enter");
- await page.waitForTimeout(500);
+ await page.waitForTimeout(5000);
await page.getByTestId("chat-message-User-second session").click();
await page
diff --git a/src/frontend/tests/core/features/stop-building.spec.ts b/src/frontend/tests/core/features/stop-building.spec.ts
index 83c89a60d56..923b1185d8e 100644
--- a/src/frontend/tests/core/features/stop-building.spec.ts
+++ b/src/frontend/tests/core/features/stop-building.spec.ts
@@ -25,11 +25,6 @@ test("user must be able to stop a building", async ({ page }) => {
const getUA = await page.evaluate(() => navigator.userAgent);
const userAgentInfo = uaParser(getUA);
- let control = "Control";
-
- if (userAgentInfo.os.name.includes("Mac")) {
- control = "Meta";
- }
await page.getByTestId("blank-flow").click();
@@ -255,7 +250,7 @@ class CustomComponent(Component):
await page.getByTestId("code-button-modal").click();
await page.waitForTimeout(500);
- await page.locator("textarea").last().press(`${control}+a`);
+ await page.locator("textarea").last().press(`ControlOrMeta+a`);
await page.keyboard.press("Backspace");
await page.locator("textarea").last().fill(timerCode);
await page.locator('//*[@id="checkAndSaveBtn"]').click();
diff --git a/src/frontend/tests/core/integrations/Blog Writer.spec.ts b/src/frontend/tests/core/integrations/Blog Writer.spec.ts
index 22bfe7323d9..94d0058d39d 100644
--- a/src/frontend/tests/core/integrations/Blog Writer.spec.ts
+++ b/src/frontend/tests/core/integrations/Blog Writer.spec.ts
@@ -112,29 +112,4 @@ test("Blog Writer", async ({ page }) => {
await page.getByText("turtles").last().isVisible();
await page.getByText("sea").last().isVisible();
await page.getByText("survival").last().isVisible();
-
- //commented out for now because text input is not available in the playground
-
- // await page.getByText("Instructions").last().click();
-
- // const value = await page
- // .getByPlaceholder("Enter text...")
- // .last()
- // .inputValue();
-
- // expect(value).toBe(
- // "Use the references above for style to write a new blog/tutorial about turtles. Suggest non-covered topics.",
- // );
-
- // await page.getByTestId("icon-ExternalLink").last().click();
-
- // const count = await page
- // .getByText(
- // "Use the references above for style to write a new blog/tutorial about turtles. Suggest non-covered topics.",
- // )
- // .count();
-
- // if (count <= 1) {
- // expect(false).toBe(true);
- // }
});
diff --git a/src/frontend/tests/core/integrations/Dynamic Agent.spec.ts b/src/frontend/tests/core/integrations/Dynamic Agent.spec.ts
index 881e1834222..fbf6ba526fe 100644
--- a/src/frontend/tests/core/integrations/Dynamic Agent.spec.ts
+++ b/src/frontend/tests/core/integrations/Dynamic Agent.spec.ts
@@ -2,7 +2,7 @@ import { expect, test } from "@playwright/test";
import * as dotenv from "dotenv";
import path from "path";
-test("Dynamic Agent", async ({ page }) => {
+test.skip("Dynamic Agent", async ({ page }) => {
test.skip(
!process?.env?.OPENAI_API_KEY,
"OPENAI_API_KEY required to run this test",
diff --git a/src/frontend/tests/core/integrations/Hierarchical Agent.spec.ts b/src/frontend/tests/core/integrations/Hierarchical Agent.spec.ts
index 7561deec539..49caf541989 100644
--- a/src/frontend/tests/core/integrations/Hierarchical Agent.spec.ts
+++ b/src/frontend/tests/core/integrations/Hierarchical Agent.spec.ts
@@ -3,7 +3,7 @@ import * as dotenv from "dotenv";
import path from "path";
import uaParser from "ua-parser-js";
-test("Hierarchical Tasks Agent", async ({ page }) => {
+test.skip("Hierarchical Tasks Agent", async ({ page }) => {
test.skip(
!process?.env?.OPENAI_API_KEY,
"OPENAI_API_KEY required to run this test",
@@ -45,11 +45,6 @@ test("Hierarchical Tasks Agent", async ({ page }) => {
const getUA = await page.evaluate(() => navigator.userAgent);
const userAgentInfo = uaParser(getUA);
- let control = "Control";
-
- if (userAgentInfo.os.name.includes("Mac")) {
- control = "Meta";
- }
await page.getByTestId("side_nav_options_all-templates").click();
await page
diff --git a/src/frontend/tests/core/integrations/Sequential Task Agent.spec.ts b/src/frontend/tests/core/integrations/Sequential Task Agent.spec.ts
index f3755343c1d..a786abbd4a1 100644
--- a/src/frontend/tests/core/integrations/Sequential Task Agent.spec.ts
+++ b/src/frontend/tests/core/integrations/Sequential Task Agent.spec.ts
@@ -3,7 +3,7 @@ import * as dotenv from "dotenv";
import path from "path";
import uaParser from "ua-parser-js";
-test("Sequential Task Agent", async ({ page }) => {
+test.skip("Sequential Task Agent", async ({ page }) => {
test.skip(
!process?.env?.OPENAI_API_KEY,
"OPENAI_API_KEY required to run this test",
@@ -40,11 +40,6 @@ test("Sequential Task Agent", async ({ page }) => {
const getUA = await page.evaluate(() => navigator.userAgent);
const userAgentInfo = uaParser(getUA);
- let control = "Control";
-
- if (userAgentInfo.os.name.includes("Mac")) {
- control = "Meta";
- }
await page.getByTestId("side_nav_options_all-templates").click();
await page
diff --git a/src/frontend/tests/core/integrations/Simple Agent.spec.ts b/src/frontend/tests/core/integrations/Simple Agent.spec.ts
index 3ea090d1040..8c704bed9c0 100644
--- a/src/frontend/tests/core/integrations/Simple Agent.spec.ts
+++ b/src/frontend/tests/core/integrations/Simple Agent.spec.ts
@@ -40,11 +40,6 @@ test("Simple Agent", async ({ page }) => {
const getUA = await page.evaluate(() => navigator.userAgent);
const userAgentInfo = uaParser(getUA);
- let control = "Control";
-
- if (userAgentInfo.os.name.includes("Mac")) {
- control = "Meta";
- }
await page.getByTestId("side_nav_options_all-templates").click();
await page.getByRole("heading", { name: "Simple Agent" }).first().click();
@@ -82,71 +77,22 @@ test("Simple Agent", async ({ page }) => {
await page.getByTestId("dropdown_str_model_name").click();
await page.getByTestId("gpt-4o-1-option").click();
- await page.waitForTimeout(1000);
-
- await page
- .getByTestId("textarea_str_input_value")
- .fill(
- "Use the Python REPL tool to create a python function that calculates 4 + 4 and stores it in a variable.",
- );
-
- await page.getByTestId("button_run_chat output").click();
- await page.waitForSelector("text=built successfully", { timeout: 30000 });
-
- await page.getByText("built successfully").last().click({
- timeout: 15000,
- });
-
- await page.getByText("Playground", { exact: true }).last().click();
-
- await page.waitForSelector(
- "text=Use the Python REPL tool to create a python function that calculates 4 + 4 and stores it in a variable.",
- {
- timeout: 30000,
- },
- );
-
- await page.waitForTimeout(1000);
-
- expect(page.getByText("User")).toBeVisible();
-
- let pythonWords = await page.getByText("4 + 4").count();
-
- expect(pythonWords).toBe(2);
-
- await page
- .getByPlaceholder("Send a message...")
- .fill("write short python script to say hello world");
-
- await page.getByTestId("button-send").last().click();
-
- await page.waitForSelector(
- "text=write short python script to say hello world",
- {
- timeout: 30000,
- },
- );
-
- await page.waitForSelector('[data-testid="copy-code-button"]', {
- timeout: 100000,
- state: "visible",
- });
-
- await page.waitForTimeout(1000);
-
- await page.getByTestId("copy-code-button").last().click();
-
await page.waitForTimeout(500);
- await page.getByPlaceholder("Send a message...").click();
+ await page.getByTestId("button_run_chat output").last().click();
- await page.waitForTimeout(500);
+ await page.waitForSelector("text=built successfully", {
+ timeout: 10000 * 60 * 3,
+ });
- await page.keyboard.press(`${control}+V`);
+ await page.getByTestId("playground-btn-flow-io").click();
- await page.waitForTimeout(500);
+ const textContents = await page
+ .getByTestId("div-chat-message")
+ .allTextContents();
- pythonWords = await page.getByText("print(").count();
+ const concatAllText = textContents.join(" ").toLowerCase();
- expect(pythonWords).toBeGreaterThanOrEqual(1);
+ expect(concatAllText).toContain("apple");
+ expect(concatAllText.length).toBeGreaterThan(100);
});
diff --git a/src/frontend/tests/core/integrations/Travel Planning Agent.spec.ts b/src/frontend/tests/core/integrations/Travel Planning Agent.spec.ts
index a8dac04bb7b..5fb3e78aff3 100644
--- a/src/frontend/tests/core/integrations/Travel Planning Agent.spec.ts
+++ b/src/frontend/tests/core/integrations/Travel Planning Agent.spec.ts
@@ -1,4 +1,4 @@
-import { expect, test } from "@playwright/test";
+import { expect, Page, test } from "@playwright/test";
import * as dotenv from "dotenv";
import path from "path";
@@ -72,16 +72,6 @@ test("Travel Planning Agent", async ({ page }) => {
filledApiKey = await page.getByTestId("remove-icon-badge").count();
}
- await page
- .getByTestId("popover-anchor-input-api_key")
- .last()
- .fill(process.env.SEARCH_API_KEY ?? "");
-
- await page
- .getByTestId("popover-anchor-input-api_key")
- .first()
- .fill(process.env.OPENAI_API_KEY ?? "");
-
const randomCity = cities[Math.floor(Math.random() * cities.length)];
const randomCity2 = cities[Math.floor(Math.random() * cities.length)];
const randomFood = foods[Math.floor(Math.random() * foods.length)];
@@ -93,55 +83,83 @@ test("Travel Planning Agent", async ({ page }) => {
`Create a travel plan from ${randomCity} to ${randomCity2} with ${randomFood}`,
);
- await page.getByTestId("dropdown_str_model_name").click();
- await page.getByTestId("gpt-4o-1-option").click();
+ let openAiLlms = await page.getByText("OpenAI", { exact: true }).count();
+ await page.waitForSelector('[data-testid="fit_view"]', {
+ timeout: 100000,
+ });
+
+ for (let i = 0; i < openAiLlms; i++) {
+ await page
+ .getByTestId("popover-anchor-input-api_key")
+ .nth(i + 1)
+ .fill(process.env.OPENAI_API_KEY ?? "");
+ await page.getByTestId("zoom_in").click();
+ await page.getByTestId("dropdown_str_model_name").nth(i).click();
+ await page.getByTestId("gpt-4o-1-option").last().click();
+ await page.waitForTimeout(1000);
+ }
+
+ await page
+ .getByTestId("popover-anchor-input-api_key")
+ .first()
+ .fill(process.env.SEARCH_API_KEY ?? "");
await page.waitForTimeout(1000);
await page.getByTestId("button_run_chat output").click();
- const result = await Promise.race([
- // Look for rate limit indicators
- page.waitForSelector("text=429", { timeout: 10000 }),
- page.waitForSelector("text=Too Many Requests", { timeout: 10000 }),
- page.waitForResponse((response) => response.status() === 429, {
- timeout: 10000,
- }),
- ]);
+ await page.getByTestId("button_run_chat output").last().click();
- if (result) {
+ if (await checkRateLimit(page)) {
console.log("Rate limit detected, skipping test");
test.skip();
- } else {
- await page.getByTestId("button_run_chat output").click();
+ }
- await page.waitForSelector("text=built successfully", {
- timeout: 60000 * 3,
- });
+ await page.waitForSelector("text=built successfully", {
+ timeout: 60000 * 3,
+ });
- await page.getByText("built successfully").last().click({
- timeout: 15000,
- });
- await page.getByText("Playground", { exact: true }).last().click();
+ await page.getByText("built successfully").last().click({
+ timeout: 15000,
+ });
- await page.waitForSelector("text=default session", {
- timeout: 30000,
- });
+ await page.getByText("Playground", { exact: true }).last().click();
- await page.waitForTimeout(1000);
+ await page.waitForSelector("text=default session", {
+ timeout: 30000,
+ });
- const output = await page.getByTestId("div-chat-message").allTextContents();
- const outputText = output.join("\n");
+ await page.waitForTimeout(1000);
- expect(outputText.toLowerCase()).toContain("weather");
- expect(outputText.toLowerCase()).toContain("budget");
+ const output = await page.getByTestId("div-chat-message").allTextContents();
+ const outputText = output.join("\n");
- expect(outputText.toLowerCase()).toContain(randomCity);
- expect(outputText.toLowerCase()).toContain(randomCity2);
- expect(outputText.toLowerCase()).toContain(randomFood);
- }
+ expect(outputText.toLowerCase()).toContain("weather");
+ expect(outputText.toLowerCase()).toContain("budget");
+
+ expect(outputText.toLowerCase()).toContain(randomCity.toLowerCase());
+ expect(outputText.toLowerCase()).toContain(randomCity2.toLowerCase());
+ expect(outputText.toLowerCase()).toContain(randomFood.toLowerCase());
});
+async function checkRateLimit(page: Page): Promise