无法确定可命中的tableViewCell的屏幕点

Rei*_*ner 5 xcode ui-testing uitableview ios xcode-ui-testing

要对我的应用进行UI测试,我必须启用/禁用iCloud.我通过在测试中启动"设置"应用程序,导航到Apple ID场景,然后点击iCloud单元格(参见下图)来完成此操作.

在此输入图像描述

在我的测试中,我检查iCloud单元是否存在并且是可命中的.然后我点击单元格:

// 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()
Run Code Online (Sandbox Code Playgroud)

这在大多数情况下都有效,但是现在测试在iCloudCell.tap()日志中 停止

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  
Run Code Online (Sandbox Code Playgroud)

编辑: 发生此错误时,仅显示Apple ID场景.没有警报,也没有其他观点.

我的问题是:这怎么可能是单元格可以击中,但屏幕点无法确定?什么可以成为一种解决方法?