Skip to content

Instantly share code, notes, and snippets.

@tovkal
Created August 24, 2017 21:01
Show Gist options
  • Save tovkal/8a9f547a388bcadb909ec6d8679af099 to your computer and use it in GitHub Desktop.
Save tovkal/8a9f547a388bcadb909ec6d8679af099 to your computer and use it in GitHub Desktop.
class UITests: XCTestCase {
let app = XCUIApplication()
let dynamicStubs = HTTPDynamicStubs()
override func setUp() {
super.setUp()
dynamicStubs.setUp()
}
override func tearDown() {
super.tearDown()
dynamicStubs.tearDown()
}
func testPostCreation() {
...
// Dynamically change the response to see if the feed gets refreshed and post is there
dynamicStubs.setupStub(url: "/api/feed", filename: "feedWithCreatedPost")
app.buttons["createPostButton"].tap()
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment