From 24edc3984795dce3da43e3f4c642d61b1a33bb5d Mon Sep 17 00:00:00 2001 From: taroj1205 Date: Fri, 16 May 2025 13:00:14 +1200 Subject: [PATCH] fix(playwright.config): update web server configuration to use URL - Changed the web server configuration to specify the URL as 'http://localhost:3000' for improved clarity in local development. feat(ci-pipeline): add artifact upload and download steps in CI workflow - Introduced steps to upload the build output as an artifact after the build job. - Added a step to download the build output artifact before running Playwright tests, ensuring the tests have access to the latest build. --- .github/workflows/ci-pipeline.yml | 13 +++++++++++-- playwright.config.ts | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 8a5516c..dcf6114 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -75,6 +75,12 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - name: Build project run: npm run build + - name: Upload build output + uses: actions/upload-artifact@v4 + with: + name: build + path: | + dist playwright: runs-on: ubuntu-latest @@ -96,7 +102,10 @@ jobs: run: npm ci - name: Install Playwright Browsers run: npx playwright install --with-deps - - name: Build project - run: npm run build + - name: Download build output + uses: actions/download-artifact@v4 + with: + name: build + path: dist - name: Run Playwright tests run: npx playwright test \ No newline at end of file diff --git a/playwright.config.ts b/playwright.config.ts index 2b84904..001ad7b 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -66,7 +66,7 @@ export default defineConfig({ /* Run your local dev server before starting the tests */ webServer: { command: process.env.CI ? 'npm run start' : 'npm run dev', - port: 3000, + url: 'http://localhost:3000', reuseExistingServer: !process.env.CI, }, });