When we run our UI tests locally with Xcode all tests pass time after time. But when we run the UI tests on our continuous integration server using Fastlane many tests fail with "UI Testing Failure - No matches found for". While investigating the issue we found that the UI tests also fail when run them locally using `xcodebuild test`. Is anyone experiencing the same issues? Why do the UI tests behave differently when run using Xcode and `xcodebuild test` on the same machine ?
"UI Testing Failure - No matches found for" when using `xcodebuild test`
We're also experiencing the same problems when running UITests with `xcodebuild test`. When executing the same tests within Xcode we have consistent passes, however, when executing the UITests in terminal, with the following command:
xcodebuild test -workspace Example.xcworkspace -scheme ExampleUITests -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.3'A number of the tests fail. Then when running the same command on the same machine, without making any changes to the tests, they pass. These failures are usually caused by the simulator not tapping a button that "exists" and is "hittable". I've implemented an expectation on the elements to ensure they're hittable but for some reason they're still flaky and occasionally pass and occasionally fail.
func waitForElementAndTap(element: XCUIElement, timeout: NSTimeInterval = 10, file: String = #file,
line: UInt = #line) {
let hittablePredicate = NSPredicate(format: "hittable == true")
expectationForPredicate(hittablePredicate, evaluatedWithObject: element, handler: nil)
waitForExpectationsWithTimeout(timeout) { (error) -> Void in
if (error != nil) {
let message = "Failed to tap \(element) after \(timeout) seconds."
self.recordFailureWithDescription(message, inFile: file, atLine: line, expected: true)
} else {
element.tap()
}
}
}Since Fastlane uses xcodebuild we have the same issues on integration. Any help or suggestions on solving these inconsistencies with xcodebuild would be much appreciated!
Hi! I' am adonis a new user and a novice on programmation. I want you to mentor and help me to built my first app..Thanks to every one!!!!Nice community
Same issue here, UI tests fail with:
Assertion: UI Testing Failure - No matches found for TextField
Query input was {(
Application 0x7faa39605140: {{0.0, 0.0}, {375.0, 667.0}}, label: 'Baby Feed Timer'
)}
These tests pass when run locally via Xcode but now fail for my Xcode bots. These were working tests and are failing since updating Xcode.
Interestingly the screenshots show the button it's trying to tap. These tests have recently started passing for the iPad simulator but continue to fail for the iPhone simulator, with no changes made.
Also experienced the same problem after updating to 8.3
But my tests are failing on both: local Xcode and remote xcodebuild test. On previous version it worked fine.
I gave up on Xcode bots and moved to using Fastlane as part of a CI solution.
Did anybody found solution for this?