Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 232 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
name: E2E Tests

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
e2e:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright browsers
run: pnpm playwright install --with-deps ${{ matrix.browser }}

- name: Build demo application
run: pnpm demo:build

- name: Run E2E tests
run: pnpm test:e2e --project=${{ matrix.browser }}
env:
CI: true

- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.browser }}
path: playwright-report/
retention-days: 7

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.browser }}
path: test-results/
retention-days: 7

e2e-mobile:
name: E2E Tests (Mobile)
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
device: [mobile-chrome, mobile-safari]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright browsers
run: pnpm playwright install --with-deps chromium webkit

- name: Build demo application
run: pnpm demo:build

- name: Run E2E tests (Mobile)
run: pnpm test:e2e --project=${{ matrix.device }}
env:
CI: true

- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.device }}
path: playwright-report/
retention-days: 7

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.device }}
path: test-results/
retention-days: 7

e2e-accessibility:
name: Accessibility Tests
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright browsers
run: pnpm playwright install --with-deps chromium

- name: Build demo application
run: pnpm demo:build

- name: Run accessibility tests
run: pnpm playwright test e2e/accessibility/
env:
CI: true

- name: Upload accessibility report
if: failure()
uses: actions/upload-artifact@v4
with:
name: accessibility-report
path: playwright-report/
retention-days: 30

- name: Comment PR with accessibility results
if: github.event_name == 'pull_request' && failure()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '⚠️ Accessibility tests failed. Please review the [accessibility report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).'
})

e2e-summary:
name: E2E Test Summary
runs-on: ubuntu-latest
needs: [e2e, e2e-mobile, e2e-accessibility]
if: always()

steps:
- name: Check test results
run: |
if [ "${{ needs.e2e.result }}" == "failure" ] || [ "${{ needs.e2e-mobile.result }}" == "failure" ] || [ "${{ needs.e2e-accessibility.result }}" == "failure" ]; then
echo "Some E2E tests failed"
exit 1
else
echo "All E2E tests passed"
fi
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_modules/
dist/
build/
.svelte-kit/
package/

# Environment files
.env
Expand Down Expand Up @@ -65,4 +66,9 @@ dev/

# Form uploads (sensitive)
uploads/
temp/
temp/

# Playwright
/playwright-report/
/playwright/.cache/
/test-results/
Loading
Loading