Guest User

Untitled

a guest
Dec 5th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. private func login() {
  2. let app = XCUIApplication()
  3.  
  4. let username = app.textFields["Username"]
  5. username.tap()
  6. username.typeText("username")
  7.  
  8. let password = app.secureTextFields["Password"]
  9. password.tap()
  10. password.typeText("password")
  11.  
  12. XCUIApplication().buttons["Login"].tap()
  13.  
  14. // We need to wait the server response
  15. waitForElementToAppear(app.navigationBars["Apps"])
  16. }
  17.  
  18. func testDisplayListApp() {
  19. let app = XCUIApplication()
  20. login()
  21.  
  22. // Verify we displayed all applications
  23. XCTAssertEqual(app.tables.firstMatch.cells.count, 7)
  24. XCTAssertTrue(app.tables.cells.firstMatch.staticTexts["com.octo.askbob"].exists)
  25. XCTAssertTrue(app.tables.cells.firstMatch.staticTexts["AskBob"].exists)
  26. XCTAssertTrue(app.tables.cells.element(boundBy: 1).staticTexts["com.fogcreek.trello"].exists)
  27. XCTAssertTrue(app.tables.cells.element(boundBy: 1).staticTexts["Trello"].exists)
  28. // ....
  29. }
Add Comment
Please, Sign In to add comment