diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07058ad..1226bb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: - main jobs: - build-and-test: + test-and-build: runs-on: ubuntu-latest steps: - name: Checkout code @@ -29,7 +29,7 @@ jobs: - name: Build project run: npm run build - playwright: + e2e-test: name: 'Playwright Tests' runs-on: ubuntu-latest steps: @@ -42,7 +42,7 @@ jobs: - name: Install Playwright Browsers run: npx playwright install --with-deps - name: Run Playwright tests - run: npm run test:e2e:run + run: npx playwright test - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: @@ -51,7 +51,9 @@ jobs: retention-days: 30 deploy: if: github.ref == 'refs/heads/main' - needs: build-and-test + needs: + - test-and-build + - playwright runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6f06c8c..6bdd64d 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,7 +5,9 @@ + + diff --git a/playwright.config.ts b/playwright.config.ts index 8672300..42723ec 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,5 +1,7 @@ import { defineConfig, devices } from '@playwright/test'; +const baseUrl = process.env.BASE_URL || 'http://localhost:5050'; + export default defineConfig({ testDir: './src', testMatch: /\.e2e\.(spec\.)?ts$/, @@ -9,6 +11,10 @@ export default defineConfig({ baseURL: 'http://localhost:5173', trace: 'on-first-retry' }, + webServer: { + command: 'npm run preview', + url: 'http://localhost:4173' + }, projects: [ { name: 'chromium',