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"
|
||||
|
||||
const SECOND = 1000
|
||||
const baseURL = "http://localhost:3000"
|
||||
import { createConfig } from "@developomp-site/playwright-config"
|
||||
|
||||
// https://playwright.dev/docs/test-configuration
|
||||
export default defineConfig({
|
||||
// Artifacts folder where screenshots, videos, and traces are stored.
|
||||
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,
|
||||
},
|
||||
export default createConfig({
|
||||
port: 3000,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue