import { test, expect } from "@playwright/test"; test.describe("Developer section", () => { test("agents page loads with sub-nav tabs", async ({ page }) => { await page.goto("/developer/agents"); await page.waitForSelector(".developer-shell", { timeout: 15_000 }); const nav = page.locator(".sub-nav"); await expect(nav.locator("a", { hasText: "Agents" })).toBeVisible(); await expect(nav.locator("a", { hasText: "Flow" })).toBeVisible(); await expect(nav.locator("a", { hasText: "Analytics" })).toBeVisible(); }); test("agents page shows Not Configured when URL is empty", async ({ page, }) => { await page.goto("/developer/agents"); await page.waitForSelector(".placeholder-page", { timeout: 15_000 }); await expect(page.locator(".placeholder-badge")).toContainText( "Not Configured" ); await expect(page.locator("h2")).toContainText("Agent Builder"); }); test("analytics page shows Not Configured when URL is empty", async ({ page, }) => { await page.goto("/developer/analytics"); await page.waitForSelector(".placeholder-page", { timeout: 15_000 }); await expect( page.locator("h2", { hasText: "Analytics" }) ).toBeVisible(); await expect(page.locator(".placeholder-badge")).toContainText( "Not Configured" ); }); test("agents page shows iframe when URL is configured", async ({ page, }) => { // This test only runs meaningfully when LANGGRAPH_URL is set in the // environment. When empty, the placeholder is shown instead. await page.goto("/developer/agents"); await page.waitForTimeout(2000); const iframe = page.locator(".tool-embed-iframe"); const placeholder = page.locator(".placeholder-badge"); if (await placeholder.isVisible()) { await expect(placeholder).toContainText("Not Configured"); } else { await expect(iframe).toBeVisible(); await expect( page.locator(".tool-embed-popout-btn") ).toBeVisible(); } }); });