Skip to content

Commit

Permalink
fix(playwright): use npm run to start the server on default port (#540
Browse files Browse the repository at this point in the history
)

Also use conditional baseURL depending on CI variable
  • Loading branch information
zetaraku authored Jul 10, 2024
1 parent 79cfc72 commit cf3f7a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions template/config/playwright/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineConfig({
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:5173',
baseURL: process.env.CI ? 'http://localhost:4173' : 'http://localhost:5173',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
Expand Down Expand Up @@ -103,8 +103,8 @@ export default defineConfig({
* Use the preview server on CI for more realistic testing.
* Playwright will re-use the local server if there is already a dev-server running.
*/
command: process.env.CI ? 'vite preview --port 5173' : 'vite dev',
port: 5173,
command: process.env.CI ? 'npm run preview' : 'npm run dev',
port: process.env.CI ? 4173 : 5173,
reuseExistingServer: !process.env.CI
}
})

0 comments on commit cf3f7a7

Please sign in to comment.