Skip to content

feat(biometric): Face ID / Touch ID / fingerprint testing (v0.9.7)#110

Merged
pbertsch merged 1 commit into
mainfrom
feat/biometric
May 13, 2026
Merged

feat(biometric): Face ID / Touch ID / fingerprint testing (v0.9.7)#110
pbertsch merged 1 commit into
mainfrom
feat/biometric

Conversation

@pbertsch
Copy link
Copy Markdown
Contributor

Summary

Three new ProbeScript steps that drive biometric authentication on iOS Simulator and Android emulator without real hardware. Test the happy path (match) and unhappy path (no-match) of every Face ID / Touch ID / fingerprint flow in your app.

enroll biometric            # one-time setup, typically in `before all tests`
biometric match             # successful capture — unblocks a pending prompt
biometric no match          # failed capture — exercises the failure path

Matching annotation DSL:

@ProbeSuite(
  beforeAll: [EnrollBiometric()],
  tests: [
    ProbeTest('matching face unlocks app', steps: [
      Tap(text: 'Sign in with Face ID'),
      BiometricMatch(),
      See('Dashboard'),
    ]),
    ProbeTest('non-matching face is rejected', steps: [
      Tap(text: 'Sign in with Face ID'),
      BiometricNoMatch(),
      See('Authentication failed'),
    ]),
  ],
)
class BiometricAuthScreen {}

Implementation

Platform Mechanism
iOS Simulator xcrun simctl spawn booted notifyutil -p com.apple.BiometricKit_Sim.faceCapture.{match,no-match} (and .fingerTouch.* siblings, so same step works on Face ID and Touch ID devices)
Android emulator adb -s <serial> emu finger touch 1 (matches enrolled id 1) / ... 9999 (no match)
Physical iOS/Android Skipped with a warning (same pattern as set location, allow permission)

Test plan (strict)

  • go test ./... — 16/16 packages pass (including 3 new biometric parser tests)
  • staticcheck ./... — zero issues
  • dart test probe_annotation — 3/3 const tests pass
  • dart test probe_gen — 12/12 builder tests pass (was 11; +biometric_auth golden)
  • TestGoldenIntegration_DartEmittedFiles11/11 fixtures parse cleanly through Go parser
  • npm run build website — 37 pages built clean

Docs

  • New biometric section on annotations.md and syntax.md
  • Updated docs/wiki/Annotations.md
  • Per-package CHANGELOGs updated

🤖 Generated with Claude Code

New ProbeScript steps and matching annotation DSL classes for driving
biometric auth flows on iOS Simulator and Android emulator without real
hardware. Skipped on physical devices with a warning (same pattern as
set location, allow permission, and other simulator-only ops).

Parser
  2 new keywords (TOKEN_BIOMETRIC, TOKEN_ENROLL), 3 new ActionVerb
  constants (VerbEnrollBiometric, VerbBiometricMatch,
  VerbBiometricNoMatch), 2 new dispatch cases in parseStep, parseBiometric
  and parseEnrollBiometric helpers. 3 new parser_test.go tests covering
  every form.

Runner
  EnrollBiometric, BiometricMatch, BiometricNoMatch methods on
  DeviceContext. iOS uses xcrun simctl spawn booted notifyutil -p
  com.apple.BiometricKit_Sim.faceCapture.match / .no-match (and the
  fingerTouch.* equivalents, so the same step works on Face ID AND Touch
  ID devices). Android uses adb -s <serial> emu finger touch <id>
  where id=1 is matching (must be pre-enrolled) and id=9999 is no-match.
  Physical devices skip with a warning, same pattern as SetLocation.
  Dispatch cases in Executor.runAction; human-readable strings in
  stepDescription so verbose runner output reads naturally.

Annotation DSL
  3 new const Step classes — EnrollBiometric, BiometricMatch,
  BiometricNoMatch — added to probe_annotation/lib/src/steps.dart.
  Added to the const-constructibility test. Comprehensive doc comments
  document the iOS/Android command paths and the physical-device skip.

Emitter
  3 new cases in probe_gen/lib/src/probe_emitter.dart that produce
  'enroll biometric', 'biometric match', 'biometric no match' lines.
  New biometric_auth fixture+golden pair covering happy path (match
  unlocks Dashboard) and unhappy path (no-match shows Authentication
  failed). Cross-language golden_integration_test auto-picks it up.

Tests (strict)
  go test ./...                   16/16 packages pass
  staticcheck ./...               zero issues
  parser_test.go                  3 new biometric tests pass
  probe_annotation dart test      3/3 const tests pass
  probe_gen dart test              12/12 builder tests pass (was 11; +biometric_auth)
  GoldenIntegration Go test       11/11 fixtures parse cleanly
  Astro npm run build              37 pages built clean

Docs
  website/src/content/docs/probescript/syntax.md         new Biometric section
  website/src/content/docs/probescript/annotations.md    new Biometric subsection + DSL table entry
  docs/wiki/Annotations.md                                step DSL table updated
  README.md                                               v0.9.7 callout added
  CHANGELOG.md (root)                                     [0.9.7] entry
  probe_agent/CHANGELOG.md                                version-only bump
  probe_annotation/CHANGELOG.md                           feature entry
  probe_gen/CHANGELOG.md                                  feature entry
  vscode/package.json, docs/wiki/Home.md, mcp.md          version refs bumped

Trade-offs (per user acknowledgement)
  Real Face ID and Touch ID require an actual face or finger —
  these steps are simulator/emulator only. Tests should target
  a simulator/emulator in CI; physical iOS/Android device paths
  skip with a warning so the test still completes.
@pbertsch pbertsch requested a review from a team as a code owner May 13, 2026 01:24
@pbertsch pbertsch merged commit ab5e4b2 into main May 13, 2026
15 checks passed
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