Failure to determine screen point of hittable tableViewCell
Asked Answered
S

0

6

To UI test of my app, I have to enable/disable iCloud. I do this by launching the Settings app in my test, navigate to the Apple ID scene, and tap there the iCloud cell (see image below).

enter image description here

In my test, I check that the iCloud cell exists and is hittable. Only then I tap the cell:

// when
let iCloudCell = settingsApp.tables.cells["iCloud"]
let iCloudCellFound = iCloudCell.waitForExistence(timeout: 10)
// then
XCTAssert(iCloudCellFound, "iCloud settings not found")
XCTAssert(iCloudCell.isHittable, "iCloud settings not hittable")

// when
iCloudCell.tap()

This works most of the time, but now and then the test stops at iCloudCell.tap() with the log

t =   113.74s         Find: Descendants matching type Table
t =   113.74s         Find: Descendants matching type Cell
t =   113.74s         Find: Elements matching predicate '"iCloud" IN identifiers'
t =   113.85s     Synthesize event
t =   113.97s         Assertion Failure: <unknown>:0: Failed to determine screen point of "iCloud" Cell: Error copying attributes -25202  

EDIT: When this error happens, only the Apple ID scene is shown. No alert, and no other view.

My question is: How can this be that the cell is hittable, but the screen point cannot be determined? And what could be a workaround?

Successful answered 4/6, 2018 at 11:23 Comment(2)
This can sometimes happen if another view is shown over the top of the view you are trying to tap, or if the screen is dimmed for a popover or system alert. Are you 100% sure neither of those are happening during your test?Symphonize
Unfortunately, this is not the case. Just the Apple ID scene is shown. No other view, no alert. I will edit my question to make this clear. Thanks for the pointing out this possibility.Sialagogue

© 2022 - 2024 — McMap. All rights reserved.