0

I'm trying to write an UI-Test for my iOS application. For any reason I'm not able to tap on my custom table view cell. Here is how I'm trying to do that:

let app = XCUIApplication()
let staticTextOfFirstCell = app.tables.cells.elementBoundByIndex(0)
    .staticTexts.elementBoundByIndex(0)
staticTextOfFirstCell.tap()

The staticTextOfFirstCell is set and also exists. However, my test cases stays in the Wait for app to idle state.

andreaspfr
  • 2,298
  • 5
  • 42
  • 51
  • Do you have any animations or activity indicators actively being shown? – Joe Masilotti Apr 08 '16 at 14:42
  • When the page shows up I'm loading data first from the backend. During that time an indicator is shown. However, I already tried to add some logic to wait until the data is shown. – andreaspfr Apr 08 '16 at 20:26

1 Answers1

0

If you're using UIRefreshControl try to comment showing the loading indicator, if it works fine and carry on with the UI testing, the wrap showing it with build configuration if statement to be like this:

    #if !TEST
    if let refreshControl = refreshControl where !refreshControl.refreshing {
        refreshControl.beginRefreshing()
    }
    #endif

that way it wont execute this code block once you're running your UI test.

Note that you need to add build configuration for your UI test. There is a radar bug reported here for animations (I believe the same thing goes to Refresh Control)

Amjad Husseini
  • 475
  • 7
  • 12