5454
5555 - name : Build sample - Internal
5656 env :
57+ CI : " true"
58+ YTTRIUM_CI_VERSION : " 0.0.19-ci" # Specify the yttrium version for CI builds
5759 WC_CLOUD_PROJECT_ID : ${{ secrets.WC_CLOUD_PROJECT_ID }}
5860 FIREBASE_TOKEN : ${{ secrets.FIREBASE_TOKEN }}
5961 NOTIFY_INTEGRATION_TESTS_PROJECT_ID : ${{ secrets.NOTIFY_INTEGRATION_TESTS_PROJECT_ID }}
7173
7274 run_e2e_tests :
7375 name : Run E2E Tests
74- timeout-minutes : 20
75- runs-on : ubuntu-latest
76+ timeout-minutes : 30
77+ runs-on : ubuntu-16core
7678 needs : build_internal_samples
7779 steps :
7880 - name : Checkout repository
@@ -100,7 +102,7 @@ jobs:
100102 - name : List APKs
101103 run : |
102104 echo "Available APKs:"
103- find apks -name "*.apk"
105+ find apks -name "*.apk" | xargs ls -la
104106
105107 - name : Install Maestro
106108 run : |
@@ -115,72 +117,156 @@ jobs:
115117 - name : Start Android Emulator and Run Tests
116118 uses : reactivecircus/android-emulator-runner@v2
117119 with :
118- api-level : 33
120+ api-level : 30
119121 target : google_apis
120122 arch : x86_64
121- ram-size : 2048M
122- emulator-boot-timeout : 600 # 10min
123- profile : pixel_7
123+ ram-size : 4096M
124+ heap-size : 576M
125+ emulator-boot-timeout : 900
126+ profile : pixel_6
124127 avd-name : test_device
125- emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
126- disable-animations : true
128+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save -no-snapshot-load
127129 pre-emulator-launch-script : |
128- echo "Running pre emulator launch script. Printing the working directory now: "
130+ echo "Running pre emulator launch script"
129131 pwd
130132 script : |
131- echo "Listing available devices:"
132- avdmanager list device
133+ # Setup debug directory
134+ mkdir -p debug-artifacts
135+
136+ # Wait for emulator to be fully ready
137+ echo "Waiting for emulator to be ready..."
138+ adb wait-for-device
133139
134- echo "Listing available APKs:"
135- find apks -name "*.apk"
140+ # Wait for boot completion
141+ echo "Waiting for boot completion..."
142+ adb shell 'while [ "$(getprop sys.boot_completed)" != "1" ]; do sleep 2; done'
143+ echo "Boot completed!"
136144
137- # verify emulator is running
145+ echo "Emulator booted successfully"
138146 adb devices
139147
148+ # Clear logcat before we start
149+ adb logcat -c
150+
151+ # Start logcat capture in background
152+ adb logcat > debug-artifacts/full-logcat.txt &
153+ LOGCAT_PID=$!
154+
155+ # Install APKs
140156 echo "Installing APKs:"
141- find apks -name "*.apk" -exec adb install -r {} \;
157+ find apks -name "*.apk" -exec echo "Installing: {}" \; -exec adb install -r {} \;
158+
159+ # Verify installations
160+ echo "Verifying installed apps:"
161+ adb shell pm list packages | grep -E "com.reown.sample" || (echo "ERROR: Apps not installed correctly" && exit 1)
162+
163+ # Check APK info
164+ echo "Checking APK details:"
165+ adb shell dumpsys package com.reown.sample.wallet.internal | grep -A 5 "versionName"
166+
167+ # Clear app data
168+ echo "Clearing app data..."
169+ adb shell pm clear com.reown.sample.wallet.internal || true
170+ adb shell pm clear com.reown.sample.dapp.internal || true
171+
172+ # Grant runtime permissions that might be needed
173+ echo "Granting permissions..."
174+ adb shell pm grant com.reown.sample.wallet.internal android.permission.INTERNET || true
175+ adb shell pm grant com.reown.sample.wallet.internal android.permission.ACCESS_NETWORK_STATE || true
176+ adb shell pm grant com.reown.sample.wallet.internal android.permission.ACCESS_WIFI_STATE || true
177+ adb shell pm grant com.reown.sample.wallet.internal android.permission.CAMERA || true
178+
179+ # Check if the app needs to be enabled
180+ echo "Checking app state..."
181+ adb shell pm list packages -d | grep -q com.reown.sample.wallet.internal && adb shell pm enable com.reown.sample.wallet.internal || echo "App is not disabled"
182+
183+ # Wait for system to settle
184+ sleep 10
185+
186+ # Check available activities
187+ echo "Checking available activities for wallet app:"
188+ adb shell dumpsys package com.reown.sample.wallet.internal | grep -A 10 "Activity" || true
189+
190+ # Wait and capture state
191+ sleep 10
192+
193+ # Capture comprehensive debug info
194+ echo "=== CAPTURING DEBUG INFO ==="
195+
196+ # Window state
197+ echo "Window state:" > debug-artifacts/window_state.txt
198+ adb shell dumpsys window windows >> debug-artifacts/window_state.txt
199+
200+ # Current activity
201+ echo "Current activity:" > debug-artifacts/current_activity.txt
202+ adb shell dumpsys activity activities | grep -E "mResumedActivity|mFocusedActivity" >> debug-artifacts/current_activity.txt
203+
204+ # Check for crashes
205+ echo "Checking for crashes..."
206+ adb logcat -d | grep -E "FATAL EXCEPTION|AndroidRuntime|Process.*com.reown" > debug-artifacts/crashes.txt || echo "No crashes found" > debug-artifacts/crashes.txt
207+
208+ # ANR traces
209+ adb shell ls /data/anr/ > debug-artifacts/anr_list.txt 2>&1 || true
210+
211+ # Memory info
212+ adb shell dumpsys meminfo com.reown.sample.wallet.internal > debug-artifacts/meminfo.txt || true
142213
143- echo "Installed apps:"
144- adb shell pm list packages
214+ # App process info
215+ adb shell ps | grep reown > debug-artifacts/processes.txt || true
216+
217+ # Network state (important for WalletConnect)
218+ echo "Network state:" > debug-artifacts/network_state.txt
219+ adb shell dumpsys connectivity >> debug-artifacts/network_state.txt
220+ adb shell settings get global airplane_mode_on >> debug-artifacts/network_state.txt
221+
222+ # Force stop before Maestro tests
223+ adb shell am force-stop com.reown.sample.wallet.internal
224+ adb shell am force-stop com.reown.sample.dapp.internal
225+ sleep 5
226+
227+ # Try to launch the app manually before Maestro
228+ echo "Attempting manual app launch..."
229+ adb shell monkey -p com.reown.sample.wallet.internal -c android.intent.category.LAUNCHER 1
230+ sleep 10
231+
232+ # Check if app is running
233+ adb shell ps | grep -q "com.reown.sample.wallet.internal" || (echo "ERROR: Wallet app is not running after launch attempt" && adb shell am start -n com.reown.sample.wallet.internal/com.reown.sample.wallet.ui.WalletKitActivity || true)
234+
235+ sleep 10
236+
237+ # Take a screenshot to see current state
238+ adb shell screencap /sdcard/app_state_before_maestro.png
239+ adb pull /sdcard/app_state_before_maestro.png debug-artifacts/ || true
240+
241+ # Check current activity
242+ echo "Current activity before Maestro:"
243+ adb shell dumpsys activity activities | grep -E "mResumedActivity|mFocusedActivity" || true
244+
245+ # DO NOT kill the app here - let's see if it's actually running properly
246+ echo "App state check complete, proceeding with Maestro tests..."
145247
146248 echo "Running Maestro native to native tests:"
147249 maestro test .maestro/flows/native/connect_reject.yaml
148250 maestro test .maestro/flows/native/connect_confirm.yaml
149- maestro test .maestro/flows/native/personal_sign_reject.yaml
150251 maestro test .maestro/flows/native/personal_sign_confirm.yaml
252+ # maestro test .maestro/flows/native/personal_sign_reject.yaml
151253
152- # echo "Running Maestro web to native tests:"
153- # maestro test .maestro/flows/web/connect_reject.yaml || echo "Test web_connect_reject failed but continuing"
154- # maestro test .maestro/flows/web/connect_confirm.yaml || echo "Test web_connect_confirm failed but continuing"
155-
156- - name : Find video files in project root
157- if : always()
158- run : |
159- echo "Looking for video files in project root:"
160- find . -maxdepth 1 -type f -name "*.mp4" -o -name "*.mov"
161-
162- # Create videos directory if it doesn't exist
163- mkdir -p videos
164-
165- # Move any video files from root to videos directory
166- find . -maxdepth 1 -type f \( -name "*.mp4" -o -name "*.mov" \) -exec mv {} videos/ \;
167-
168- - name : Upload test recordings from root
254+ - name : Upload debug artifacts
169255 if : always()
170256 uses : actions/upload-artifact@v4
171257 with :
172- name : maestro-root-recordings
173- path : |
174- videos/
175- *.mp4
176- *.mov
258+ name : debug-artifacts
259+ path : debug-artifacts/
177260 if-no-files-found : warn
178261
179- - name : Upload test recordings from .maestro
262+ - name : Upload Maestro artifacts
180263 if : always()
181264 uses : actions/upload-artifact@v4
182265 with :
183- name : maestro-videos
266+ name : maestro-artifacts
184267 path : |
185- .maestro/videos/
186- if-no-files-found: warn
268+ .maestro/
269+ videos/
270+ *.mp4
271+ *.mov
272+ if-no-files-found : warn
0 commit comments