Repository navigation
Releases: nikolainobadi/NnTestKit
Release list
2.2.1
NnTestKit 2.2.1
Documentation and tooling release. No public API changes — the only Sources/ edits are doc comments.
The skill now lives in this repo
The NnTesting skill moved from the NobadiScripts marketplace into Skills/NnTesting, and is published through nn-swift-skills pinned to this tag.
It documented an API in a different repo, so nothing made the two change together — a convention spanning a repo boundary has no enforcement point. Co-locating them makes the API change and the doc change the same diff.
Added
.github/workflows/skill-docs.yml— fails any PR touching apublic/open/packagedeclaration underSources/without touchingSkills/. Waive with theskip-skill-checklabel when a PR changes no documented behavior..github/workflows/skill-ref-bump.yml— bumps the marketplace's pinnedrefon tag push, so released docs always match a shipped version.- README coverage for 2.2.0's API, which shipped undocumented:
observationStream(of:),expectObservationFires,Published.Publisher.waitUntil, andselectTime.
Fixed
Documentation only — all of these described behavior the code hasn't had since 2.1.0 or earlier.
| Claim | Reality |
|---|---|
| README badge: iOS 15+ / macOS 12+ | iOS 17+ / macOS 13+ |
waitForElement, elementAppeared, elementNotAppeared, deleteRow default to 3s (README and doc comments) |
UITestSeedDefaults.timeout, 10s, since 2.1.0 |
typeInField parameter shouldTapFieldBeforeTyping |
tapFieldBeforeTyping |
selectDate can only change day, or month and day |
selectTime also exists |
CLAUDE.md: @LeakTracked on a struct |
Generates a deinit; requires a class |
Also: broken table-of-contents anchor, and assorted prose typos.
waitForCondition in NnTestHelpers still documents a 3-second default — that one is correct and was left alone.
Upgrading
Nothing to do. No source-compatible change; from: "2.2.0" already resolves here.
2.2.0
NnTestKit 2.2.0
Released 2026-05-23
This release expands @Observable testing support and adds a UI test helper for time-based date pickers.
Highlights
- Observation testing helpers — bridge
@Observableproperties to async streams and assert on change propagation, mirroring the ergonomics of the existing Combine helpers. - Time picker UI helper — drive compact
DatePickers configured for hour/minute selection, with AM/PM support for 12-hour locales.
What's New
NnSwiftTestingHelpers
observationStream(of:)— bridges an@Observableproperty to anAsyncStreamof post-change values, mirroringPublished.Publisher.waitUntilfromCombineHelpers. Available on macOS 14+, iOS 17+, tvOS 17+, watchOS 10+.AsyncStream.waitUntil(timeout:condition:)— awaits a value that satisfies a predicate, throwingAsyncStream.WaitError.timeoutif it isn't reached in time.expectObservationFires(when:afterReading:timeout:sourceLocation:)— a one-shot assertion that verifies an@Observableproperty change propagates throughwithObservationTrackingafter running a trigger.
NnUITestHelpers
selectTime(pickerId:hour:minute:period:timeout:)onBaseUITestCase— adjusts compact-styleDatePickers configured withdisplayedComponents: .hourAndMinute, including optional AM/PM wheel support for 12-hour locales.
Compatibility
No breaking changes. The new observation helpers require macOS 14+ / iOS 17+ / tvOS 17+ / watchOS 10+.
Full changelog: v2.1.0...v2.2.0
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.
v2.0.0
NnTestKit v2.0.0 Release Notes
Release Date: November 22, 2025
Overview
Major release introducing a new dedicated UI testing library and timeout customization for all UI test helpers.
⚠️ Breaking Changes
UI Test Helpers Moved to New Library
BaseUITestCase and all UI testing utilities have been moved from NnTestHelpers to a new NnUITestHelpers library.
Migration Required:
-
Update Package.swift:
dependencies: [ .package(url: "https://github.com/nikolainobadi/NnTestKit", from: "2.0.0") ], targets: [ .testTarget( name: "YourUITests", dependencies: [ .product(name: "NnUITestHelpers", package: "NnTestKit") // Changed from NnTestHelpers ] ) ]
-
Update Imports in UI Test Files:
// Before import NnTestHelpers // After import NnUITestHelpers
-
Note: If you use non-UI test helpers (memory leak tracking, property assertions, etc.), continue importing
NnTestHelpersfor those.
Other Breaking Changes
tapAlertButtondefault button identifier changed from"Ok"to"Okay"- Removed deprecated
TrackingMemoryLeaksclass (use@LeakTrackedmacro instead)
✨ New Features
NnUITestHelpers Library
New dedicated library for UI testing utilities with better separation of concerns.
Timeout Customization
All UI test helper methods now support customizable timeout parameters (default: 3 seconds):
// Use default 3-second timeout
tapButton("Submit")
// Customize timeout for slow-loading elements
tapButton("Submit", timeout: 10)
// Works across all UI helpers
typeInField(fieldId: "email", text: "test@example.com", timeout: 5)
selectDate(pickerId: "datePicker", dayNumberToSelect: 15, timeout: 8)Methods with timeout support:
- Button actions:
tapButton,tapAlertButton,tapAlertSheetButton - Controls:
tapToggle,tapSegmentedControl,adjustStepper - Element retrieval:
getRowContainingText,getField - Text input:
typeInField,typeInAlertField - Date pickers:
selectDate - Row actions:
deleteRow - Assertions:
assertButton
🔧 Improvements
Better Code Organization
BaseUITestCase refactored into focused extension files:
BaseUITestCase+Alerts.swiftBaseUITestCase+Assertions.swiftBaseUITestCase+Buttons.swiftBaseUITestCase+Controls.swiftBaseUITestCase+DatePicker.swiftBaseUITestCase+ElementInteraction.swiftBaseUITestCase+ElementRetrieval.swiftBaseUITestCase+ElementWaiting.swiftBaseUITestCase+RowActions.swiftBaseUITestCase+Setup.swiftBaseUITestCase+TestData.swiftBaseUITestCase+TextInput.swift
This improves maintainability and makes it easier to find specific UI test functionality.
Migration Checklist
- Update Package.swift to use
NnUITestHelpersfor UI test targets - Update UI test file imports from
NnTestHelperstoNnUITestHelpers - Check for
tapAlertButton()calls expecting "Ok" and update to "Okay" if needed - Optional: Add timeout parameters to UI helpers for better test reliability
- Run tests to verify everything compiles and passes
Support
For issues or questions, please visit: https://github.com/nikolainobadi/NnTestKit/issues
v1.4.1
Release Notes 1.4.1 - 2025-09-27
Highlights
- Improved @LeakTracked macro documentation with clearer usage requirements
- Enhanced README with comprehensive import statements and examples
Changes
- Changed: Clarified class requirement for @LeakTracked macro, expanded usage examples with imports, simplified test class declarations in README
(For full details, see CHANGELOG.md)
v1.4.0
NnTestKit 1.4.0 Release Notes
New Features
@LeakTracked Macro
- Introduces memory leak detection without inheritance requirements
- Provides better Swift 6 Sendable conformance
- Includes comprehensive migration guide from deprecated
TrackingMemoryLeaks
Swift 6 Compatibility
- Fixed concurrency warnings with
@MainActorand@preconcurrencyannotations - Ensures compatibility with Swift 6's strict concurrency checking
Migration
Replace inheritance-based memory leak tracking:
// Old
class MyTests: TrackingMemoryLeaks { }
// New
@LeakTracked
struct MyTests { }v1.3.0
NnTestKit 1.3.0
What's New
- Added
waitUntil(timeout:condition:)helper toPublished.Publisherextensions.- Allows tests to asynchronously wait for
@Publishedproperties to satisfy a condition. - Supports timeout handling and cancellation for better test control.
- Allows tests to asynchronously wait for
v1.2.1
Created separate library for Swift Testing helpers
v1.2.0
NnTestKit - v1.2.0
Added
TrackingMemoryLeaksbase class for detecting retain cycles using Swift'sTestingframework.- Automatically asserts deallocation of tracked objects on teardown (similar to
addTeardownBlockinXCTestCase). - Inspired by Chris Downie’s article on memory leak detection.
- Automatically asserts deallocation of tracked objects on teardown (similar to
v1.1.3
Fixed installation instructions in README