TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Dec 2016 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Paul Zabelin.
Depends on: | |
KIF | ~> 3.0 |
Quick | ~> 1.0 |
Write KIF tests Quick style in Swift!
KIF-Quick is a bridge between the Keep It Functional and Quick frameworks. It allows you to perform KIF actions using Quick syntax.
KIF-Quick is available through CocoaPods. To install it, simply add pod 'KIF-Quick'
to your test target in Podfile:
target 'Your App' do
...
end
target 'Acceptance Tests' do
pod 'KIF-Quick'
end
this will also install KIF and Quick frameworks as dependencies ensuring compatible versions.
import KIF_Quick
in your specs and start writing KIF tests using Quick describe/context and it blocks. See the SampleSpec.m example:
import Quick
import KIF_Quick
class MainViewSpec: KIFSpec {
override func spec() {
describe("example app") {
context("main view") {
context("tap") {
it("should change to Thank you") {
viewTester().usingLabel("Tap Me").tap()
viewTester().usingLabel("Thank you!").waitForView()
}
}
}
}
}
}
To run the sample spec in example project, clone the repo, and open Example workspace:
open Example/KIF-Quick.xcworkspace
Select simulator and run tests as usual by pressing Command + U
Run tests using xcodebuild:
xcodebuild -workspace Example/KIF-Quick.xcworkspace -scheme KIF-Quick-Example -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 7,OS=10.2' ONLY_ACTIVE_ARCH=NO test
This is how Travis runs them to keep us honest, see .travis.yml
And you should see test output similar to this
▸ Test Succeeded
All tests
Test Suite KIF-Quick_Tests.xctest started
SampleSpec
✓ example_app__main_view__should_have_a_button (0.003 seconds)
✓ example_app__main_view__tap__should_be_grateful (0.581 seconds)
Executed 2 tests, with 0 failures (0 unexpected) in 0.584 (0.586) seconds
where nested Quick contexts concatenated to give full KIF test name. This allows to pinpoint location of possible failures when they happen and have readable English like sentenses describing the functionality.
If your project is still using Swift 2 you can can use previous version of KIF-Quick. Use the table below to determine which versions of KIF-Quick are compatible with your project.
Swift version | KIF-Quick version |
---|---|
Swift 3 | v1.1.0 or later |
Swift 2.2 / Swift 2.3 | v1.0.0 |
or you can specify this branch in your Podfile:
pod 'KIF-Quick', :git => 'https://github.com/doordash/KIF-Quick.git', :branch => 'swift2.3'
KIF-Quick is available under the MIT license. See the LICENSE file for more info.