Im getting this error on the Unit Test:
No matches found for Find: Elements matching predicate '"addressSearchBar" IN identifiers' from input {(
SearchField, 0x60000038a420, traits: 146029151232, label: 'Search on Google Maps', placeholderValue: 'Search on Google Maps'
)}
This the unit Test:
func testTypeSearch() {
app.searchFields["addressSearchBar"].typeText("Springfield")
}
Ive been looking at this post: Xcode UITest sometimes does not find property of XCUIElement
And Ive set isAccessibilityElement
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(true)
view.isAccessibilityElement = false
view.backgroundColor = UIColor.white
navigationController?.setNavigationBarHidden(true, animated: true)
}
and here:
searchBar = UISearchBar()
searchBar.isAccessibilityElement = false
searchBar.accessibilityIdentifier = "addressSearchBar"
I've tried multiple solutions and I didn't manage to solve the problem.