diff --git a/typescript-sdk/apps/dojo/e2e/tests/copilotkit-home.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/copilotkit-home.spec.ts deleted file mode 100644 index 362157aec..000000000 --- a/typescript-sdk/apps/dojo/e2e/tests/copilotkit-home.spec.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { test, expect } from "@playwright/test"; - -// Smoke test: ensure CopilotKit homepage loads and renders key content. - -test('[Core] CopilotKit homepage renders', async ({ page }) => { - await page.goto("https://copilotkit.ai/", { waitUntil: "domcontentloaded" }); - - await expect(page).toHaveTitle(/CopilotKit/i); - - // Validate hero heading content. - await expect( - page.getByRole("heading", { - name: /Build User-Facing Agentic Applications/i, - exact: false, - }) - ).toBeVisible(); -}); \ No newline at end of file diff --git a/typescript-sdk/apps/dojo/e2e/tests/integration/ai-features.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/integration/ai-features.spec.ts deleted file mode 100644 index 790ce8bf0..000000000 --- a/typescript-sdk/apps/dojo/e2e/tests/integration/ai-features.spec.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { - test, - expect, - waitForAIResponse, - retryOnAIFailure, -} from "../../test-isolation-helper"; -import { waitForAIPatterns } from "../../utils/aiWaitHelpers"; - -test.describe("Demo Viewer AI Features", () => { - test("[Crew] Restaurant Finder Agent - Complex workflow", async ({ - page, - }) => { - try { - await page.goto( - "https://demo.copilotkit.ai/crew_enterprise_restaurant_finder", - { - waitUntil: "networkidle", - timeout: 30_000, - } - ); - - // Navigate through nested iframes - const demoFrame = page.frameLocator('iframe[title="Demo Preview"]'); - const agentFrame = demoFrame.frameLocator( - 'iframe[title="Restaurant Finder Agent"]' - ); - - // Wait for agent interface to load - await expect(agentFrame.locator("body")).toBeVisible({ timeout: 30_000 }); - - // Look for input field - const chatInput = agentFrame.locator("input, textarea").first(); - if ((await chatInput.count()) > 0) { - await chatInput.fill("Find me a restaurant in San Francisco"); - await chatInput.press("Enter"); - - // Wait for restaurant results or AI response - await expect( - agentFrame.locator("*", { - hasText: /restaurant|san francisco|recommendation/i, - }) - ).toBeVisible({ timeout: 90_000 }); - console.log("✅ Restaurant finder agent working"); - } - } catch (error) { - console.log("⚠️ Restaurant finder demo not available or not working"); - // Don't fail the test - this is expected if the demo is down - } - }); -}); - -// Test configuration for CI vs local -test.describe.configure({ - timeout: process.env.CI ? 300_000 : 120_000, // 5min in CI, 2min locally - retries: process.env.CI ? 1 : 0, -}); diff --git a/typescript-sdk/apps/dojo/e2e/tests/smoke-only/basic-loading.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/smoke-only/basic-loading.spec.ts deleted file mode 100644 index a07d2f101..000000000 --- a/typescript-sdk/apps/dojo/e2e/tests/smoke-only/basic-loading.spec.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { test, expect } from "@playwright/test"; - -test.describe("Demo Apps Loading Smoke Tests", () => { - test("[Smoke] AG2 Agentic Chat app loads successfully", async ({ page }) => { - await page.goto( - "https://ag2-feature-viewer.vercel.app/feature/agentic_chat" - ); - - // Just verify the page loads and key elements are present - await expect( - page.getByRole("button", { name: "Agentic Chat Chat with your" }) - ).toBeVisible(); - await expect(page.getByText("Hi, I'm an agent. Want to")).toBeVisible(); - - // Click to open chat - await page - .getByRole("button", { name: "Agentic Chat Chat with your" }) - .click(); - - // Verify chat interface appears (not AI response) - await expect( - page.getByRole("textbox", { name: "Type a message..." }) - ).toBeVisible(); - await expect( - page.locator('[data-test-id="copilot-chat-ready"]') - ).toBeVisible(); - }); - - test("[Smoke] Human in the Loop app loads successfully", async ({ page }) => { - await page.goto( - "https://ag2-feature-viewer.vercel.app/feature/human_in_the_loop" - ); - - await expect( - page.getByRole("button", { name: "Human in the loop Plan a task" }) - ).toBeVisible(); - - // Click to open chat - await page - .getByRole("button", { name: "Human in the loop Plan a task" }) - .click(); - - // Verify chat interface appears - await expect( - page.getByRole("textbox", { name: "Type a message..." }) - ).toBeVisible(); - await expect( - page.locator('[data-test-id="copilot-chat-ready"]') - ).toBeVisible(); - }); - - test("[Smoke] CoBankKit loads successfully", async ({ page }) => { - await page.goto("https://co-bank-kit.vercel.app/"); - - // Verify the app loads - just check that the page responds - await expect(page.locator("body")).toBeVisible(); - - // Wait for page to fully load and check for any interactive elements - await page.waitForLoadState("networkidle"); - - // Check for any visible content (more generic) - const hasAnyContent = await page.locator("*").count(); - expect(hasAnyContent).toBeGreaterThan(1); // At least html and body - }); - - test("[Smoke] AG2 feature viewer homepage loads", async ({ page }) => { - await page.goto("https://ag2-feature-viewer.vercel.app/"); - - // Verify the homepage loads - await expect(page.locator("body")).toBeVisible(); - - // Check that we can navigate to features - const hasFeatureLinks = await page.locator("a, button").count(); - expect(hasFeatureLinks).toBeGreaterThan(0); - }); -}); diff --git a/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts b/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts deleted file mode 100644 index 1e03e1e58..000000000 --- a/typescript-sdk/apps/dojo/e2e/tests/vercelAISdkTests/agenticChatPage.spec.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { - test, - expect, - waitForAIResponse, - retryOnAIFailure, -} from "../../test-isolation-helper"; -import { AgenticChatPage } from "../../featurePages/AgenticChatPage"; - -test("[verceAISdkPages] Agentic Chat sends and receives a message", async ({ - page, -}) => { - await retryOnAIFailure(async () => { - await page.goto( - "/vercel-ai-sdk/feature/agentic_chat" - ); - - const chat = new AgenticChatPage(page); - - await chat.openChat(); - await chat.agentGreeting.isVisible; - await chat.sendMessage("Hi, I am duaa"); - - await waitForAIResponse(page); - await chat.assertUserMessageVisible("Hi, I am duaa"); - await chat.assertAgentReplyVisible(/Hello/i); - }); -}); - -test("[Vercel AI SDK] Agentic Chat changes background on message and reset", async ({ - page, -}) => { - await retryOnAIFailure(async () => { - await page.goto( - "/vercel-ai-sdk/feature/agentic_chat" - ); - - const chat = new AgenticChatPage(page); - - await chat.openChat(); - await chat.agentGreeting.waitFor({ state: "visible" }); - - // Store initial background color - const backgroundContainer = page.locator('[data-testid="background-container"]') - const initialBackground = await backgroundContainer.evaluate(el => getComputedStyle(el).backgroundColor); - console.log("Initial background color:", initialBackground); - - // 1. Send message to change background to blue - await chat.sendMessage("Hi change the background color to blue"); - await chat.assertUserMessageVisible( - "Hi change the background color to blue" - ); - await waitForAIResponse(page); - - await expect(backgroundContainer).not.toHaveCSS('background-color', initialBackground, { timeout: 7000 }); - const backgroundBlue = await backgroundContainer.evaluate(el => getComputedStyle(el).backgroundColor); - // Check if background is blue (string color name or contains blue) - expect(backgroundBlue.toLowerCase()).toMatch(/blue|rgb\(.*,.*,.*\)|#[0-9a-f]{6}/); - - // 2. Change to pink - await chat.sendMessage("Hi change the background color to pink"); - await chat.assertUserMessageVisible( - "Hi change the background color to pink" - ); - await waitForAIResponse(page); - - await expect(backgroundContainer).not.toHaveCSS('background-color', backgroundBlue, { timeout: 7000 }); - const backgroundPink = await backgroundContainer.evaluate(el => getComputedStyle(el).backgroundColor); - // Check if background is pink (string color name or contains pink) - expect(backgroundPink.toLowerCase()).toMatch(/pink|rgb\(.*,.*,.*\)|#[0-9a-f]{6}/); - }); -}); - -test("[Vercel AI SDK] Agentic Chat retains memory of user messages during a conversation", async ({ - page, -}) => { - await retryOnAIFailure(async () => { - await page.goto( - "/vercel-ai-sdk/feature/agentic_chat" - ); - - const chat = new AgenticChatPage(page); - await chat.openChat(); - await chat.agentGreeting.click(); - - await chat.sendMessage("Hey there"); - await chat.assertUserMessageVisible("Hey there"); - await waitForAIResponse(page); - await chat.assertAgentReplyVisible(/how can I assist you/i); - - const favFruit = "Mango"; - await chat.sendMessage(`My favorite fruit is ${favFruit}`); - await chat.assertUserMessageVisible(`My favorite fruit is ${favFruit}`); - await waitForAIResponse(page); - await chat.assertAgentReplyVisible(new RegExp(favFruit, "i")); - - await chat.sendMessage("and I love listening to Kaavish"); - await chat.assertUserMessageVisible("and I love listening to Kaavish"); - await waitForAIResponse(page); - await chat.assertAgentReplyVisible(/Kaavish/i); - - await chat.sendMessage("tell me an interesting fact about Moon"); - await chat.assertUserMessageVisible( - "tell me an interesting fact about Moon" - ); - await waitForAIResponse(page); - await chat.assertAgentReplyVisible(/Moon/i); - - await chat.sendMessage("Can you remind me what my favorite fruit is?"); - await chat.assertUserMessageVisible( - "Can you remind me what my favorite fruit is?" - ); - await waitForAIResponse(page); - await chat.assertAgentReplyVisible(new RegExp(favFruit, "i")); - }); -});