Skip to content

v2.0.0

Choose a tag to compare

@nikolainobadi nikolainobadi released this 22 Nov 18:07
· 17 commits to main since this release
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