My team and I have been setting up a Jenkins server to automate running unit and ui tests on a Mac Mini that we use as a build server. This Mac Mini has no peripherals attached to it, and the only way we can access it is by logging in remotely.
When I am logged into the machine remotely, using my Mac's built in Screen Sharing App, the tests run just fine using the iOS simulator. However, if I close out of the remote connection while the tests are running, ui tests that involve typing text will fail with the following error when attempting to type (all other tests / ui tests pass with flying colours):
Assertion Failure: Timed out waiting for key event to complete
This obviously causes some problems when Jenkins is automatically running the tests for us, since we don't always want to be remotely logged into the machine.
I feel like this has something to do with the software keyboard of the simulator but am failing to see why it would be an issue. Does the mac need to have some sort of display output connected in order for the software keyboard to exist or some such thing? Would connecting a monitor to the machine (even if it's not really being used) cause the tests to pass? Why would this be the case?
Xcode 10 still has the same issue after you presented a CNContactViewController
instance.
Avoid write those cases which need call CNContactViewController` instance.
Or there is a workaround:
app.keys["1"].tap()
app.keys["2"].tap()
app.keys["3"].tap()
This problem could be sorted out by turning off the connected hardware keyboard in the simulator settings for few.
You may also want to try that UI Testing Failure - Neither element nor any descendant has keyboard focus on TextView
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With