Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func login() {
- let app = XCUIApplication()
- let username = app.textFields["Username"]
- username.tap()
- username.typeText("username")
- let password = app.secureTextFields["Password"]
- password.tap()
- password.typeText("password")
- XCUIApplication().buttons["Login"].tap()
- // We need to wait the server response
- waitForElementToAppear(app.navigationBars["Apps"])
- }
- func testDisplayListApp() {
- let app = XCUIApplication()
- login()
- // Verify we displayed all applications
- XCTAssertEqual(app.tables.firstMatch.cells.count, 7)
- XCTAssertTrue(app.tables.cells.firstMatch.staticTexts["com.octo.askbob"].exists)
- XCTAssertTrue(app.tables.cells.firstMatch.staticTexts["AskBob"].exists)
- XCTAssertTrue(app.tables.cells.element(boundBy: 1).staticTexts["com.fogcreek.trello"].exists)
- XCTAssertTrue(app.tables.cells.element(boundBy: 1).staticTexts["Trello"].exists)
- // ....
- }
Add Comment
Please, Sign In to add comment