Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI Tests: Simulate a shake gesture with Swift

Using UI tests, I'd like the app to respond to shake gestures, and I would like to programmatically trigger a shake gesture in my swift UI tests.

Triggering the shake gesture while recording during a UI test session yields no added code.

Is there a way to do this? Thanks in advance!

like image 938
Noah Avatar asked Jul 25 '15 22:07

Noah


1 Answers

As far as I know, currently you cannot do it directly from XCUITest. So instead, maybe programmatically call it using launch arguments that then call the relevant section of the code to simulate the gesture. Not perfect, but the best way I know of currently (Apr 2019)

like image 57
Charlie Seligman Avatar answered Oct 22 '22 11:10

Charlie Seligman