Skip to content

Instantly share code, notes, and snippets.

@sharplet
Created October 25, 2015 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharplet/8cceb838ae2a676734a9 to your computer and use it in GitHub Desktop.
Save sharplet/8cceb838ae2a676734a9 to your computer and use it in GitHub Desktop.
Cucumber inspired syntax for Xcode UI tests
final class GreetingFeature: Feature {
override func scenarios() {
Scenario("Greeting on first load")
.Given("the app has launched")
.Then("the text 'Hello, world!' is on screen")
}
}
final class GreetingSteps: StepDefinition {
override func steps() {
let app = XCUIApplication()
Given("the app has launched") {
app.launch()
}
Then("the text 'Hello, world!' is on screen") {
expect(app.staticTexts["Hello, world!"].exists).to(beTrue())
}
}
}
import Nimble
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment