Skip to content

Releases: nikolainobadi/NnTestKit

2.2.1

Choose a tag to compare

@nikolainobadi nikolainobadi released this 16 Aug 21:04
73c1095

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 a public/open/package declaration under Sources/ without touching Skills/. Waive with the skip-skill-check label when a PR changes no documented behavior.
  • .github/workflows/skill-ref-bump.yml — bumps the marketplace's pinned ref on 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, and selectTime.

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

Choose a tag to compare

@nikolainobadi nikolainobadi released this 23 May 21:02
38d3222

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 @Observable properties 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 @Observable property to an AsyncStream of post-change values, mirroring Published.Publisher.waitUntil from CombineHelpers. Available on macOS 14+, iOS 17+, tvOS 17+, watchOS 10+.
  • AsyncStream.waitUntil(timeout:condition:) — awaits a value that satisfies a predicate, throwing AsyncStream.WaitError.timeout if it isn't reached in time.
  • expectObservationFires(when:afterReading:timeout:sourceLocation:) — a one-shot assertion that verifies an @Observable property change propagates through withObservationTracking after running a trigger.

NnUITestHelpers

  • selectTime(pickerId:hour:minute:period:timeout:) on BaseUITestCase — adjusts compact-style DatePickers configured with displayedComponents: .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

Choose a tag to compare

@nikolainobadi nikolainobadi released this 12 Apr 00:35

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 Codable config 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 in setUpWithError instead of passing timeout: everywhere.
  • iOS 26+ alert fix — tapFirstButton(_:) resolves duplicate matches in the accessibility tree.

Added

NnTestVariables

  • UITestSeedContext<Config> — typed seed payload (runId, config, userEmail, userPassword) with fromEnvironment(_:) factory that decodes UITEST_SEED_CONFIG JSON.
  • UITestSeedKey enum — canonical env var names (UITEST_RUN_ID, UITEST_USER_EMAIL, UITEST_SEED_CONFIG).
  • UITestSeedDefaults — shared password constant and mutable timeout (default 10s).

NnUITestHelpers (on BaseUITestCase)

  • launchSeeded(config:envKeys:) — encodes config, assigns a unique runId + test email, launches the app.
  • setSeedConfig(_:envKeys:) — same, without launching (for flows that own app.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

Choose a tag to compare

@nikolainobadi nikolainobadi released this 22 Nov 18:07
607f61f

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:

  1. 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
            ]
        )
    ]
  2. Update Imports in UI Test Files:

    // Before
    import NnTestHelpers
    
    // After
    import NnUITestHelpers
  3. Note: If you use non-UI test helpers (memory leak tracking, property assertions, etc.), continue importing NnTestHelpers for those.

Other Breaking Changes

  • tapAlertButton default button identifier changed from "Ok" to "Okay"
  • Removed deprecated TrackingMemoryLeaks class (use @LeakTracked macro 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.swift
  • BaseUITestCase+Assertions.swift
  • BaseUITestCase+Buttons.swift
  • BaseUITestCase+Controls.swift
  • BaseUITestCase+DatePicker.swift
  • BaseUITestCase+ElementInteraction.swift
  • BaseUITestCase+ElementRetrieval.swift
  • BaseUITestCase+ElementWaiting.swift
  • BaseUITestCase+RowActions.swift
  • BaseUITestCase+Setup.swift
  • BaseUITestCase+TestData.swift
  • BaseUITestCase+TextInput.swift

This improves maintainability and makes it easier to find specific UI test functionality.


Migration Checklist

  • Update Package.swift to use NnUITestHelpers for UI test targets
  • Update UI test file imports from NnTestHelpers to NnUITestHelpers
  • 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

Choose a tag to compare

@nikolainobadi nikolainobadi released this 27 Sep 22:08

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

Choose a tag to compare

@nikolainobadi nikolainobadi released this 23 Sep 18:58

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 @MainActor and @preconcurrency annotations
  • 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

Choose a tag to compare

@nikolainobadi nikolainobadi released this 20 Apr 23:48

NnTestKit 1.3.0

What's New

  • Added waitUntil(timeout:condition:) helper to Published.Publisher extensions.
    • Allows tests to asynchronously wait for @Published properties to satisfy a condition.
    • Supports timeout handling and cancellation for better test control.

v1.2.1

Choose a tag to compare

@nikolainobadi nikolainobadi released this 13 Apr 03:00

Created separate library for Swift Testing helpers

v1.2.0

Choose a tag to compare

@nikolainobadi nikolainobadi released this 06 Apr 02:51

NnTestKit - v1.2.0

Added

  • TrackingMemoryLeaks base class for detecting retain cycles using Swift's Testing framework.

v1.1.3

Choose a tag to compare

@nikolainobadi nikolainobadi released this 16 Jan 17:57
46bb738

Fixed installation instructions in README