Repository navigation
Add iOS Maestro E2E suite for the OneTrust example - #80
Merged
Merged
Conversation
The react-native-app-auth config plugin derives both platforms' redirect scheme from its redirectUrls option, and the example's plugin entry carried none. A fresh `expo prebuild` therefore registered no usable scheme: Android's appAuthRedirectScheme came out as the literal string "undefined" instead of de.contentpass.demo, breaking the OAuth redirect on any clean native build.
Neither a failed startSDK() nor a failed createOnetrustCmpAdapter() ever sets cmpReady, so checking !cmpReady before cmpFailed left the OneTrust example stuck on "Loading..." forever whenever the CMP could not load. Check cmpFailed first, and give both screens a testID.
0x7f
force-pushed
the
e2e-android-onetrust-maestro
branch
2 times, most recently
from
October 5, 2026 09:22
a8efb26 to
034615d
Compare
0x7f
marked this pull request as ready for review
October 5, 2026 13:08
0x7f
force-pushed
the
e2e-android-onetrust-maestro
branch
2 times, most recently
from
October 6, 2026 06:37
eef91ff to
35e2c2f
Compare
Three flows drive the built example against the real contentpass-staging backend and the OneTrust test tenant, with no mock server: - happy-path: consent through the hosted funnel, then a real login and logout with a subscribed staging fixture account (E2E_STAGING_EMAIL / E2E_STAGING_PASSWORD secrets) - onetrust-adapter-failure: an invalid OneTrust app id lands on the CMP-failure screen - cmp-timeout-fail-open: every gate timeout forced to 1ms fails open into the app The example now reads EXPO_PUBLIC_ONETRUST_APP_ID and EXPO_PUBLIC_GATE_TIMEOUT_MS, so each scenario is picked when Metro starts, and its screens carry testIDs so selectors don't depend on copy. The workflow runs on macos-15 with Xcode 26.2, which idb-companion (Maestro's iOS driver) requires. Android is left out: neither GitHub-hosted runner type can accelerate its emulator. The app is a Debug build that loads its JS from a pre-warmed Metro, because Metro's minifier strips React Native's setUpGlobals polyfill from a Release bundle. It is built for arm64 only, all the simulator runs, which also avoids a Swift 6.2.3 compiler crash in the x86_64 slice of expo-modules-core.
…uite Three new flows and two more stages in happy-path, each checking whether the consent layer comes back or stays away: - cancelled-login: cancelling iOS's sign-in prompt brings the layer back instead of failing open into the app - deny-all: withdrawing consent in the app brings the layer back - consent-survives-relaunch: stored consent alone satisfies the gate after a relaunch - happy-path: a subscriber's login survives a relaunch, the subscription alone keeps the layer away, and logging out brings it back The example now prints "Consent layer: shown/hidden" from the gate's onVisibilityChange. Its screen also renders underneath the layer, so the app's own text can't tell the two states apart. Flows that run against the example's default config share one job, since a job is mostly setup and build; only flows needing Metro started with other EXPO_PUBLIC_* values get a job of their own. Since a job's flows share a simulator, each starts with clearKeychain as well as a clearState launch: clearState leaves the login tokens in the keychain alone.
0x7f
force-pushed
the
e2e-android-onetrust-maestro
branch
from
October 6, 2026 07:43
35e2c2f to
273d063
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/onetrust, driving the built app against the real contentpass-staging backend and the OneTrust test tenant, with no mock server.node_modulesto a freshyarn install, which takes each macOS E2E job from 30–45 minutes down to about 15.Android is not covered: neither GitHub-hosted runner type can accelerate its emulator (
ubuntu-latesthas no/dev/kvm, and the macOS runners have no HVF for a nested hypervisor). The iOS Simulator runs natively, so it doesn't have this problem.Commits
fix: configure the OAuth redirect scheme for the OneTrust example: thereact-native-app-authplugin entry inapp.jsonhad noredirectUrls, so a freshexpo prebuildregistered no usable redirect scheme (Android got the literal stringundefined).fix: show the CMP-failure screen instead of hanging on Loading: a failedstartSDK()or adapter creation never setscmpReady, so checking it first left the example on "Loading..." forever.cmpFailedis now checked first.test: add an iOS Maestro E2E suite for the OneTrust example: the workflow, the first three flows, theEXPO_PUBLIC_*overrides and test IDs in the example, and the setup-action change.test: cover cancelled login, Deny All and relaunches in the iOS E2E suite: three more flows, two more stages inhappy-path, and a "Consent layer: shown/hidden" line in the example driven by the gate'sonVisibilityChange.What the suite checks
default-confighappy-pathcancelled-logindeny-allconsent-survives-relaunchonetrust-adapter-failureonetrust-adapter-failureEXPO_PUBLIC_ONETRUST_APP_ID) lands on the CMP-failure screencmp-timeout-fail-opencmp-timeout-fail-openEXPO_PUBLIC_GATE_TIMEOUT_MS) fails open into the appThere is one job per Metro configuration, not per flow, because a job is mostly setup and build. Each flow starts with
clearKeychainand aclearStatelaunch, since the flows in a job share a simulator andclearStateleaves the login tokens in the keychain.CI setup
macos-15with Xcode 26.2, whichidb-companion(Maestro's iOS driver) requires.setUpGlobalspolyfill. The scenario'sEXPO_PUBLIC_*values therefore go on the Metro process rather than the build.expo-modules-core.nmHoistingLimits: workspaces, the cachednode_modulesis about 1 GB of small files. On the macOS runners, restoring it took 12–16 min and saving it 8–13 min; a fresh install takes 2–3.5 min. The Linux CI jobs go from a ~45 s cache hit to 1.5–2 min.E2E_STAGING_EMAIL/E2E_STAGING_PASSWORDsecrets for a staging account with an active subscription to the example's plan. Without one, login goes to the subscription checkout instead of back to the app. On fork PRs the job is skipped, since GitHub withholds secrets there.