E2E Tests #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:3000/' | |
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 | |
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: Build SDK | |
run: | | |
echo "Building SDK..." | |
yarn build | |
- name: Install Playwright Browsers | |
working-directory: ./apps/native/ | |
run: yarn playwright install chromium | |
- 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 | |
with: | |
artifact_name: github-pages | |
preview: true | |
# Wait a bit for the deployment to be available | |
- name: Wait for deployment | |
run: sleep 30 | |
- name: Run Playwright tests | |
working-directory: ./apps/native/ | |
env: | |
BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/preview/${{ github.sha }} | |
WALLET_URL: ${{ inputs.wallet-url }} | |
CLOUD_PROJECT_ID: ${{ secrets.CLOUD_PROJECT_ID }} | |
DEBUG: pw:api | |
run: | | |
echo "Running tests against $BASE_URL" | |
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 |