Skip to content

Commit 8eaa396

Browse files
committed
Fix playwright for vite
Fix port, as vite runs under a different port per default. Also fix the environment variable path.
1 parent 56a6094 commit 8eaa396

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/playwright-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Prepare configuration
3535
run: >
3636
sed -i
37-
's_https://develop.opencast.org_http://localhost:3000_'
37+
's_https://develop.opencast.org_http://localhost:5173_'
3838
public/editor-settings.toml
3939
4040
- name: Prepare mock files
@@ -46,7 +46,7 @@ jobs:
4646
cp public/editor-settings.toml build/
4747
4848
- name: Use production build for testing
49-
run: sed -i 's/npm run start/python -m http.server --bind 127.0.0.1 --directory build 3000/' playwright.config.ts
49+
run: sed -i 's/npm run start/python -m http.server --bind 127.0.0.1 --directory build 5173/' playwright.config.ts
5050

5151
- name: Run playwright-test
5252
run: npx playwright test --config=playwright.config.ts

playwright.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ import { PlaywrightTestConfig, devices } from '@playwright/test';
33
const config: PlaywrightTestConfig = {
44

55
reporter: [
6-
[import.meta.env.CI ? 'github' : 'list'],
6+
[process.env.CI ? 'github' : 'list'],
77
['html', { outputFolder: 'playwright-report' }],
88
],
99
testIgnore: '**/redux/**',
1010
retries: 1,
1111
timeout: 60 * 1000,
1212

1313
use: {
14-
baseURL: 'http://localhost:3000/',
14+
baseURL: 'http://localhost:5173/',
1515
headless: true,
1616
screenshot: 'only-on-failure',
1717
},
1818

1919
webServer: {
2020
command: 'npm run start',
21-
port: 3000,
21+
port: 5173,
2222
timeout: 120 * 1000,
23-
reuseExistingServer: !import.meta.env.CI,
23+
reuseExistingServer: !process.env.CI,
2424
},
2525

2626
projects: [

0 commit comments

Comments
 (0)