Files
moreminimore-vibe/e2e-tests/setup.spec.ts
Will Chen 7150082f5a Add OpenRouter to setup banner (#1242)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Added OpenRouter as a first-class option in the setup banner and
introduced a reusable provider card component. This streamlines provider
selection and adds E2E coverage for the setup flow.

- **New Features**
- Added SetupProviderCard and used it for Google and OpenRouter in
SetupBanner.
- Clicking Google or OpenRouter routes to the correct provider settings
and logs PostHog events.
  - Kept “Other providers” link to Settings.
- Added setup.spec.ts E2E test to verify Google, OpenRouter, and Other
navigation; introduced test config flag showSetupScreen to control the
OPENAI_API_KEY shortcut.

<!-- End of auto-generated description by cubic. -->
2025-09-10 13:00:31 -07:00

32 lines
1022 B
TypeScript

import { testWithConfig } from "./helpers/test_helper";
import { expect } from "@playwright/test";
const testSetup = testWithConfig({
showSetupScreen: true,
});
testSetup("setup ai provider", async ({ po }) => {
await po.page
.getByRole("button", { name: "Setup Google Gemini API Key" })
.click();
await expect(
po.page.getByRole("heading", { name: "Configure Google" }),
).toBeVisible();
expect(po.page.url()).toEqual("file:///providers/google");
await po.page.getByRole("button", { name: "Go Back" }).click();
await po.page
.getByRole("button", { name: "Setup OpenRouter API Key Free" })
.click();
await expect(
po.page.getByRole("heading", { name: "Configure OpenRouter" }),
).toBeVisible();
expect(po.page.url()).toEqual("file:///providers/openrouter");
await po.page.getByRole("button", { name: "Go Back" }).click();
await po.page
.getByRole("button", { name: "Setup other AI providers" })
.click();
expect(po.page.url()).toEqual("file:///settings");
});