Rightpoint / ios-template

A `cookiecutter` template for iOS projects
MIT License
94 stars 26 forks source link

Automated UI Testing and Screenshots #96

Closed chrisballinger closed 6 years ago

chrisballinger commented 6 years ago

Adds support for automated UI testing, including taking screenshots. Using XCUITest you can record application flows and then edit the generated Swift interactions to your needs, optionally taking screenshots along the way.

    func testOnboarding() {
        XCTAssertTrue(XCUIApplication().buttons["Skip"].waitForExistence(timeout: 5))
        snapshot("Onboarding-1")
        XCUIApplication().buttons["Skip"].tap()
        snapshot("Onboarding-2")
    }

You can also run the screenshotter manually, if you don't mind waiting a very long time.

$ bundle exec fastlane snapshot

When run on CI the results are uploaded as CircleCI build artifacts and included in the Danger PR comment (see below).

raizlabs-oss-bot commented 6 years ago
1 Warning
:warning: Big PR
4 Messages
:book: Test Results
:book: Code Coverage: xcov
:book: Code Coverage: Slather
:book: Screenshots

Current coverage for Services.framework is 68.68%

Files changed - -
Alamofire+PRODUCTNAME.swift 57.75% :warning:
OAuth.swift 81.48% :white_check_mark:

Current coverage for debug-PRODUCTNAME.app is 1.81%

Files changed - -
StatusBarConfiguration.swift 0.00% :skull:
ProcessInfo+Utilities.swift 0.00% :skull:
AppDelegate.swift 26.09% :no_entry_sign:

Powered by xcov

Generated by :no_entry_sign: Danger