I have some UI Tests for my Swift project (iOS application, Swift 5) that work when running them from Xcode; however when I run them using fastlane scan
, they always fail at the same point on each test that involves typing into text fields and I am not sure why.
The failure comes from filling out a UITextField, then attempting to tap the next one and fill that in.
Example:
app.textFields[“identifierOne”].tap()
app.textFields[“identifierOne”].typeText(“Text to Type”)
app.textFields[“identifierTwo”].tap()
app.textFields[“identifierTwo”].typeText(“Text to Type”)
This results in:
Failed to synthesize event: Neither element nor any descendant has keyboard focus. Event dispatch snapshot: TextField, label: ‘identifierTwo‘, placeholderValue: ‘Some ‘Value‘‘
As I mentioned earlier, this works when running the exact same tests from Xcode. I am at a loss with this one, any help is greatly appreciated.