Skip to content

Commit

Permalink
chore: Playwright config nits (epicweb-dev#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Jun 20, 2023
1 parent f732097 commit b2e1f8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { devices, type PlaywrightTestConfig } from '@playwright/test'
import { defineConfig, devices } from '@playwright/test'
import 'dotenv/config'

const PORT = process.env.PORT || '3000'

export default {
export default defineConfig({
testDir: './tests/e2e',
timeout: 15 * 1000,
expect: {
Expand All @@ -15,7 +15,6 @@ export default {
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
actionTimeout: 0,
baseURL: `http://localhost:${PORT}/`,
trace: 'on-first-retry',
},
Expand All @@ -30,12 +29,13 @@ export default {
],

webServer: {
command: process.env.CI
? `cross-env PORT=${PORT} npm run start:mocks`
: `cross-env PORT=${PORT} npm run dev`,
command: process.env.CI ? 'npm run start:mocks' : 'npm run dev',
port: Number(PORT),
reuseExistingServer: true,
reuseExistingServer: !process.env.CI,
stdout: 'pipe',
stderr: 'pipe',
env: {
PORT,
},
},
} satisfies PlaywrightTestConfig
})
2 changes: 1 addition & 1 deletion tests/playwright-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const test = base.extend<{
}>({
login: [
async ({ page, baseURL }, use) => {
use(user => loginPage({ page, baseURL, user }))
await use(user => loginPage({ page, baseURL, user }))
},
{ auto: true },
],
Expand Down

0 comments on commit b2e1f8a

Please sign in to comment.