refactor: improve playwright config reuse

This commit is contained in:
Kim, Jimin 2024-04-28 00:50:49 +09:00
parent a5f17126b9
commit d715961fc4
Signed by: pomp
GPG key ID: 2B516173EDD492EB

View file

@ -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,
},
}) })