Skip to content

feat: mobilewright e2e suite, coverage automation, and CI gating - #25

Merged
johnnyhuy merged 3 commits into
mainfrom
test/e2e-and-coverage
Oct 3, 2026
Merged

johnnyhuy merged 3 commits into
mainfrom
test/e2e-and-coverage

Conversation

@johnnyhuy

Copy link
Copy Markdown
Contributor

Summary

  • e2e/ — new mobilewright suite (Playwright-style locators over the accessibility tree): plan/tab smoke + the Figma log-a-set → rest → skip flows. tests/helpers.ts resets the app per test (uninstall → install current build → simctl launch with UI_TESTING/DEMO_MODE) since mobilewright cannot pass launch arguments; set counters are matched structurally so the weekday-varying demo plan (Push/Pull/Legs/Upper + rest-day fallback) cannot flake the suite.
  • Coverage automation — mise run test:coverage (SwiftPM llvm-cov report, optional LCOV_OUT lcov export) and mise run ios:coverage (XCUITest with -enableCodeCoverage + xccov report printed even on failure), mise run ios:e2e (build → boot sim → agent → suite, self-bootstraps npm on fresh checkouts).
  • CI gating — coverage and e2e jobs in build.yml; the .xcresult and e2e reports upload with if: always() for failure debugging (pinned actions/upload-artifact@043fb46… # v7.0.1).
  • Test fix — LogViewUITests.testLogPastWorkoutRowOpensSheet asserted app.sheets, but iOS 26 exposes the sheet's bare Text outside any Sheet element (it does present; sheets=0 while the label appears in a second subtree). Now asserts content like the rest of the suite. This test merged red in feat(ios): sync design system and app screens to code #23 — UI tests never ran in CI.
  • Toolchain — pinned node = 24 in mise tools (e2e toolchain needs require(esm); 22.11 fails to load its config), simulator runtime fallback to any iPhone for CI images without iOS 26.2.

Consequences

  • PRs now gate on 27 UI tests (~8 min) and 4 e2e tests (~4 min incl. build) on macos-15 runners, in parallel with existing jobs.
  • Repo baseline of 508 swiftlint violations is untouched (lint is not part of CI); the changed Swift file lints clean.

Testing

  • Unit: 95 tests pass (mise run test)
  • UI + coverage: 27/27 pass, app target 39.54% via xccov (mise run ios:coverage)
  • e2e: 4/4 pass in 1.2m, after the weekday-dependence fix (mise run ios:e2e)
  • actionlint .github/workflows/build.yml clean

johnnyhuy and others added 3 commits October 3, 2026 09:55
app.sheets stays empty for the sheet's bare Text presentation on iOS 26
(the sheet does present — the label appears in a second accessibility
subtree), so the Sheet-element assertion could never pass. Match the
suite's content-based convention instead: wait for the label to appear
a second time (add-row button + sheet content).

Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
- e2e/: mobilewright suite for iOS — Playwright-style locators over the
  accessibility tree. tests/helpers.ts resets the app per test
  (uninstall -> install current build -> simctl launch with UI_TESTING /
  DEMO_MODE) since mobilewright cannot pass launch arguments. Covers
  plan/tab smoke plus the Figma log-a-set -> rest -> skip flows, with
  set counters matched structurally so the weekday-varying demo plan
  cannot flake the suite.
- mise test:coverage: swift test with code coverage + llvm-cov report,
  optional lcov export via LCOV_OUT.
- mise ios:coverage: XCUITest run with -enableCodeCoverage and an xccov
  report (printed even on test failure); falls back to any iPhone
  simulator when the iOS 26.2 runtime is absent.
- mise ios:e2e: build -> boot sim -> mobilewright agent -> run suite;
  npm ci self-bootstraps fresh checkouts.
- Pinned node = 24 in mise tools: the e2e toolchain needs require(esm)
  support, which node 22.11 lacks.

Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
- coverage job: runs the XCUITest suite with code coverage and uploads
  the .xcresult bundle on every run (if: always()) for failure debugging.
- e2e job: runs the mobilewright suite end to end and uploads its
  reports; mise handles deps, build, simulator boot, and agent install.
- Both pinned to actions/upload-artifact v7.0.1 by SHA.

Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​mobilewright/​test@​0.0.629810010096100
Addedmobilewright@​0.0.629910010096100

View full report

@johnnyhuy
johnnyhuy merged commit a0d0007 into main Oct 3, 2026
8 of 10 checks passed
@johnnyhuy
johnnyhuy deleted the test/e2e-and-coverage branch October 3, 2026 00:08
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