Skip to content

Commit 52cebbd

Browse files
committed
dynamic port based on package so we can run in parallel
1 parent 9282ab6 commit 52cebbd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

tests/app/server.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,10 @@ app.post('/json', (req, res) => res.json({ foo: 'bar' }))
318318

319319
app.all('*', (req, res) => inertia.render(req, res))
320320

321-
app.listen(13715)
321+
const adapterPorts = {
322+
vue3: 13715,
323+
react: 13716,
324+
svelte: 13717,
325+
}
326+
327+
app.listen(adapterPorts[process.env.PACKAGE || 'vue3'])

tests/playwright.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { defineConfig, devices } from '@playwright/test'
22
import path from 'path'
33

4+
const adapterPorts = {
5+
vue3: 13715,
6+
react: 13716,
7+
svelte: 13717,
8+
}
9+
410
/**
511
* Read environment variables from file.
612
* https://github.com/motdotla/dotenv
@@ -26,7 +32,7 @@ export default defineConfig({
2632
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2733
use: {
2834
/* Base URL to use in actions like `await page.goto('/')`. */
29-
baseURL: 'http://localhost:13715',
35+
baseURL: `http://localhost:${adapterPorts[process.env.PACKAGE || 'vue3']}`,
3036

3137
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
3238
trace: 'on-first-retry',

0 commit comments

Comments
 (0)