UI Tests: Simulate a shake gesture with Swift

老子叫甜甜 提交于 2021-01-27 03:52:36

问题


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!


回答1:


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)



来源:https://stackoverflow.com/questions/31631560/ui-tests-simulate-a-shake-gesture-with-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!