Skip to content

Commit

Permalink
chore: Configure playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
riceball-tw committed Jan 9, 2025
1 parent 6a1c481 commit 07958fb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,33 @@ import { defineConfig } from '@playwright/test'
import type { ConfigOptions } from '@nuxt/test-utils/playwright'

export default defineConfig<ConfigOptions>({
testDir: 'tests/e2e',
webServer: {
command: 'pnpm dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
nuxt: {
rootDir: fileURLToPath(new URL('.', import.meta.url)),
host: 'http://localhost:3000',
},
trace: 'on-first-retry',
},

/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
/* Configure projects for major browsers */
})

0 comments on commit 07958fb

Please sign in to comment.