Skip to content

Conversation

@bpolgar-swo
Copy link
Contributor

@bpolgar-swo bpolgar-swo commented Dec 15, 2025

based on the iOS approach with composite actions## Android E2E Test Workflows & Cross-Platform Test Improvements

Workflows

New Android CI/CD workflows:

  • android-build-and-test.yml - Full build and Appium test pipeline for macOS/Ubuntu runners
  • android-build-and-test-windows.yml - Windows-specific build and test pipeline
  • android-external-test-example.yml - Example workflow for testing pre-built APKs

New composite actions:

  • android-install/ - Installs APK from artifact or URL on Android emulator (macOS/Ubuntu)
  • android-install-windows/ - Windows equivalent with PowerShell
  • android-test/ - Runs Appium tests with UiAutomator2 driver
  • android-test-windows/ - Windows equivalent

Updated workflows:

  • android-build.yml - Added release tagging and artifact publishing to GitHub releases
  • ios-build-and-test.yml - Added ReportPortal integration
  • ios-test/action.yml - Added ReportPortal API key input

GitHub Secrets (✅ Added)

Secret Description
AUTH0_CLIENT_ID_TEST Auth0 client ID for test environment builds
AIRTABLE_API_TOKEN Airtable personal access token for OTP retrieval
AIRTABLE_BASE_ID Airtable base ID containing OTP codes
AIRTABLE_TABLE_NAME Airtable table name/ID for OTP records
AIRTABLE_EMAIL Email address used for OTP testing
AIRTABLE_FROM_EMAIL Sender email to filter OTP records
REPORT_PORTAL_API_KEY ReportPortal API key (optional)

GitHub Variables (✅ Added)

Variable Description
REPORT_PORTAL_ENDPOINT ReportPortal server URL
REPORT_PORTAL_PROJECT ReportPortal project name

Page Object Model Changes

selectors.js:

  • Added byContainsTextAny(...patterns) - OR condition text matching for cross-platform differences
  • Added textContainsButNotContains(contains, excludes) - Exclusion pattern matching
  • Added byStartsWithResourceId(prefix) - Prefix matching for resource IDs
  • Added staticTextByIdPrefixAndPattern(idPrefix, textPattern) - Combined ID and text pattern matching
  • Added spotlightItemsByPrefix(prefix) - Entity-specific spotlight item selectors (ORD, SUB, etc.)

spotlights.page.js:

  • Expanded from basic page to full spotlight testing support
  • Added filter tab selectors (all, orders, subscriptions, requests)
  • Added spotlight item pattern matchers for different entity types
  • Added section header selectors with cross-platform text variations

footer.page.js:

  • Updated tab selectors to use byAccessibilityId for reliability

welcome.page.js:

  • Added emailErrorLabel and enterEmailSubTitle getters
  • Updated selectors for cross-platform compatibility

Test Changes

home.e2e.js:

  • Refactored to use spotlight page object
  • Added tests for filter tabs (Orders, Subscriptions, Requests)
  • Added spotlight section header verification
  • Added spotlight item entity tests

navigation.e2e.js:

  • Updated to use footer page object for tab navigation

wdio.conf.js:

  • Added ReportPortal reporter configuration
  • Added failing test suite for debugging
  • Updated capabilities with longer timeouts and retry settings

Scripts

run-local-test.sh:

  • Added --build-from-artifact URL option to download and install app from artifact URL
  • Supports both .zip archives and direct .apk files
  • Auto-detects platform and installs appropriately

setup-test-env.sh:

  • Added --platform flag for iOS/Android selection
  • Added --start-emulator to launch emulator/simulator by name
  • Added --list-emulators to show available devices
  • Loads and exports Airtable OTP testing variables from .env

view-airtable-entries.js:

  • New utility script for debugging Airtable OTP code retrieval

- Changed both build and test jobs from macos-latest to ubuntu-latest
- macOS runners are ARM64 (Apple Silicon), cannot run x86_64 emulators
- Added KVM acceleration enablement step for Ubuntu
- Fixed stat command syntax for Linux compatibility
- Improved package name extraction regex
- Updated plan document with architecture fix notes
- Fix adb command not found by adding Android SDK tools to PATH
- Fix AVD not found by setting ANDROID_SDK_HOME environment variable
- Fix Windows AVD verification with robust string matching
- Accept all SDK licenses including android-googlexr-license
- Increase ADB timeout to 120s and add emulator health checks
- Add debug output for AVD file locations
- Remove local planning documents from repository
- Change BUILD_MODE default from Debug to Release
- Remove expo-dev-client for Release builds to avoid Expo Dev UI
- Ensures standalone production app without development tools
The emulator was crashing with access violation (0xC0000005) when using
swiftshader_indirect. This adds retry logic to try multiple GPU modes:
1. auto - Uses WHPX hardware acceleration if available
2. swiftshader_indirect - Software rendering fallback
3. guest - Last resort software rendering

Each mode gets 45 seconds to start before falling back to the next.
- Clean up stale lock files before starting emulator
- Kill orphaned emulator/QEMU processes between attempts
- Restart ADB server for clean state
- Use -wipe-data and -no-snapshot-load/-no-snapshot-save flags
- Add -no-metrics to suppress metrics warning
- Extend timeouts for more reliable startup
- Remove temporary push trigger from non-Windows workflow
- Add Remove-EmulatorLocks helper function with null checks and try-catch
- Fix 'Object reference not set to an instance of an object' error in retry loop
- Add more robust process cleanup between retry attempts
- Restart ADB server between retry attempts
- Kill both qemu and emulator processes on cleanup
Emulator optimizations:
- Add -no-sim, -no-cache, -skip-adb-auth, -no-passive-gps flags
- Use -netdelay none and -netspeed full for faster network
- Use -screen no-touch (we use ADB commands)
- Set -partition-size 2048 for faster wipe

AVD config optimizations:
- Lower resolution: 720x1280 instead of 1080x2400
- Lower density: 320 instead of 420
- Disable all sensors (proximity, magnetic, orientation, etc)
- Disable cameras
- Disable GPS in config
- Smaller data partition (2G)

Workflow changes:
- Default to API level 30 (faster/more stable than 34)
- Keep pixel_6 device profile

GPU/Accel retry configurations:
- Try swiftshader_indirect + auto accel
- Try gpu off + auto accel
- Try swiftshader_indirect + no accel
- Try gpu off + no accel
The -partition-size 2048 was causing emulator startup failure because
the Android emulator requires values between 10MB and 2047MB (exclusive).

Error: partition-size (2048) must be between 10MB and 2047MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants