@@ -243,6 +243,7 @@ jobs:
243243 xcrun simctl spawn "iPhone 16" log show --last 1m --predicate 'process == "SpringBoard"' | head -10
244244
245245 - name : Run E2E Tests (${{ matrix.shard.name }})
246+ timeout-minutes : 30
246247 run : |
247248 cd bitkit-e2e-tests
248249
@@ -257,10 +258,12 @@ jobs:
257258
258259 # Cleanup function
259260 cleanup() {
261+ echo "Cleaning up processes..."
260262 kill "$LOG_PID" 2>/dev/null || true
261263 wait "$LOG_PID" 2>/dev/null || true
262264 kill "$APPIUM_PID" 2>/dev/null || true
263265 wait "$APPIUM_PID" 2>/dev/null || true
266+ echo "Cleanup complete"
264267 }
265268 trap cleanup EXIT INT TERM
266269
@@ -293,6 +296,10 @@ jobs:
293296 echo "Updated wdio.conf.ts device name and UDID:"
294297 grep -n -A1 -B1 "deviceName\|udid" wdio.conf.ts
295298
299+ # Check the full capabilities section
300+ echo "Full capabilities section:"
301+ grep -A 20 -B 5 "capabilities:" wdio.conf.ts
302+
296303 # Add Appium capabilities to help with simulator boot issues
297304 sed -i '' 's/"appium:autoAcceptAlerts": true/"appium:autoAcceptAlerts": true,\n "appium:newCommandTimeout": 300,\n "appium:commandTimeouts": {"implicit": 30000},\n "appium:launchTimeout": 300000,\n "appium:deviceReadyTimeout": 300000,\n "appium:autoLaunch": false,\n "appium:noReset": true,\n "appium:fullReset": false/' wdio.conf.ts
298305
@@ -313,8 +320,39 @@ jobs:
313320 echo "Killing manually launched app..."
314321 xcrun simctl terminate "$SIMULATOR_UDID" to.bitkit-regtest || echo "App not running"
315322
316- # Pass everything through to WDIO/Mocha
317- npm run e2e:ios -- "$@"
323+ # Add more debugging before running tests
324+ echo "=== Pre-test Debugging ==="
325+ echo "Current directory: $(pwd)"
326+ echo "Simulator status:"
327+ xcrun simctl list devices | grep "$SIMULATOR_NAME"
328+ echo "Appium status:"
329+ curl -s http://localhost:4723/status | head -5
330+ echo "App status on simulator:"
331+ xcrun simctl listapps "$SIMULATOR_NAME" | grep -i bitkit || echo "App not found"
332+ echo "WebDriverIO config:"
333+ head -20 wdio.conf.ts
334+ echo "Test files:"
335+ find test/specs -name "*.e2e.ts" | head -5
336+ echo "Package.json scripts:"
337+ grep -A 5 -B 5 "e2e:ios" package.json
338+ echo "========================="
339+
340+ # Pass everything through to WDIO/Mocha with more verbose output
341+ echo "Starting WebDriverIO tests..."
342+ echo "Running tests with grep pattern: ${{ matrix.shard.grep }}"
343+ # Try different parameter formats for WebDriverIO/Mocha
344+ if ! npm run e2e:ios -- --grep "${{ matrix.shard.grep }}" 2>&1 | tee "$LOGDIR/webdriverio.log"; then
345+ echo "Grep parameter failed, trying without filter..."
346+ if ! npm run e2e:ios 2>&1 | tee "$LOGDIR/webdriverio.log"; then
347+ echo "WebDriverIO failed with exit code $?"
348+ echo "Checking for error logs..."
349+ if [ -f "$LOGDIR/webdriverio.log" ]; then
350+ echo "WebDriverIO log contents:"
351+ cat "$LOGDIR/webdriverio.log"
352+ fi
353+ exit 1
354+ fi
355+ fi
318356 env :
319357 RECORD_VIDEO : true
320358 # Use the regtest infrastructure from Ubuntu runner
0 commit comments