Repository navigation
2.1.0
NnTestKit 2.1.0
Released 2026-04-11
Adds a typed seeding pipeline for driving app state from UI tests, plus a configurable global timeout for UI helpers.
Highlights
- Seeded UI tests — push a
Codableconfig from test → app via environment variables, decode it at launch, and run your app-side seeder before UI renders. - Global UI timeout — all UI helpers now fall back to
UITestSeedDefaults.timeout(default 10s, was 3s). Override once insetUpWithErrorinstead of passingtimeout:everywhere. - iOS 26+ alert fix —
tapFirstButton(_:)resolves duplicate matches in the accessibility tree.
Added
NnTestVariables
UITestSeedContext<Config>— typed seed payload (runId,config,userEmail,userPassword) withfromEnvironment(_:)factory that decodesUITEST_SEED_CONFIGJSON.UITestSeedKeyenum — canonical env var names (UITEST_RUN_ID,UITEST_USER_EMAIL,UITEST_SEED_CONFIG).UITestSeedDefaults— sharedpasswordconstant and mutabletimeout(default 10s).
NnUITestHelpers (on BaseUITestCase)
launchSeeded(config:envKeys:)— encodes config, assigns a uniquerunId+ test email, launches the app.setSeedConfig(_:envKeys:)— same, without launching (for flows that ownapp.launch()).mainUserEmail— generated email for the current run.seedEmail(for:)— derive additional seeded-user emails by name.makeUniqueName(_:)— collision-free names across runs.dismissPasswordPromptIfNeeded(timeout:)— dismisses the iOS "Save Password?" system prompt.tapFirstButton(_:query:timeout:)— taps the first matching button when iOS duplicates elements in the accessibility tree.
Changed
- UI helper timeouts now default to
UITestSeedDefaults.timeout(10s) instead of hard-coded 3s. Affects:tapButton,tapAlertButton,tapAlertSheetButton,tapToggle,tapSegmentedControl,adjustStepper,waitForElement,elementAppeared,elementNotAppeared,typeInField,typeInAlertField.
Migration
No breaking changes. Existing tests keep working; explicit timeout: arguments still win over the new global default.
If you were relying on the 3-second default, either pass timeout: 3 at the call site or set UITestSeedDefaults.timeout = 3 in setUpWithError.