diff --git a/.github/actions/ci-setup-android-files/action.yml b/.github/actions/ci-setup-android-files/action.yml new file mode 100644 index 000000000..1ddcdf980 --- /dev/null +++ b/.github/actions/ci-setup-android-files/action.yml @@ -0,0 +1,58 @@ +name: 'Setup Android Files' +description: 'Setup required files for building an Android project' + +inputs: + root-path: + description: 'Path of the react-native project' + required: true + google-services-file: + description: 'Google Services Json file content, base64 encoded' + required: false + secrets-file: + description: 'Secrets properties file content' + required: true + keystore: + description: 'Keystore file content, base64 encoded' + required: true + keystore-name: + description: 'Keystore file name' + required: true + sentry-file: + description: 'Sentry file content' + required: true + project-id: + description: 'Reown Cloud ID' + required: true + relay-url: + description: 'Relay URL' + required: true + sentry-dsn: + description: 'Sentry DSN' + required: true + release-type: + description: 'Release type of the project (debug/internal/production)' + default: 'debug' + +runs: + using: "composite" + steps: + - name: Create Google Services Json File + if: ${{ inputs.google-services-file != '' }} + shell: bash + run: echo "${{ inputs.google-services-file }}" | base64 --decode > ${{ inputs.root-path }}/android/app/google-services.json + + - name: Create secrets.properties File + shell: bash + run: echo "${{ inputs.secrets-file }}" > ${{ inputs.root-path }}/android/secrets.properties + + - name: Decode Keystore + shell: bash + run: echo "${{ inputs.keystore }}" | base64 --decode > ${{ inputs.root-path }}/android/app/${{ inputs.keystore-name }}.keystore + + - name: Create Sentry File + shell: bash + run: echo "${{ inputs.sentry-file }}" > ${{ inputs.root-path }}/android/sentry.properties + + - name: Create Env File + shell: bash + run: echo -e "ENV_PROJECT_ID=${{ inputs.project-id }}\nENV_RELAY_URL=${{ inputs.relay-url }}\nENV_SENTRY_DSN=${{ inputs.sentry-dsn }}\nENV_SENTRY_TAG=${{ inputs.release-type }}" >> ${{ inputs.root-path }}/.env.${{ inputs.release-type }} \ No newline at end of file diff --git a/.github/actions/ci-setup-ios-files/action.yml b/.github/actions/ci-setup-ios-files/action.yml new file mode 100644 index 000000000..c3007b92e --- /dev/null +++ b/.github/actions/ci-setup-ios-files/action.yml @@ -0,0 +1,41 @@ +name: 'Setup iOS Files' +description: 'Setup required files for building an iOS project' + +inputs: + root-path: + description: 'Path of the react-native project' + required: true + google-services-file: + description: 'Google Services Plist file content, base64 encoded' + required: false + sentry-file: + description: 'Sentry file content' + required: true + project-id: + description: 'WalletConnect Cloud ID' + required: true + relay-url: + description: 'WalletConnect Relay URL' + required: false + sentry-dsn: + description: 'Sentry DSN' + required: true + release-type: + description: 'Release type of the project (debug/internal/production)' + default: 'debug' + +runs: + using: "composite" + steps: + - name: Create .env file + shell: bash + run: echo -e "ENV_PROJECT_ID=${{ inputs.project-id }}\nENV_RELAY_URL=${{ inputs.relay-url }}\nENV_SENTRY_DSN=${{ inputs.sentry-dsn }}\nENV_SENTRY_TAG=${{ inputs.release-type }}" >> ${{ inputs.root-path }}/.env.${{ inputs.release-type }} + + - name: Create sentry.properties file + shell: bash + run: echo "${{ inputs.sentry-file }}" > ${{ inputs.root-path }}/ios/sentry.properties + + - name: Create GoogleService-Info.plist file + if: ${{ inputs.google-services-file != '' }} + shell: bash + run: echo "${{ inputs.google-services-file }}" | base64 --decode > ${{ inputs.root-path }}/ios/GoogleService-Info.plist \ No newline at end of file diff --git a/.github/workflows/ci_e2e_tests_android.yaml b/.github/workflows/ci_e2e_tests_android.yaml index 80473c7ef..379a3a8c7 100644 --- a/.github/workflows/ci_e2e_tests_android.yaml +++ b/.github/workflows/ci_e2e_tests_android.yaml @@ -5,11 +5,251 @@ permissions: on: workflow_dispatch: + pull_request: + paths: + - 'wallets/rn_cli_wallet/**' + - 'dapps/W3MWagmi/**' + - '.maestro/**' + - '.github/workflows/ci_e2e_tests_android.yaml' + - '.github/actions/ci-setup/**' + - '.github/actions/ci-setup-android-files/**' + +permissions: + contents: read jobs: - placeholder: - name: Placeholder Job + build_wallet_apk: + name: Build Wallet APK + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Setup Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + architecture: x86_64 + + - name: Cache Gradle packages + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Accept Android Licenses + uses: SimonMarquis/android-accept-licenses@v1 + + - name: Setup Android files for Wallet + uses: ./.github/actions/ci-setup-android-files + with: + root-path: 'wallets/rn_cli_wallet' + google-services-file: ${{ secrets.ANDROID_GOOGLE_SERVICES_BASE64 }} + secrets-file: ${{ secrets.ANDROID_SECRETS_FILE }} + keystore: ${{ secrets.WC_INTERNAL_KEYSTORE }} + keystore-name: ${{ secrets.WC_INTERNAL_KEYSTORE_NAME }} + sentry-file: ${{ secrets.W3W_SENTRY_FILE }} + project-id: ${{ secrets.ENV_PROJECT_ID }} + relay-url: ${{ secrets.ENV_RELAY_URL }} + sentry-dsn: ${{ secrets.W3W_SENTRY_DSN }} + release-type: 'internal' + + - name: Install dependencies + working-directory: ./wallets/rn_cli_wallet + run: | + yarn install --immutable + + - name: Build Wallet APK + working-directory: ./wallets/rn_cli_wallet + run: | + export SENTRY_DISABLE_AUTO_UPLOAD=true && yarn run android:build:internal + + - name: Rename Wallet APK for upload + run: mv ./wallets/rn_cli_wallet/android/app/build/outputs/apk/internal/app-internal.apk ./wallets/rn_cli_wallet/android/app/build/outputs/apk/internal/wallet-internal.apk + + - name: Upload Wallet APK + uses: actions/upload-artifact@v4 + with: + name: rn_cli_wallet-internal-apk + path: ./wallets/rn_cli_wallet/android/app/build/outputs/apk/internal/wallet-internal.apk + + build_dapp_apk: + name: Build dApp APK runs-on: ubuntu-latest steps: - - name: Do nothing - run: echo "This is a placeholder workflow to enable manual triggers from feature branches." \ No newline at end of file + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Setup Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + architecture: x86_64 + + - name: Cache Gradle packages + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Accept Android Licenses + uses: SimonMarquis/android-accept-licenses@v1 + + - name: Setup Android files for dApp + uses: ./.github/actions/ci-setup-android-files + with: + root-path: 'dapps/W3MWagmi' + google-services-file: ${{ secrets.ANDROID_GOOGLE_SERVICES_BASE64 }} + secrets-file: ${{ secrets.ANDROID_SECRETS_FILE }} + keystore: ${{ secrets.WC_INTERNAL_KEYSTORE }} + keystore-name: ${{ secrets.WC_INTERNAL_KEYSTORE_NAME }} + sentry-file: ${{ secrets.W3M_WAGMI_SENTRY_FILE }} + project-id: ${{ secrets.ENV_PROJECT_ID }} + relay-url: ${{ secrets.ENV_RELAY_URL }} + sentry-dsn: ${{ secrets.W3M_WAGMI_SENTRY_DSN }} + release-type: 'internal' + + - name: Install dependencies + working-directory: ./dapps/W3MWagmi + run: | + yarn install --immutable + + - name: Build dApp APK + working-directory: ./dapps/W3MWagmi + run: | + export SENTRY_DISABLE_AUTO_UPLOAD=true && yarn run android:build:internal + + - name: Rename dApp APK for upload + run: mv ./dapps/W3MWagmi/android/app/build/outputs/apk/internal/app-internal.apk ./dapps/W3MWagmi/android/app/build/outputs/apk/internal/dapp-internal.apk + + - name: Upload dApp APK + uses: actions/upload-artifact@v4 + with: + name: W3MWagmi-internal-apk + path: ./dapps/W3MWagmi/android/app/build/outputs/apk/internal/dapp-internal.apk + + run_e2e_tests: + name: Run E2E Tests + timeout-minutes: 30 + runs-on: ubuntu-16core + needs: [build_wallet_apk, build_dapp_apk] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Download all APKs + uses: actions/download-artifact@v4 + with: + pattern: "*-apk" + path: apks + merge-multiple: true + + - name: List APKs + run: | + echo "Available APKs:" + find apks -name "*.apk" | xargs ls -la + + - name: Install Maestro + run: | + curl -Ls "https://get.maestro.mobile.dev" | bash + export PATH="$PATH":"$HOME/.maestro/bin" + echo "$HOME/.maestro/bin" >> $GITHUB_PATH + maestro --version + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + + - name: Start Android Emulator and Run Tests + uses: reactivecircus/android-emulator-runner@v2.34.0 + with: + api-level: 34 + target: google_apis + arch: x86_64 + ram-size: 4096M + heap-size: 576M + emulator-boot-timeout: 900 + profile: pixel_6 + avd-name: test_device + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-snapshot-save -no-snapshot-load + script: | + mkdir -p debug-artifacts + + # Wait for emulator to be fully ready + adb wait-for-device + adb shell 'while [ "$(getprop sys.boot_completed)" != "1" ]; do sleep 2; done' + echo "Emulator booted successfully" + + # Start logcat capture in background + adb logcat -c + adb logcat > debug-artifacts/full-logcat.txt & + + # Install APKs + echo "Installing APKs:" + find apks -name "*.apk" -exec echo "Installing: {}" \; -exec adb install -r {} \; + + # Verify installations + echo "Verifying installed apps:" + adb shell pm list packages | grep -E "com.walletconnect" || (echo "ERROR: Apps not installed correctly" && exit 1) + + # Maestro handles app launching via clearState/launchApp in test files + echo "Running Maestro native to native tests:" + maestro test .maestro/native/connect_reject.yaml + maestro test .maestro/native/connect_confirm.yaml + maestro test .maestro/native/personal_sign_confirm.yaml + maestro test .maestro/native/personal_sign_reject.yaml + + # Check for crashes + echo "Checking for crashes..." + adb logcat -d | grep -E "FATAL EXCEPTION|AndroidRuntime|Process:*com.walletconnect" > debug-artifacts/crashes.txt || echo "No crashes found" > debug-artifacts/crashes.txt + + - name: Upload debug artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: debug-artifacts + path: debug-artifacts/ + if-no-files-found: warn + + - name: Upload Maestro artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: maestro-artifacts + path: | + .maestro/ + videos/ + *.mp4 + *.mov + if-no-files-found: warn diff --git a/.github/workflows/ci_e2e_tests_ios.yaml b/.github/workflows/ci_e2e_tests_ios.yaml index 5883b48a3..23ffab0a8 100644 --- a/.github/workflows/ci_e2e_tests_ios.yaml +++ b/.github/workflows/ci_e2e_tests_ios.yaml @@ -5,11 +5,279 @@ permissions: on: workflow_dispatch: + pull_request: + paths: + - 'wallets/rn_cli_wallet/**' + - 'dapps/W3MWagmi/**' + - '.maestro/**' + - '.github/workflows/ci_e2e_tests_ios.yaml' + - '.github/actions/ci-setup/**' + - '.github/actions/ci-setup-ios-files/**' + +permissions: + contents: read jobs: - placeholder: - name: Placeholder Job + build_wallet_app: + name: Build Wallet App + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Setup iOS files for Wallet + uses: ./.github/actions/ci-setup-ios-files + with: + root-path: 'wallets/rn_cli_wallet' + google-services-file: ${{ secrets.W3W_IOS_INTERNAL_GOOGLE_SERVICES_FILE }} + sentry-file: ${{ secrets.W3W_SENTRY_FILE }} + project-id: ${{ secrets.ENV_PROJECT_ID }} + relay-url: ${{ secrets.ENV_RELAY_URL }} + sentry-dsn: ${{ secrets.W3W_SENTRY_DSN }} + release-type: 'internal' + + - name: Set Xcode Version + run: sudo xcode-select -s /Applications/Xcode_16.2.app + + - name: Install dependencies + working-directory: ./wallets/rn_cli_wallet + run: | + yarn install --immutable + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1.0 + bundler-cache: true + + - name: Install Cocoapods + run: gem install cocoapods + + - name: Cache pods + id: pods-cache-wallet + uses: actions/cache@v4 + with: + path: wallets/rn_cli_wallet/ios/Pods + key: ${{ runner.os }}-pods-wallet-${{ hashFiles('wallets/rn_cli_wallet/ios/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods-wallet- + + - name: Install Pods + working-directory: ./wallets/rn_cli_wallet/ios + run: pod install + + - name: Build Wallet App for Simulator + working-directory: ./wallets/rn_cli_wallet/ios + env: + SENTRY_DISABLE_AUTO_UPLOAD: 'true' + run: | + set -o pipefail && xcodebuild \ + -workspace RNWeb3Wallet.xcworkspace \ + -scheme "RNWallet-Internal" \ + -configuration Release \ + -sdk iphonesimulator \ + -destination 'generic/platform=iOS Simulator' \ + -derivedDataPath ./build \ + CODE_SIGNING_ALLOWED=NO \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + COMPILER_INDEX_STORE_ENABLE=NO + + - name: Create app package + working-directory: ./wallets/rn_cli_wallet/ios + run: | + cd build/Build/Products/Release-iphonesimulator + zip -r ../../../../wallet.zip RNWallet\ Internal.app + + - name: Upload Wallet App + uses: actions/upload-artifact@v4 + with: + name: wallet-internal + path: ./wallets/rn_cli_wallet/ios/wallet.zip + + build_dapp_app: + name: Build dApp App runs-on: macos-latest steps: - - name: Do nothing - run: echo "This is a placeholder workflow to enable manual triggers from feature branches." \ No newline at end of file + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Setup iOS files for dApp + uses: ./.github/actions/ci-setup-ios-files + with: + root-path: 'dapps/W3MWagmi' + sentry-file: ${{ secrets.W3M_WAGMI_SENTRY_FILE }} + project-id: ${{ secrets.ENV_PROJECT_ID }} + relay-url: ${{ secrets.ENV_RELAY_URL }} + sentry-dsn: ${{ secrets.W3M_WAGMI_SENTRY_DSN }} + release-type: 'internal' + + - name: Set Xcode Version + run: sudo xcode-select -s /Applications/Xcode_16.2.app + + - name: Install dependencies + working-directory: ./dapps/W3MWagmi + run: | + yarn install --immutable + + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1.0 + bundler-cache: true + + - name: Install Cocoapods + run: gem install cocoapods + + - name: Cache pods + id: pods-cache-dapp + uses: actions/cache@v4 + with: + path: dapps/W3MWagmi/ios/Pods + key: ${{ runner.os }}-pods-dapp-${{ hashFiles('dapps/W3MWagmi/ios/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods-dapp- + + - name: Install Pods + working-directory: ./dapps/W3MWagmi/ios + run: pod install + + - name: Build dApp App for Simulator + working-directory: ./dapps/W3MWagmi/ios + env: + SENTRY_DISABLE_AUTO_UPLOAD: 'true' + run: | + set -o pipefail && xcodebuild \ + -workspace W3MWagmi.xcworkspace \ + -scheme "W3MWagmi Internal" \ + -configuration Release \ + -sdk iphonesimulator \ + -destination 'generic/platform=iOS Simulator' \ + -derivedDataPath ./build \ + CODE_SIGNING_ALLOWED=NO \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + COMPILER_INDEX_STORE_ENABLE=NO + + - name: Create app package + working-directory: ./dapps/W3MWagmi/ios + run: | + cd build/Build/Products/Release-iphonesimulator + zip -r ../../../../dapp.zip W3MWagmi\ Internal.app + + - name: Upload dApp App + uses: actions/upload-artifact@v4 + with: + name: dapp-internal + path: ./dapps/W3MWagmi/ios/dapp.zip + + run_e2e_tests: + name: Run E2E Tests + timeout-minutes: 60 + runs-on: macos-14-xlarge + needs: [build_wallet_app, build_dapp_app] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set Xcode Version + run: sudo xcode-select -s /Applications/Xcode_16.2.app + + - name: Download all Apps + uses: actions/download-artifact@v4 + with: + path: apps + merge-multiple: true + + - name: List Apps + run: | + echo "Available apps:" + find apps -name "*.zip" | xargs ls -la + + - name: Unzip apps + run: | + mkdir -p apps/wallet + unzip apps/wallet.zip -d apps/wallet + mkdir -p apps/dapp + unzip apps/dapp.zip -d apps/dapp + + - name: Install Maestro + run: | + curl -Ls "https://get.maestro.mobile.dev" | bash + export PATH="$PATH":"$HOME/.maestro/bin" + echo "$HOME/.maestro/bin" >> $GITHUB_PATH + maestro --version + + - name: Run iOS Simulator and Tests + run: | + set -x + + # Setup artifacts directory + mkdir -p e2e-test-artifacts + + # Start simulator + SIM_DEVICE_NAME="iPhone-13-E2E" + SIM_DEVICE_TYPE="iPhone 13" + SIM_RUNTIME_ID=$(xcrun simctl list runtimes | grep "iOS 18" | awk '{print $NF}' | head -n 1) + if [ -z "$SIM_RUNTIME_ID" ]; then + echo "No iOS 18 runtime found. Please check installed simulators." + exit 1 + fi + + # Create a new simulator instance + UDID=$(xcrun simctl create "$SIM_DEVICE_NAME" "$SIM_DEVICE_TYPE" "$SIM_RUNTIME_ID" || xcrun simctl list devices | grep "$SIM_DEVICE_NAME" | awk -F'[()]' '{print $2}') + + # Boot the simulator + xcrun simctl boot "$UDID" + + # Expose UDID for maestro + export MAESTRO_IOS_DEVICE="$UDID" + + # Install Apps + WALLET_APP_PATH=$(find apps/wallet -name "*.app" | head -n 1) + DAPP_APP_PATH=$(find apps/dapp -name "*.app" | head -n 1) + + # Install apps + echo "Installing apps:" + xcrun simctl install "$UDID" "$WALLET_APP_PATH" + xcrun simctl install "$UDID" "$DAPP_APP_PATH" + + # Verify installations + echo "Verifying installed apps:" + xcrun simctl listapps "$UDID" | grep -E "com.walletconnect" || (echo "ERROR: Apps not installed correctly" && exit 1) + + echo "Running Maestro native to native tests:" + maestro test .maestro/native/connect_reject.yaml + maestro test .maestro/native/connect_confirm.yaml + maestro test .maestro/native/personal_sign_confirm.yaml + maestro test .maestro/native/personal_sign_reject.yaml + + - name: Upload debug artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: e2e-test-artifacts + path: e2e-test-artifacts/ + if-no-files-found: warn + + - name: Upload Maestro artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: maestro-artifacts + path: | + .maestro/ + videos/ + *.mp4 + *.mov + if-no-files-found: warn diff --git a/.maestro/native/connect_confirm.yaml b/.maestro/native/connect_confirm.yaml index 5bf45da40..a3d3b0286 100644 --- a/.maestro/native/connect_confirm.yaml +++ b/.maestro/native/connect_confirm.yaml @@ -6,8 +6,24 @@ name: React Native Dapp to React Native Wallet Connection Confirmed permissions: all: allow - startRecording: "Native Connection Confirmed" -- tapOn: "Connect" -- tapOn: "React Native Wallet" -- tapOn: "Approve" +- tapOn: + id: "connect-button" +- tapOn: + id: "all-wallets" +- waitForAnimationToEnd +- tapOn: "React" +- runFlow: + when: + visible: "Open" + platform: iOS + commands: + - tapOn: "Open" +- extendedWaitUntil: + visible: + id: "approve-button" + timeout: 10000 +- tapOn: + id: "approve-button" +- waitForAnimationToEnd - assertVisible: "Sign message" - stopRecording \ No newline at end of file diff --git a/.maestro/native/connect_reject.yaml b/.maestro/native/connect_reject.yaml index 2015895ff..2e3e921ff 100644 --- a/.maestro/native/connect_reject.yaml +++ b/.maestro/native/connect_reject.yaml @@ -1,11 +1,29 @@ appId: com.walletconnect.web3modal.rnsample.internal -name: React Native Dapp to React Native Wallet Connection Confirmed +name: React Native Dapp to React Native Wallet Connection Rejected --- - clearState - launchApp: permissions: all: allow -- tapOn: "Connect" -- tapOn: "React Native Wallet" -- tapOn: "Reject" -- assertVisible: "Connection declined" \ No newline at end of file +- startRecording: "Native to Native Connection Rejected" +- tapOn: + id: "connect-button" +- tapOn: + id: "all-wallets" +- waitForAnimationToEnd +- tapOn: "React" +- runFlow: + when: + visible: "Open" + platform: iOS + commands: + - tapOn: "Open" +- extendedWaitUntil: + visible: + id: "reject-button" + timeout: 10000 +- tapOn: + id: "reject-button" +- waitForAnimationToEnd +- assertVisible: "Connection declined" +- stopRecording \ No newline at end of file diff --git a/.maestro/native/personal_sign_confirm.yaml b/.maestro/native/personal_sign_confirm.yaml index 31ec415eb..48ca8dd36 100644 --- a/.maestro/native/personal_sign_confirm.yaml +++ b/.maestro/native/personal_sign_confirm.yaml @@ -5,7 +5,21 @@ name: React Native Dapp to React Native Wallet Personal Sign Confirmed permissions: all: allow - startRecording: "Native personal_sign Confirmed" +- extendedWaitUntil: + visible: "Sign message" + timeout: 10000 - tapOn: "Sign message" -- tapOn: "Approve" +- runFlow: + when: + visible: "Open" + platform: iOS + commands: + - tapOn: "Open" +- extendedWaitUntil: + visible: + id: "approve-button" + timeout: 10000 +- tapOn: + id: "approve-button" - assertVisible: "Request response" - stopRecording \ No newline at end of file diff --git a/.maestro/native/personal_sign_reject.yaml b/.maestro/native/personal_sign_reject.yaml index c102a41f5..5ccd5d517 100644 --- a/.maestro/native/personal_sign_reject.yaml +++ b/.maestro/native/personal_sign_reject.yaml @@ -5,7 +5,21 @@ name: React Native Dapp to React Native Wallet Personal Sign Rejected permissions: all: allow - startRecording: "Native personal_sign Rejected" +- extendedWaitUntil: + visible: "Sign message" + timeout: 10000 - tapOn: "Sign message" -- tapOn: "Reject" +- runFlow: + when: + visible: "Open" + platform: iOS + commands: + - tapOn: "Open" +- extendedWaitUntil: + visible: + id: "reject-button" + timeout: 10000 +- tapOn: + id: "reject-button" - assertVisible: "Request failure" - stopRecording \ No newline at end of file diff --git a/.maestro/web/connect_confirm.yaml b/.maestro/web/connect_confirm.yaml index 3f5a0c428..5bfbe37ea 100644 --- a/.maestro/web/connect_confirm.yaml +++ b/.maestro/web/connect_confirm.yaml @@ -12,12 +12,26 @@ name: AppKit Web to React Native Wallet Connection Confirmed - tapOn: "Connect Wallet" - scroll - scroll -- tapOn: "React Native Sample Wallet React Native Sample Wallet" +- runFlow: + when: + platform: iOS + commands: + - tapOn: "React Native Sample Wallet" +- runFlow: + when: + platform: Android + commands: + - tapOn: "React Native Sample Wallet React Native Sample Wallet" - runFlow: when: platform: iOS commands: - back -- tapOn: "Approve" +- extendedWaitUntil: + visible: + id: "approve-button" + timeout: 10000 +- tapOn: + id: "approve-button" - assertVisible: "AppKit Interactions" - stopRecording \ No newline at end of file diff --git a/.maestro/web/connect_reject.yaml b/.maestro/web/connect_reject.yaml index 83f900ab9..032830b1d 100644 --- a/.maestro/web/connect_reject.yaml +++ b/.maestro/web/connect_reject.yaml @@ -12,8 +12,22 @@ name: AppKit Web to React Native Wallet Connection Rejected - tapOn: "Connect Wallet" - scroll - scroll -- tapOn: "React Native Sample Wallet React Native Sample Wallet" -- tapOn: "Reject" +- runFlow: + when: + platform: iOS + commands: + - tapOn: "React Native Sample Wallet" +- runFlow: + when: + platform: Android + commands: + - tapOn: "React Native Sample Wallet React Native Sample Wallet" +- extendedWaitUntil: + visible: + id: "reject-button" + timeout: 10000 +- tapOn: + id: "reject-button" - runFlow: when: platform: iOS diff --git a/.maestro/web/personal_sign_confirm.yaml b/.maestro/web/personal_sign_confirm.yaml index 61e754783..e2395b15f 100644 --- a/.maestro/web/personal_sign_confirm.yaml +++ b/.maestro/web/personal_sign_confirm.yaml @@ -11,11 +11,17 @@ name: AppKit Web to React Native Wallet Sign Request Confirmed - scroll - scroll - tapOn: "Sign Message" -- tapOn: "Approve" +- extendedWaitUntil: + visible: + id: "approve-button" + timeout: 10000 +- tapOn: + id: "approve-button" - runFlow: when: platform: iOS commands: - back +- waitForAnimationToEnd - assertVisible: "Signing Succeeded" - stopRecording \ No newline at end of file diff --git a/.maestro/web/personal_sign_reject.yaml b/.maestro/web/personal_sign_reject.yaml index c69275f9e..ddb6cd487 100644 --- a/.maestro/web/personal_sign_reject.yaml +++ b/.maestro/web/personal_sign_reject.yaml @@ -11,11 +11,17 @@ name: AppKit Web to React Native Wallet Sign Request Rejected - scroll - scroll - tapOn: "Sign Message" -- tapOn: "Reject" +- extendedWaitUntil: + visible: + id: "reject-button" + timeout: 10000 +- tapOn: + id: "reject-button" - runFlow: when: platform: iOS commands: - back +- waitForAnimationToEnd - assertVisible: "Signing Failed" - stopRecording \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/components/ActionButton.tsx b/wallets/rn_cli_wallet/src/components/ActionButton.tsx index 6d93907fb..bc7b0020d 100644 --- a/wallets/rn_cli_wallet/src/components/ActionButton.tsx +++ b/wallets/rn_cli_wallet/src/components/ActionButton.tsx @@ -24,6 +24,7 @@ export interface ActionButtonProps { fullWidth?: boolean; style?: StyleProp; textStyle?: StyleProp; + testID?: string; } export function ActionButton({ @@ -36,6 +37,7 @@ export function ActionButton({ fullWidth = false, style, textStyle, + testID, }: ActionButtonProps) { const Theme = useTheme(); @@ -67,6 +69,7 @@ export function ActionButton({ return (