Skip to main content

Basic navigation test

With caching enabled

Native-first with AI fallback

Run your own XCUITest code first and let the SDK fall back to AI only when it fails. This is the pattern to reach for in a real suite: stable steps stay fast and deterministic, and a step that breaks because the UI moved keeps the test alive instead of failing it.
Keep the natural language command descriptive of what the native code does. It is the AI fallback and the label the step carries in the session recording, so "Tap the Sign In button" is worth more than "fallback".

Bulk assertions and checks

Verify several things against one screenshot rather than one call each. assertBulk fails the test when any condition is not met; checkBulk returns the results so you can branch on them.
Both take a nativeAction closure too. If the closure succeeds, checkBulk reports every condition as true:

Reporting the test result

Report the outcome in tearDown so each run is recorded as passed or failed rather than as auto-completed, and so the session’s slot against your account’s parallel session limit is released as soon as the test ends.
Use testRun?.failureCount rather than a flag you set yourself, so a failure raised anywhere in the test is reflected, including one from assert. Call both with try?: reporting the status is bookkeeping, and a network hiccup on the way out should not turn a passing test red.

With CI metadata

Record what your CI knows and the SDK does not, so a session can be found again by it and reporting can be sliced by it.
Values are strings, so convert anything else before passing it. Keys are free-form apart from language and version, which the SDK reserves to report itself.

With additional context