Xcode 14.3 XCUITests not recognising buttons on iOS12 devices

252 Views Asked by At

Since updating to Xcode 14.3, my UITests are failing to tap buttons on devices running iOS12!

Here is my code which works fine on other devices running iOS16 and also when using 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
}

Fails with Invalid parameter not satisfying: allAttributesForKey != nil (NSInternalInconsistencyException)

I am hoping it's not a case of Xcode removing support for older devices. I could use Xcode 14.2 instead if it wasn't for the fact that we are also testing iOS16.4 devices in our pipeline which we need Xcode 14.3 for.

Any help most appreciated!

0

There are 0 best solutions below