Skip to content

E2E: same flows as the native SDKs - #31

Merged
ahsanalidotme merged 2 commits into
mainfrom
ci/e2e-native-parity
Nov 14, 2026
Merged

ahsanalidotme merged 2 commits into
mainfrom
ci/e2e-native-parity

Conversation

@ahsanalidotme

Copy link
Copy Markdown
Contributor

Brings the React Native wrapper's Maestro e2e up to the native Android and iOS SDK suites. It uses the same data-driven setup: one environment table (e2e/e2e-env.json) and one flow table (e2e/e2e-flows.json). Prod is the default. When an environment has no link for a link type or reward, those rows are skipped with a notice, never failed.

Flows (per platform)

Before After
Offline consent gate consent_prompt consent_prompt
Re-engagement reengagement (allow) reengagement_allow, reengagement_deny
trackEvent track_event track_event
Click token, custom domain (summer-sale) none deferred_custom_allow, deferred_custom_deny
Click token, subdomain (discounted-product) deferred_allow, deferred_deny deferred_subdomain_allow, deferred_subdomain_deny
Probabilistic (custom-problistic, ios-problistic) none deferred_{custom,subdomain}_{allow,deny}_problistic (4)
Link-type matrix (e2e-general, -campaign, -influencer, -partner) none deferred_custom_{allow,deny}__<type> (8): linkType/source in customData; reward: per_install earned on influencer/partner allow, nothing on deny, reward: null on the others
Re-engagement on link-type links none reengagement_type_{allow,deny}__<type> (8): openCount +1 / unchanged; installCount and earning unchanged
per_event reward (e2e-event) none deferred_event_{allow,deny}: dev only, skipped on prod (no link yet)
rev_share reward (e2e-revshare) none deferred_revshare_{allow,deny}
Rows 5 32 (30 run on prod, 2 skipped)

Left out on purpose:

  • The Android Play Store install-referrer flows. They stay private-only.
  • The native simulated / custom-scheme flows. They test the native example app's own simulator, not the SDK.
  • The native device lookup on the probabilistic rows. The wrapper exposes no SDK device id, so these rows assert the install's answer only, and the report says so.

How it works

  • e2e/targets.py resolves the tables (resolve, jobs) and checks that they match the flow files (validate).
  • e2e/verify.py holds the backend rules from the native scripts/e2e-verify.py: install, fraud, reward, re-engagement, and event earning by the contract formula.
  • e2e/lib.sh is one runner for both platforms. e2e/android.sh and e2e/ios.sh only add each platform's steps: staging the click, installing, opening the link, driving Maestro.
  • Per-environment backend_checks (earning, open_count, events) say which verify fields each backend has. A check that is off is noted as skipped on the row. On prod: earning and open_count are on, events is off (same as the native configs).
  • Example app, e2e builds only:
    • The panel gains e2e-deny-consent and e2e-track-install buttons and the e2e-install / e2e-events lines.
    • A kickflip://e2e/events?list=<JSON> hook sends the reward events.
    • linkDomains takes the run's hosts from the e2e config.
  • Workflow: a new config job runs validate, the unit tests and shellcheck. A manual run can pick environment (prod | dev) and link_types. The jobs write a results table to the job summary and upload results-*.jsonl. Timeouts are raised for the longer suite. Runners are GitHub-hosted only.
  • dev matches the native dev config. Android points the debug app at the dev backend. iOS skips the real rows on dev with a notice, because the binary SDK has no backend override.

Secrets needed

  • LINKTRAIL_KEY: SDK key of the prod workspace "Starter - Oldest - E2E". Already referenced, but not set on this repo.
  • E2E_TOKEN: X-E2E-Token for GET /v1/e2e/clicks/:token. Already referenced, but not set on this repo.
  • LINKTRAIL_TEST_KEY: new, dev workspace key, only for manual dev runs.

Without the environment's key and E2E_TOKEN (forks, or today), only consent_prompt runs. Every other row is skipped with a notice. Both app ids must be in the backend's E2E_APP_IDENTIFIERS.

Checks run locally

  • python3 -I e2e/targets.py validate: OK, 32 rows per platform and environment.
  • python3 -I -m unittest discover -s e2e/tests: 18 tests OK.
  • shellcheck -x e2e/*.sh and actionlint: clean.
  • npm run lint: 0 errors, 3 warnings, all in src/, which this PR doesn't touch.
  • npm run typecheck, the example's tsc --noEmit, npm test (69 tests) and the Android JS bundle: all pass.
  • A plumbing run of e2e/lib.sh with a stubbed device and backend covered the click, link-type reward, re-engagement and rev_share rows, plus the prod skip of deferred_event_*.
  • Not run: Maestro on a device. No real run is possible until the secrets are set.

Impact

CI only. There is no change to the published package (src/, android/, ios/ untouched) and no database change. The example app changes only render or act in e2e builds (e2eConfig.enabled). Once the secrets are set, the real rows make real clicks and installs on the prod E2E workspace. That is about 15 counted installs per platform per run. This stays under the backend's 20-per-IP-per-hour ip_velocity rule, but several runs in an hour from one runner could trip it.

Ports the native Android and iOS SDK e2e rows to the wrapper, driven by one
environment table (e2e/e2e-env.json) and one flow table (e2e/e2e-flows.json):
custom-domain and subdomain click-token installs, probabilistic installs, the
link-type matrix (general, campaign, influencer, partner) with per_install
reward checks, re-engagement on link-type links (openCount, no second reward),
and the per_event / rev_share event-reward rows. Prod is the default; links a
run's environment doesn't have are skipped with a notice.

e2e/targets.py resolves the tables for the runners and validates them,
e2e/verify.py holds the backend rules (as the native scripts/e2e-verify.py).
The example app's e2e panel gains a deny-consent and a track-install button
and a kickflip://e2e/events hook for the reward rows (e2e builds only).
…n CI

The retry flag sat before the subcommand, where Maestro rejects it, so every
iOS retry failed at once. The config job now also runs maestro check-syntax
on every flow.
@ahsanalidotme
ahsanalidotme marked this pull request as ready for review November 14, 2026 19:54
@ahsanalidotme
ahsanalidotme merged commit da35b32 into main Nov 14, 2026
17 checks passed
@ahsanalidotme
ahsanalidotme deleted the ci/e2e-native-parity branch November 14, 2026 20:01
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.

1 participant