Skip to content

Playwright Tests

Playwright Tests #418

Workflow file for this run

name: Playwright Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "28 5 * * *"
workflow_dispatch:
concurrency:
group: playwright-${{ github.ref }}
cancel-in-progress: true
jobs:
playwright:
name: "Playwright Tests"
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.58.1-noble
env:
NEXT_PUBLIC_WC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WC_PROJECT_ID }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "yarn"
- name: ⚙️ Enable Corepack (Yarn 4)
run: corepack enable
- name: ⚙️ Install dependencies
run: yarn install --immutable
- name: 🔧 Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: 🌐 Start UI
run: |
yarn start:dapp &
echo "Waiting for Next.js to be ready..."
until curl --silent --fail http://localhost:3001 > /dev/null; do
sleep 2
done
echo "Next.js is ready!"
- name: 👝 Download wallets
run: yarn download-wallets
- name: 🖨 Copy test envs
run: cp packages/w3wallets/.env.example packages/w3wallets/.env
- name: 🔨 Build w3wallets
run: yarn build
working-directory: packages/w3wallets
- name: 🗄️ Build wallet cache
run: xvfb-run --auto-servernum --server-args='-screen 0 1280x800x24' npx w3wallets cache tests/wallets-cache/
working-directory: packages/w3wallets
- name: 🧪 Run tests
run: xvfb-run --auto-servernum --server-args='-screen 0 1280x800x24' yarn test:ci
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: |
packages/w3wallets/playwright-report/
packages/w3wallets/test-results/
retention-days: 3