I am trying to run a UI test for my app:
func testFeed() throws {
let tablesQuery = app.tables
let cell = tablesQuery.children(matching: .cell).element(boundBy: 0)
cell.swipeUp()
sleep(2)
let cellToLike = tablesQuery.children(matching: .cell).element(boundBy: 1)
cellToLike.buttons["LikeButtonOff"].tap()
cellToLike.buttons["LikeButtonOn"].tap()
sleep(2)
cellToLike.tap()
sleep(2)
let image = app.scrollViews.images.element(boundBy: 0)
// Zoom in
image.pinch(withScale: 3, velocity: 1) // zoom in
// Zoom out
image.pinch(withScale: 0.5, velocity: -1)
let navBackButtonWhiteButton = app.buttons["NavBackButtonWhite"]
navBackButtonWhiteButton.tap()
}
but on the line cellToLike.buttons["LikeButtonOff"].tap() I get the following error:
Failed to failed to compute hit point for Button, {{354.0, 644.7}, {44.0, 44.0}}, identifier: 'LikeButton', label: 'LikeButtonOn': Activation point invalid and no suggested hit points based on element frame
I tried checking the isHittable property of my button and it equals "false" for some reason. When I test the app myself I don't get any errors and I can interact with like button. What can be the issue?
Im using Xcode 15.2
Topic:
Developer Tools & Services
SubTopic:
Xcode