Xcode UI test - UI Testing Failure - Failed to scroll to visible (by AX action) when tap on Search field "Cancel' button

前端 未结 8 1484
时光取名叫无心
时光取名叫无心 2020-12-04 08:32

I am trying to dismiss the search field by tapping \'Cancel\' button in search bar.

The test case is failing to find the cancel button. It was working fine in Xcode

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 08:56

    The workaround of Sandy seemed help for a while but then no more - I then changed it like this:

    func waitAndForceTap(timeout: UInt32 = 5000) {
        XCTAssert(waitForElement(timeout: timeout))
        coordinate(withNormalizedOffset: CGVector(dx:0.5, dy:0.5)).tap()
    }
    

    Main point being that as the issue is that isHittable check throws an exception, I don't do this check at all and go straight for coordinates after the element is found.

提交回复
热议问题