|
| 1 | +import { defineConfig, devices } from "@playwright/test"; |
| 2 | +import type { IntentOptions, IntentUseOptions } from "playwright-intent"; |
| 3 | +import { allow, commit, fileStore } from "playwright-intent/file-store"; |
| 4 | +import { baseURL } from "./playwright.config"; |
| 5 | + |
| 6 | +// Steps live in .intent and are committed like any other code. Locally the |
| 7 | +// agent writes changed steps to disk for you to review. On a pull request it |
| 8 | +// commits them to the branch, so the change shows up in the diff. |
| 9 | +const intent = { |
| 10 | + store: fileStore({ updates: { local: allow(), ci: commit() } }), |
| 11 | + model: "openai/gpt-6-luna", |
| 12 | +} satisfies IntentOptions; |
| 13 | + |
| 14 | +export default defineConfig<IntentUseOptions>({ |
| 15 | + testDir: "./tests-intent", |
| 16 | + outputDir: "./test-results-intent", |
| 17 | + timeout: 120_000, |
| 18 | + // A repaired step can leave the page in a changed state, so the retry |
| 19 | + // replays the test from the start with the new step. |
| 20 | + retries: 2, |
| 21 | + reporter: [["list"], ["playwright-intent/reporter", intent]], |
| 22 | + use: { |
| 23 | + ...devices["Desktop Chrome"], |
| 24 | + baseURL, |
| 25 | + extraHTTPHeaders: process.env.VERCEL_BYPASS_TOKEN |
| 26 | + ? { |
| 27 | + "x-vercel-protection-bypass": process.env.VERCEL_BYPASS_TOKEN, |
| 28 | + "x-vercel-set-bypass-cookie": "true", |
| 29 | + } |
| 30 | + : undefined, |
| 31 | + trace: "on", |
| 32 | + intent, |
| 33 | + }, |
| 34 | +}); |
0 commit comments