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).
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?