Skip to content

Commit

Permalink
Fix local docker test
Browse files Browse the repository at this point in the history
  • Loading branch information
henriksommerfeld committed Feb 3, 2024
1 parent 5a69af5 commit 8853da9
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import { defineConfig, devices } from '@playwright/test'
* See https://playwright.dev/docs/test-configuration.
*/

const webServer = process.env.BASE_URL
? undefined
: {
command: 'npm run start',
url: 'http://127.0.0.1:1313',
reuseExistingServer: true,
}

export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
Expand All @@ -33,7 +25,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.BASE_URL ? process.env.BASE_URL : 'http://127.0.0.1:1313',
baseURL: process.env.BASE_URL ?? 'http://127.0.0.1:1313',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
Expand Down Expand Up @@ -77,5 +69,11 @@ export default defineConfig({
// },
],

...webServer,
webServer: process.env.BASE_URL
? undefined
: {
command: 'npm run start',
url: 'http://127.0.0.1:1313',
reuseExistingServer: true,
},
})

0 comments on commit 8853da9

Please sign in to comment.