Skip to content

E2E WalletKit - All - Tags: pay #1779

E2E WalletKit - All - Tags: pay

E2E WalletKit - All - Tags: pay #1779

name: 🧪 WalletKit - E2E Tests
# The "(skip-metrics)" suffix is consumed by the E2E KPI metrics job (WalletConnect/actions)
# to exclude those runs from stats. Don't change/remove it.
# The platform label mirrors which jobs actually run (see each job's `if:`):
# dispatch = the selected checkboxes ("All" if all three); 6h cron = Android
# only; PR/push/daily = All.
run-name: "E2E WalletKit -${{ github.event_name == 'workflow_dispatch' && (inputs.android && inputs.ios && inputs.web && ' All' || format('{0}{1}{2}', inputs.android && ' Android' || '', inputs.ios && ' iOS' || '', inputs.web && ' Web' || '')) || (github.event_name == 'schedule' && github.event.schedule == '0 */6 * * *' && ' Android' || ' All') }} - Tags: ${{ inputs.maestro-tags || 'pay' }}${{ ((github.event_name == 'pull_request' && github.event.pull_request.draft) || (github.event_name == 'workflow_dispatch' && github.ref_name != 'main')) && ' (skip-metrics)' || '' }}"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '0 */6 * * *' # Every 6 hours, UTC — cheap canary (Android + balance check)
- cron: '0 9 * * *' # Once daily, UTC — also runs the expensive iOS E2E
pull_request:
branches: [main]
# Include the defaults (opened/synchronize/reopened) plus ready_for_review so
# E2E auto-runs when a draft PR is promoted to ready (the draft-PR `if:` guards
# on each job skip runs while it's still a draft).
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'wallets/rn_cli_wallet/**'
- '.maestro/**'
- '.github/actions/walletkit-build-and-maestro/**'
- '.github/workflows/ci_e2e_walletkit.yaml'
push:
branches: [main]
paths:
- 'wallets/rn_cli_wallet/**'
- '.maestro/**'
- '.github/actions/walletkit-build-and-maestro/**'
- '.github/workflows/ci_e2e_walletkit.yaml'
workflow_dispatch:
inputs:
maestro-tags:
description: 'Maestro test tags to run (comma-separated)'
required: false
default: 'pay'
type: string
# Boolean inputs render as checkboxes in the dispatch UI. On non-dispatch
# triggers (schedule/pr/push) inputs are unset, so the job `if:`s gate on
# the event type instead (see each job).
android:
description: 'Run Android E2E'
required: false
default: true
type: boolean
ios:
description: 'Run iOS E2E'
required: false
default: true
type: boolean
web:
description: 'Run Web E2E'
required: false
default: true
type: boolean
env:
MAESTRO_TAGS: ${{ inputs.maestro-tags || 'pay' }}
jobs:
check-balance:
# Skip the faucet/balance check on draft PRs too — the E2E jobs that need it
# are skipped while a PR is a draft, so there's nothing to check for.
# Dependabot PRs can't read repo secrets (wallet env, faucet webhook), so the
# E2E jobs would always fail — skip the whole workflow for them.
if: >-
github.actor != 'dependabot[bot]'
&& (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
uses: ./.github/workflows/e2e-balance-check.yml
secrets:
SLACK_FAUCETBOT_WEBHOOK_URL: ${{ secrets.SLACK_FAUCETBOT_WEBHOOK_URL }}
e2e-ios:
needs: check-balance
# Balance alert should not block tests. On schedule, iOS (macOS, expensive)
# runs only on the once-daily cron; the 6h cadence stays Android-only. On
# dispatch, gated by the `ios` checkbox.
# `!cancelled()` (not `always()`): still runs when check-balance fails, but a
# job-level `always()` makes GitHub ignore Cancel, so the run keeps going to the end.
if: >-
!cancelled()
&& github.actor != 'dependabot[bot]'
&& (github.event_name != 'workflow_dispatch' || inputs.ios)
&& (github.event_name != 'schedule' || github.event.schedule == '0 9 * * *')
&& (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
name: E2E Tests - iOS
runs-on: macos-latest-xlarge
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build wallet and run Maestro tests (iOS)
id: walletkit
uses: ./.github/actions/walletkit-build-and-maestro
with:
platform: ios
pay-core-url: https://api.pay.walletconnect.com
wallet-env-file: ${{ secrets.WALLETKIT_ENV_FILE }}
wallet-private-key: ${{ secrets.TEST_WALLET_PRIVATE_KEY }}
merchant-api-key-single-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_SINGLE_NOKYC }}
merchant-id-single-nokyc: ${{ secrets.WPAY_MERCHANT_ID_SINGLE_NOKYC }}
merchant-api-key-multi-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_NOKYC }}
merchant-id-multi-nokyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_NOKYC }}
merchant-api-key-multi-kyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_KYC }}
merchant-id-multi-kyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_KYC }}
maestro-tags: ${{ env.MAESTRO_TAGS }}
- name: Send Slack notification
if: failure()
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "E2E Test Report - iOS - WalletKit",
"blocks": [
{
"type": "header",
"text": { "type": "plain_text", "text": "🧪 E2E Test Report - iOS (${{ env.MAESTRO_TAGS }})" }
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Project:*\n`WalletKit RN`" },
{ "type": "mrkdwn", "text": "*Platform:*\n`iOS`" },
{ "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" },
{ "type": "mrkdwn", "text": "*Trigger:*\n`${{ github.event_name }}`" }
]
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Maestro Tests:*\n`${{ steps.walletkit.outputs.maestro-outcome == 'success' && '✅ Passed' || '❌ Failed' }}`" },
{ "type": "mrkdwn", "text": "*Overall Status:*\n`${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}`" }
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": { "type": "plain_text", "text": "View Workflow Run" },
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
},
{
"type": "button",
"text": { "type": "plain_text", "text": "Download Artifacts" },
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts"
}
]
}
]
}
e2e-android:
needs: check-balance
# Balance alert should not block tests. Android runs on every trigger (it's
# the cheap 6h canary); on dispatch, gated by the `android` checkbox.
if: >-
!cancelled() && github.actor != 'dependabot[bot]'
&& (github.event_name != 'workflow_dispatch' || inputs.android)
&& (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
name: E2E Tests - Android
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build wallet and run Maestro tests (Android)
id: walletkit
uses: ./.github/actions/walletkit-build-and-maestro
with:
platform: android
pay-core-url: https://api.pay.walletconnect.com
wallet-env-file: ${{ secrets.WALLETKIT_ENV_FILE }}
wallet-private-key: ${{ secrets.TEST_WALLET_PRIVATE_KEY }}
merchant-api-key-single-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_SINGLE_NOKYC }}
merchant-id-single-nokyc: ${{ secrets.WPAY_MERCHANT_ID_SINGLE_NOKYC }}
merchant-api-key-multi-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_NOKYC }}
merchant-id-multi-nokyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_NOKYC }}
merchant-api-key-multi-kyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_KYC }}
merchant-id-multi-kyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_KYC }}
maestro-tags: ${{ env.MAESTRO_TAGS }}
android-secrets-file: ${{ secrets.ANDROID_SECRETS_FILE }}
android-keystore-base64: ${{ secrets.WC_INTERNAL_KEYSTORE }}
android-keystore-name: ${{ vars.WC_INTERNAL_KEYSTORE_NAME }}
- name: Send Slack notification
if: failure()
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "E2E Test Report - Android - WalletKit",
"blocks": [
{
"type": "header",
"text": { "type": "plain_text", "text": "🧪 E2E Test Report - Android (${{ env.MAESTRO_TAGS }})" }
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Project:*\n`WalletKit RN`" },
{ "type": "mrkdwn", "text": "*Platform:*\n`Android`" },
{ "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" },
{ "type": "mrkdwn", "text": "*Trigger:*\n`${{ github.event_name }}`" }
]
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Maestro Tests:*\n`${{ steps.walletkit.outputs.maestro-outcome == 'success' && '✅ Passed' || '❌ Failed' }}`" },
{ "type": "mrkdwn", "text": "*Overall Status:*\n`${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}`" }
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": { "type": "plain_text", "text": "View Workflow Run" },
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
},
{
"type": "button",
"text": { "type": "plain_text", "text": "Download Artifacts" },
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts"
}
]
}
]
}
e2e-web:
needs: check-balance
# Web (react-native-web) runs on pr/push + the daily cron + dispatch (if the
# `web` checkbox is set). Cheap (ubuntu), so kept off the 6h Android canary
# for parity with iOS's daily-only schedule gate.
if: >-
!cancelled()
&& github.actor != 'dependabot[bot]'
&& (github.event_name != 'workflow_dispatch' || inputs.web)
&& (github.event_name != 'schedule' || github.event.schedule == '0 9 * * *')
&& (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
name: E2E Tests - Web
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build wallet and run Maestro tests (Web)
id: walletkit
uses: ./.github/actions/walletkit-build-and-maestro
with:
platform: web
pay-core-url: https://api.pay.walletconnect.com
wallet-env-file: ${{ secrets.WALLETKIT_ENV_FILE }}
wallet-private-key: ${{ secrets.TEST_WALLET_PRIVATE_KEY }}
merchant-api-key-single-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_SINGLE_NOKYC }}
merchant-id-single-nokyc: ${{ secrets.WPAY_MERCHANT_ID_SINGLE_NOKYC }}
merchant-api-key-multi-nokyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_NOKYC }}
merchant-id-multi-nokyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_NOKYC }}
merchant-api-key-multi-kyc: ${{ secrets.WPAY_CUSTOMER_KEY_MULTI_KYC }}
merchant-id-multi-kyc: ${{ secrets.WPAY_MERCHANT_ID_MULTI_KYC }}
maestro-tags: ${{ env.MAESTRO_TAGS }}
- name: Send Slack notification
if: failure()
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "E2E Test Report - Web - WalletKit",
"blocks": [
{
"type": "header",
"text": { "type": "plain_text", "text": "🧪 E2E Test Report - Web (${{ env.MAESTRO_TAGS }})" }
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Project:*\n`WalletKit RN`" },
{ "type": "mrkdwn", "text": "*Platform:*\n`Web`" },
{ "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" },
{ "type": "mrkdwn", "text": "*Trigger:*\n`${{ github.event_name }}`" }
]
},
{
"type": "section",
"fields": [
{ "type": "mrkdwn", "text": "*Maestro Tests:*\n`${{ steps.walletkit.outputs.maestro-outcome == 'success' && '✅ Passed' || '❌ Failed' }}`" },
{ "type": "mrkdwn", "text": "*Overall Status:*\n`${{ job.status == 'success' && '✅ Success' || '❌ Failed' }}`" }
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": { "type": "plain_text", "text": "View Workflow Run" },
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
},
{
"type": "button",
"text": { "type": "plain_text", "text": "Download Artifacts" },
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts"
}
]
}
]
}