How to pause XCUITest for manual Simulator manipulation?

Viewed 487

I'm trying to automate parts of my UI testing using XCUITest. I wan't the test do automatically do parts of the test, and then wait for me to do some stuff manually. Is there a good way to do this?

Right now I'm just doing this:

class QDBUITestHost: XCTestCase {

  override func setUp() {
    continueAfterFailure = false
    XCUIApplication().launch()
  }

  override func tearDown() {}

  func testHosting() {
    let app = XCUIApplication()
    app.buttons["Select Group"].tap()
    app.sheets.buttons["com-mist-qdb-1"].tap()
    app.buttons["Host"].tap()
    sleep(600) // This is an ugly hack
  }

}

So, is there a better way to do this, rather than to just sleep(600)?

1 Answers

There is a xctwaiter framework.

You can use expectations to wait the results. They are very flexible.

let result = XCTWaiter().wait(for:[expectation], timeout: 10)

How to use an expectation you can see in the documentation. An example.

Related