Skip to content

Instantly share code, notes, and snippets.

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 Calvin-Huang/1364c05d08af1191fa5376ba81a4c4ed to your computer and use it in GitHub Desktop.
Save Calvin-Huang/1364c05d08af1191fa5376ba81a4c4ed to your computer and use it in GitHub Desktop.
func test_changeContentView() {
let xctExpectation = expectation(description: "Wait for carousel auto slide.")
let carouselView = self.app.scrollViews.element
let alertView = self.app.alerts.element
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 4.5) { [unowned self] in
carouselView.tap()
XCTAssertTrue(alertView.staticTexts["You selected page: 1 in carousel."].exists, "CarouselView should auto slides to second .")
alertView.buttons["OK"].tap()
self.app.buttons["Change Content To Colored Views"].tap()
carouselView.tap()
XCTAssertTrue(alertView.staticTexts["You selected page: 0 in carousel."].exists, "CarouselView should reset to first view.")
alertView.buttons["OK"].tap()
}
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 12.5) {
carouselView.tap()
XCTAssertTrue(alertView.staticTexts["You selected page: 1 in carousel."].exists, "CarouselView should auto slides to secview after change content.")
xctExpectation.fulfill()
}
waitForExpectations(timeout: 20.0) { e in
XCTAssertTrue(e == nil, "Everything not completed in 10.0 sec.")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment