Skip to content

E2E Tests

E2E Tests #30

Workflow file for this run

name: UI Tests
on:
workflow_dispatch:
workflow_call:
inputs:
branch:
description: 'The branch to use'
default: 'main'
required: false
type: string
base-url:
description: 'The AppKit App url'
default: 'http://localhost:8081/'
required: false
type: string
wallet-url:
description: 'The wallet url'
default: 'https://react-wallet.walletconnect.com/'
required: false
type: string
secrets:
CLOUD_PROJECT_ID:
required: true
jobs:
ui_tests:
name: 'Playwright Tests'
runs-on: ubuntu-latest
steps:
# Possibly this helps with GitHub-hosted runner network issues, but it's not confirmed
# It's not supported in self-hosted runners, however, so commenting it out for now
# - name: Tune GitHub-hosted runner network
# uses: smorimoto/tune-github-hosted-runner-network@v1
- name: checkout
uses: actions/checkout@v4
with:
repository: reown-com/appkit-react-native
ref: ${{ inputs.branch }}
- name: Setup
uses: ./.github/actions/setup
- name: Create ENV file in apps/native
run: cd apps/native && echo "EXPO_PUBLIC_PROJECT_ID=$CLOUD_PROJECT_ID" >> .env
- name: Install Playwright Browsers
working-directory: ./apps/native/
run: yarn playwright install chromium
- name: Setup Chrome and xvfb
run: |
sudo apt-get update
sudo apt-get install -y google-chrome-stable xvfb
echo "Chrome version:"
google-chrome --version
- name: Build web app
working-directory: ./apps/native/
run: |
echo "Building web app..."
yarn build:web
npm install -g serve
- name: Run Playwright tests
working-directory: ./apps/native/
env:
BASE_URL: ${{ inputs.base-url }}
WALLET_URL: ${{ inputs.wallet-url }}
CLOUD_PROJECT_ID: ${{ secrets.CLOUD_PROJECT_ID }}
DEBUG: pw:api
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH: /usr/bin/google-chrome-stable
CI: false
run: |
echo "Starting tests with xvfb..."
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" yarn playwright test --debug
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: |
./apps/native/playwright-report/
./apps/native/test-results/
retention-days: 7