ci(e2e): run the Android signup e2e test on a CI emulator with video evidence - #16
ci(e2e): run the Android signup e2e test on a CI emulator with video evidence#16arnoldcastro5000 wants to merge 1 commit into
Conversation
Add a GitHub Actions workflow that builds the debug APK, boots an accelerated Android emulator, and runs the apps/e2e WebdriverIO suite (02_signup_flow) end to end. It uploads a full-scenario video and per-step screenshots as a build artifact. The app's custom Compose buttons expose no automation ids, so the suite drives them by screen coordinate. Coordinate-tap helpers, screen recording, and per-scenario hooks are added under apps/e2e, along with an .env.example template and a Windows local-run guide.
|
Note for reviewers about the CI check. This is the first GitHub Actions workflow in the repo, and it comes from a Until it is approved here, the proof is the run on my fork, which passed all 16
|
|
@dadiorchen for your review |
Summary
This adds an automated test that runs our Android app by itself on GitHub
Actions (the free CI system built into GitHub). Nobody needs a phone, and
nobody needs to set up a laptop. It is the first GitHub Action in this repo.
When it runs, it does this on its own:
02_signup_flowtest from start to finishThe
02_signup_flowtest does the full offline signup, the same way a realnew user would: pick a language, accept the privacy policy, enter a phone
number, enter a name, read the selfie tutorial, take a selfie (the emulator
gives a fake camera image), review and approve, and arrive at the main
dashboard (UPLOAD / MESSAGES / TRACK). The test passes from start to finish.
This PR changes:
.github/workflows/android-e2e.yml- the CI job. It builds the app, bootsthe emulator, runs the test, and uploads the video and screenshots.
apps/e2e/utils/artifacts.ts- records the video and the per-stepscreenshots.
apps/e2e/utils/helpers.ts- the position-based tap helpers that drive theapp's custom buttons (see the note below).
apps/e2e/wdio.conf.ts- connects the video and screenshot recording to thetest run.
apps/e2e/features/step-definitions/steps.ts- small step wiring.apps/e2e/.env.example- example settings, so others can run it locally..gitignore- keep theapps/e2e/.env.exampletemplate tracked.How to run it
apps/e2e/, the Androidapp, or this workflow. You will see the result as a check on the PR.
android-e2e.click "Run workflow".
e2e-evidencefile. Insideare the video and the screenshots.
One thing reviewers should know
Our app's buttons are built in a way that hides them from the test tool. The
test tool cannot find a button by name. It can only tap a position on the
screen. So this test taps buttons by position (for example, "tap 82% across
and 88% down"). This works, but it depends on the screen layout. If the layout
changes, these positions may need small adjustments.
The clean long-term fix is a small change inside the app: give the shared
button a test "tag" (an id the test tool can see). One change to the shared
button would make every screen testable by name, and we could then remove the
position-based taps. That is a follow-up, not part of this PR.
Note:
02_signup_flowis fully offline and needs no secrets, so it works evenon pull requests from a fork. A later test,
03_capture_setup, will need realcloud (AWS) secrets. Pull requests from forks do not get repo secrets, so that
test will need to run after merge, or use a trusted trigger.
Testing
Green in CI on a personal fork (
arnoldcastro5000/treetracker). The last runpassed all 16 checks with result "success", and the dashboard screenshot showed
UPLOAD / MESSAGES / TRACK after signup finished.
Ran by hand:
The uploaded
e2e-evidenceartifact holds the full-scenario video and theper-step screenshots for that run.