SPB Git forge

spb/polyllm

Public
15commits 1branches 0releases
2.2 MBsize
maindefault branch
13 days agolast push
TypeScript 97.4% SQL 1% JavaScript 0.9% CSS 0.6%
1.9 KB · 38 lines typescript
Raw Blame History
1import { test, expect } from "@playwright/test";2import { login, readEnv } from "./helpers";34/**5 * Production smoke test — runs against E2E_BASE_URL (https://www.polyllm.io) with an existing,6 * verified account (E2E_EMAIL / E2E_PASSWORD). Adds a real Anthropic key, sends a message and7 * checks that tokens stream back through ngrok. Skipped unless PROD_SMOKE=1.8 */9test.skip(process.env.PROD_SMOKE !== "1", "set PROD_SMOKE=1 to run against production");1011test("production: login → key → real streamed answer", async ({ page }) => {12  const email = process.env.E2E_EMAIL!;13  const password = process.env.E2E_PASSWORD!;14  const key = readEnv("ANTHROPIC_API_KEY")!;15  const errors: string[] = [];16  page.on("pageerror", (e) => errors.push(e.message));1718  await login(page, email, password);19  await page.goto("/app/settings/providers");20  const item = page.locator("li", { has: page.getByRole("heading", { level: 3, name: /^Anthropic$/ }) }).first();21  await item.getByRole("button", { name: /add key|replace key/i }).click();22  await page.locator("#provider-api-key").fill(key);23  await page.getByRole("button", { name: /^connect$|^replace key$/i }).last().click();24  await expect(item).toContainText(/connected/i, { timeout: 60_000 });2526  await page.goto("/app/chat");27  await page.getByRole("button", { name: /select model/i }).click();28  await page.getByLabel(/search models/i).fill("haiku 4.5");29  await page.getByRole("option").first().click();30  await page.getByLabel(/^message$/i).fill("Reply with exactly the word PONG and nothing else.");31  await page.getByRole("button", { name: /^send$/i }).click();32  await expect(page.getByText(/PONG/).first()).toBeVisible({ timeout: 90_000 });33  await page.waitForURL(/\/app\/chat\/cnv_/, { timeout: 30_000 });34  await expect(page.getByText(/tok\/s|\bin ·/).first()).toBeVisible({ timeout: 30_000 });35  await page.screenshot({ path: "qa/out/prod-chat.png" });36  expect(errors).toEqual([]);37});38