Skip to content

Commit 97fa68a

Browse files
Copilot0xrinegade
andcommitted
Fix E2E test webServer configuration for CI environment
Co-authored-by: 0xrinegade <[email protected]>
1 parent 22a1ee0 commit 97fa68a

File tree

161 files changed

+20
-1289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+20
-1289
lines changed

.github/workflows/build-web.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,23 @@ jobs:
9999
name: web-build-${{ github.sha }}
100100
path: deploy_latest
101101

102+
- name: Setup build directory for E2E tests
103+
run: |
104+
# Copy build artifacts to build directory for serve command
105+
if [ -d "deploy_latest" ]; then
106+
cp -r deploy_latest/* ./build/ 2>/dev/null || cp -r deploy_latest/build/* ./build/ 2>/dev/null || yarn build
107+
else
108+
yarn build
109+
fi
110+
102111
- name: Run tests
103112
run: yarn test --watchAll=false --coverage
104113

105-
- name: Install Playwright
106-
run: yarn playwright:install
114+
- name: Install Playwright Browsers
115+
run: npx playwright install --with-deps
107116

108117
- name: Run E2E tests
109118
run: yarn test:e2e
110-
env:
111-
# Use local build for E2E tests if needed
112-
PLAYWRIGHT_BASE_URL: http://localhost:3000
113119

114120
- name: Upload test results
115121
uses: actions/upload-artifact@v4

playwright.simple.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ export default defineConfig({
2828
],
2929

3030
/* Run local server for testing */
31-
webServer: process.env.PLAYWRIGHT_BASE_URL ? undefined : {
32-
command: 'serve -s build -l 3000',
31+
webServer: (process.env.PLAYWRIGHT_BASE_URL && !process.env.PLAYWRIGHT_BASE_URL.includes('localhost')) ? undefined : {
32+
command: 'yarn build && npx serve -s build -l 3000',
3333
url: 'http://localhost:3000',
34-
reuseExistingServer: true,
34+
reuseExistingServer: !process.env.CI,
3535
timeout: 120 * 1000, // 2 minutes
3636
},
3737
});

test-results/.last-run.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"status": "failed",
3+
"failedTests": [
4+
"067308f7a182f644af2c-63c596e145e953d5d7ff"
5+
]
6+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)