Created
October 25, 2015 22:17
-
-
Save sharplet/8cceb838ae2a676734a9 to your computer and use it in GitHub Desktop.
Cucumber inspired syntax for Xcode UI tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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