Skip to content

E2E Tests

E2E Tests #48

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
# permissions:
# pages: write # to deploy to Pages
# id-token: write # to verify the deployment originates from an appropriate source
# environment:
# name: preview
# url: ${{ steps.deployment.outputs.page_url }}
steps:
- 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
working-directory: ./apps/native/
run: echo "EXPO_PUBLIC_PROJECT_ID=${{ secrets.CLOUD_PROJECT_ID }}" >> .env
- name: Install Playwright Browsers
working-directory: ./apps/native/
run: yarn playwright install chromium
- name: Build SDK
run: |
echo "Building SDK..."
yarn build
- name: Build web app
working-directory: ./apps/native/
run: |
echo "Building web app..."
yarn build:web
# - name: Upload Pages artifact
# uses: actions/upload-pages-artifact@v3
# with:
# path: ./apps/native/dist
# name: github-pages
# - name: Deploy to GitHub Pages
# uses: actions/deploy-pages@v4
# id: deployment
# with:
# artifact_name: github-pages
# preview: true
# # Wait a bit for the deployment to be available
# - name: Wait for deployment
# run: sleep 60
- name: Run Playwright tests
working-directory: ./apps/native/
env:
BASE_URL: ${{ inputs.base-url }}
WALLET_URL: ${{ inputs.wallet-url }}
## Uncomment to see better logs in the terminal
# DEBUG: pw:api
run: |
echo "Running tests against $BASE_URL"
yarn playwright:test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: |
./apps/native/playwright-report/
./apps/native/test-results/
./apps/native/dist/
retention-days: 7