theextremeprogrammer / Succinct

UI tests at the speed of unit tests. Proper encapsulation. Architecture agnostic. Freedom to refactor.
MIT License
42 stars 7 forks source link

Succinct (サシンクト)

Build Status Swift Package Manager Compatible Carthage Compatible Cocoapods Compatible GitHub tag codecov jazzy docs GitHub license

Use Succinct to unit test the behaviors of your iOS UI in a way that is de-coupled from the private implementation details of your views.

IMPORTANT:_ Succinct is a work in progress and does not support every single aspect of testing iOS view hierarchies just yet. Functionality in as it is needed. If there's something you'd like to see included please feel free to open an issue or make a PR. 👍🏻

Installation

Swift Package Manager (SPM)

In Xcode, select the File -> Add Packages... menu option and enter https://github.com/derekleerock/Succinct for the the repository URL. Select the desired Dependency Rule and Target then click "Add Package".

Carthage

Simply include Succinct in your Cartfile.private:

github "derekleerock/Succinct"

And include it in your test target.

Cocoapods

Simply add Succinct to your Podfile's test target:

target 'MyAmazingApp' do
  ...

  target 'MyAmazingAppTests' do
    inherit! :search_paths

    pod 'Succinct'
  end
end

Documentation

📄 Documentation via GitHubPages

Automatic documentation generated thanks to Jazzy, GitHubPages and Travis-CI integration and some great guidance from @jgsamudio in this blog post.

Making a Contribution

Development for Succinct is done right here through GitHub Issues so anyone can contribute and understand the current state of the framework. If there is functionality that you're looking for that is not included, please feel free to open an issue or make a PR with your suggested feature and tests so we can discuss.

Setting up for development

Succinct uses the Swift Package Manager integration in Xcode to install dependencies. Xcode will fetch these the first time you build and run the tests.

Running the tests

All of Succinct's tests have been TDD'd using Quick and Nimble - meaning that you can use Succinct with confidence that it will give you accurate results for the functionality that it provides.

There are two different test suites for Succinct: Unit Tests and Simulator Tests.

Unit Tests

These unit tests do not require a host application to run, which means that they can run without the simulator. This makes them lightning fast!

They can be executed using:

$ make tests

Simulator Tests

These unit tests require the simulator since they are interacting with elements in the UI. They are still fast because they are unit tests, but launching the simulator takes a little bit of time.

They can be executed using: $ make simulator-tests

All Tests

Both test suites can be executed using:

$ make alltests

Before completing your PR please be sure your functionality is properly tested and you've confirmed that all tests run successfully - thank you! 🙇🏻‍♂️

License

Succinct is licensed under the MIT License. Please see the LICENSE file.