自从更新到 Xcode 14.3 后,我的 UITests 无法点击运行 iOS12 的设备上的按钮!
这是我的代码,它在运行 iOS16 的其他设备上以及在使用 Xcode 14.2 时也能正常工作:
@discardableResult
public func waitForButton(with identifier: String) -> XCUIElement {
let button = app.buttons[identifier].firstMatch
let predicate = NSPredicate(format: "exists == true")
let expectation = expectation(for: predicate, evaluatedWith: button, handler: nil)
let result = XCTWaiter.wait(for: [expectation], timeout: 15)
XCTAssertEqual(result, .completed)
return button
}
func testStart() throws {
test.waitForButton(with: "Welcome.button").tap() << fails here
}
失败
Invalid parameter not satisfying: allAttributesForKey != nil (NSInternalInconsistencyException)
我希望这不是 Xcode 删除对旧设备的支持的情况。如果不是因为我们也在我们的管道中测试 iOS16.4 设备,而我们需要 Xcode 14.3,我可以使用 Xcode 14.2。
非常感谢任何帮助!