Skip to content

iOS View Controllers integration testing framework made easy

License

Notifications You must be signed in to change notification settings

openium/SwiftiumTestingKit

Repository files navigation

SwiftiumTestingKit

This "Kit" adds many feature to speed up iOS app testing. It allows to write Unit tests for testing view controllers "quicker than UI Tests".

Example :

func testWaitForTapableTextAndTapIt_shouldHaveTap() {
    // Given
    let solo = STKSolo()
    let viewController = ViewController()
    solo.showViewControllerInCleanWindow(viewController)

    // When
    let waitForText = solo.waitFor(tappableText:"Hello button", andTapIt:true)
    
    // Expect
    XCTAssertTrue(waitForText)
    XCTAssertTrue(viewController.tapped)
}

see more in STKSoloTests.swift

Installation

Swift Package Manager

See official documentation

Setup

Add the following libraries to your test target :

  • OHHTTPStubs
  • SwiftiumTestingKit
  • KIF

To be done :

Change log

We follow keepachangelog.com recommandations for our CHANGELOG

Useful links

https://medium.com/@hacknicity/how-to-switch-your-ios-app-and-scene-delegates-for-improved-testing-9746279378c3