Skip to content

Instantly share code, notes, and snippets.

@Kmohamed
Created March 2, 2019 14:48
Show Gist options
  • Save Kmohamed/7e7f8e4f4e45e41debf58cabf0d0dde0 to your computer and use it in GitHub Desktop.
Save Kmohamed/7e7f8e4f4e45e41debf58cabf0d0dde0 to your computer and use it in GitHub Desktop.
func testShowingMovieNameAndImageName() {
dynamicStubs.setupStub(url: "/Movies", filename: "listOfMovies", method: .GET)
app.launch()
let tablesQuery = app.tables
// Assert on first movie
XCTAssertTrue(tablesQuery.cells.staticTexts["Avengers: Infinity War"].exists, "Failure: did not show the first movie name.")
XCTAssertTrue(tablesQuery.cells.staticTexts["8.5"].exists, "Failure: did not show the first movie ratting.")
// Assert on second movie
XCTAssertTrue(tablesQuery.cells.staticTexts["Bohemian Rhapsody"].exists, "Failure: did not show the second movie name.")
XCTAssertTrue(tablesQuery.cells.staticTexts["8.4"].exists, "Failure: did not show the first movie ratting.")
// Assert on third movie
XCTAssertTrue(tablesQuery.cells.staticTexts["Aquaman"].exists, "Failure: did not show the third movie name.")
XCTAssertTrue(tablesQuery.cells.staticTexts["8.3"].exists, "Failure: did not show the first movie ratting.")
// Assert on fourth movie
XCTAssertTrue(tablesQuery.cells.staticTexts["A Star Is Born"].exists, "Failure: did not show the fourth movie name.")
XCTAssertTrue(tablesQuery.cells.staticTexts["8.2"].exists, "Failure: did not show the first movie ratting.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment