refactor: improve playwright config reuse
This commit is contained in:
parent
a5f17126b9
commit
d715961fc4
1 changed files with 3 additions and 20 deletions
|
@ -1,23 +1,6 @@
|
||||||
import { defineConfig } from "@playwright/test"
|
import { createConfig } from "@developomp-site/playwright-config"
|
||||||
|
|
||||||
const SECOND = 1000
|
|
||||||
const baseURL = "http://localhost:3000"
|
|
||||||
|
|
||||||
// https://playwright.dev/docs/test-configuration
|
// https://playwright.dev/docs/test-configuration
|
||||||
export default defineConfig({
|
export default createConfig({
|
||||||
// Artifacts folder where screenshots, videos, and traces are stored.
|
port: 3000,
|
||||||
outputDir: "test-results/",
|
|
||||||
|
|
||||||
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
|
||||||
webServer: {
|
|
||||||
command: "pnpm dev:headless",
|
|
||||||
url: baseURL,
|
|
||||||
timeout: 10 * SECOND,
|
|
||||||
},
|
|
||||||
|
|
||||||
use: {
|
|
||||||
// Use baseURL so to make navigation relative.
|
|
||||||
// https://playwright.dev/docs/api/class-testoptions#test-options-base-url
|
|
||||||
baseURL,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue