Skip to content

Android XML Views reference implementation + shared E2E matrix#286

Merged
Alex Freas (akfreas) merged 11 commits into
mainfrom
android-xml-views-reference-impl
May 30, 2026
Merged

Android XML Views reference implementation + shared E2E matrix#286
Alex Freas (akfreas) merged 11 commits into
mainfrom
android-xml-views-reference-impl

Conversation

@akfreas
Copy link
Copy Markdown
Collaborator

@akfreas Alex Freas (akfreas) commented May 25, 2026

Adds a second Android reference implementation (legacy XML Views) alongside the existing Jetpack Compose one — both integrating the same SDK — and replaces the flaky UiAutomator E2E suite with a single Maestro flow set that drives both apps, mirroring the iOS SwiftUI/UIKit + shared-suite pattern.

What's in this PR

Reference implementations

  • :views — new XML Views app (com.contentful.optimization.app.views) mirroring every Compose screen/component, with a setTestTag helper exposing the same kebab-case test ids.
  • :shared — new library module hosting the platform-agnostic helpers (AppConfig, ContentfulFetcher, EventStore, MockPreviewContentfulClient, RichText) consumed by both apps.
  • :compose — the former :app module, renamed.

SDK (packages/android)

  • New com.contentful.optimization.views adapter (OptimizationManager, OptimizedEntryView, ScreenTracker, TrackingRecyclerView) — a thin wrapper over the same core API as the Compose adapter.
  • Fix OptimizedEntry dropping a reset-variant re-resolution (its collector was keyed on preview-panel state instead of the entry).

E2E (Maestro)

  • One Maestro flow set drives both apps via appId: ${APP_ID}, replacing the retired UiAutomator suite. The dwell/view-tracking contract stays in ViewTrackingControllerTest (JVM unit) + the iOS suite.
  • Apps reach the host mock via the 10.0.2.2 emulator alias (no fragile adb reverse); flows reset via stopApp + a reset launch arg (no pm clear).
  • Offline-behavior flows were removed — real airplane-mode toggling is nondeterministic on CI and the path is covered by the shared JS bridge's iOS tests. See maestro/OFFLINE_TESTING.md.

CI

  • e2e-android-maestro runs on GitHub-hosted runners with a per-app emulator matrix, a cached AVD snapshot (warm boot), and the aosp_atd system image — not google_apis, whose Play Services and launcher ANR on the headless software-GPU emulator and overlay the app under test. Green on both apps.

Test-id contract

id: selectors match the node resource-id: Compose via testTagsAsResourceId = true, Views via a setTestTag extension that sets viewIdResourceName through an AccessibilityDelegateCompat (XML android:id can't hold kebab-case). SDK-side accessibilityIdentifiers surface as contentDescription, matched by Maestro's text selector. The same selectors resolve against both apps.

🤖 Generated with Claude Code

@akfreas Alex Freas (akfreas) force-pushed the android-xml-views-reference-impl branch from 9c4ba8d to 0a5d220 Compare May 29, 2026 12:48
@wiz-inc-38d59fb8d7
Copy link
Copy Markdown

wiz-inc-38d59fb8d7 Bot commented May 29, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 1 Low
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@akfreas Alex Freas (akfreas) force-pushed the android-xml-views-reference-impl branch from 8cf9698 to 65f27b8 Compare May 30, 2026 08:34
@akfreas Alex Freas (akfreas) marked this pull request as ready for review May 30, 2026 08:58
@akfreas Alex Freas (akfreas) changed the title [draft] Android XML Views reference implementation + shared E2E matrix Android XML Views reference implementation + shared E2E matrix May 30, 2026
@akfreas Alex Freas (akfreas) merged commit 72f028a into main May 30, 2026
39 checks passed
@akfreas Alex Freas (akfreas) deleted the android-xml-views-reference-impl branch May 30, 2026 10:21
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