Skip to content

add ue5.5 specialist #98

add ue5.5 specialist

add ue5.5 specialist #98

name: Playwright CLI & Visual Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1/4, 2/4, 3/4, 4/4]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Create test directories
run: |
mkdir -p .playwright/baseline
mkdir -p test-results
- name: Run CLI tests
run: npx playwright test tests/cli-playwright.spec.js --shard=${{ matrix.shard }}
- name: Run Visual Regression tests
run: npx playwright test tests/visual-regression.spec.js --shard=${{ matrix.shard }}
- name: Upload blob report
if: always()
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ strategy.job-index }}
path: blob-report/
retention-days: 7
- name: Upload visual diffs
if: failure()
uses: actions/upload-artifact@v4
with:
name: visual-diffs-${{ strategy.job-index }}
path: test-results/
retention-days: 7
merge-reports:
if: always()
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Download blob reports
uses: actions/download-artifact@v4
with:
pattern: blob-report-*
merge-multiple: true
path: all-blob-reports/
- name: Merge reports
run: npx playwright merge-reports all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload visual regression report
if: failure()
uses: actions/upload-artifact@v4
with:
name: visual-regression-report
path: test-results/visual-report.html
retention-days: 7
update-baselines:
if: github.ref == 'refs/heads/main' && success()
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps chromium
- name: Update visual baselines
run: |
UPDATE_SNAPSHOTS=true npx playwright test tests/visual-regression.spec.js
- name: Commit updated baselines
run: |
if [ -n "$(git status --porcelain .playwright/baseline/)" ]; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .playwright/baseline/
git commit -m "📸 Update visual regression baselines
- Updated from main branch
- Run ID: ${{ github.run_id }}"
git push
else
echo "No baseline changes detected"
fi
document-patterns:
if: github.ref == 'refs/heads/main' && failure()
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Document test failures
run: |
mkdir -p .ai/memory/patterns/testing
DATE=$(date +%Y-%m-%d)
PATTERN_FILE=".ai/memory/patterns/testing/test-failures-${DATE}.md"
# Only document if not already documented today
if [ ! -f "${PATTERN_FILE}" ]; then
cat > ${PATTERN_FILE} << EOF
---
source: playwright-test-failures
created_by: ci
created_at: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
test_run: ${{ github.run_id }}
---
# Test Failure Patterns
## Failed Test Run: ${{ github.run_id }}
### Failure Context
- Branch: ${{ github.ref }}
- Commit: ${{ github.sha }}
- Time: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
### Investigation Required
- Check test artifacts for details
- Review visual diffs if available
- Analyze failure patterns for flakiness
### Common Failure Causes
1. Timing issues in CI environment
2. Visual baseline drift
3. Platform-specific behavior
4. Resource constraints
EOF
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .ai/memory/patterns/testing/
git commit -m "📝 Document test failure patterns
- Test run: ${{ github.run_id }}
- Investigation required"
git push
fi