-
Notifications
You must be signed in to change notification settings - Fork 19
XCTest Integration
Tyler-Keith-Thompson edited this page Mar 17, 2019
·
6 revisions
There have been a couple of instances where people have requested that CucumberSwift give a lot of the same control that you get with an XCTestCase so here we go:
CucumberSwift defines a way to create expectations just like XCTestCase
Given("some precondition") { _, _ in
let expectation = self.expectation(description: "waiting")
self.wait(for: [expectation], timeout: 3)
}
This can be a hot button topic, should a test stop executing as soon as it hits a failure, or should it keep going.
There are 2 ways of defining this:
extension Cucumber: StepImplementation {
public var continueTestingAfterFailure = true
}
Given("some precondition") { _, step in //this ignores the global definition, but only for this step
step.continueTestingAfterFailure = false
}