Files
copilotkit__copilotkit/examples/showcases/banking/playwright.config.ts
Maxim 8efd6ecb33 test(saas-demo): Playwright smoke test for golden path
Adds a CI-safe Playwright smoke test that verifies the banking showcase
boots and the CopilotKit v2 popup opens with its configured suggestion
pills, without invoking the agent (so it runs in CI without secrets).

Covers:
  - Document title shows the Northwind Finance brand
  - Credit-cards dashboard renders ("Credit Cards" heading)
  - CopilotPopup launcher opens the dialog (Northwind Copilot)
  - Three suggestion pills render: View transactions, Add a card,
    Assign a policy

The dev server gets a dummy OPENAI_API_KEY so the runtime route boots,
but the test never sends a chat message or clicks a suggestion.

.gitignore: ignore test-results/, playwright-report/, and
tsconfig.tsbuildinfo so they don't become clutter.
2026-06-03 11:27:25 +02:00

26 lines
933 B
TypeScript

import { defineConfig } from "@playwright/test";
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: "list",
use: { baseURL: "http://localhost:3000", trace: "on-first-retry" },
webServer: {
command: "pnpm dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: {
// The runtime route imports BuiltInAgent which requires OPENAI_API_KEY at
// module load. The smoke test never invokes the agent — it only checks
// that the page renders and the popup opens — but the dev server needs
// *some* value here to boot the API route without crashing. Tests must
// remain LLM-free; we only set this so the Next.js server starts.
OPENAI_API_KEY: process.env.OPENAI_API_KEY ?? "test",
NEXT_TELEMETRY_DISABLED: "1",
},
},
});