简体   繁体   English

使用calabash-android进行模式解锁

[英]Pattern unlock using calabash-android

Part of the Android app I am working on automated testing for has its own pattern unlock component, and I need a way to draw a 'Z' pattern in calabash-android. 我正在为其进行自动测试的Android应用程序的一部分具有其自己的模式解锁组件,我需要一种在calabash-android中绘制“ Z”模式的方法。 The pattern is made up of three drag/swipe actions, but they need to be a continuous touch. 模式由三个拖动/滑动动作组成,但它们需要保持连续的接触。 Currently I can do all three parts of the 'Z' as separate perform_action('drag') commands: 目前,我可以将“ Z”的所有三个部分作为单独的perform_action('drag')命令执行:

perform_action('drag', 17,83,26,26,50)
perform_action('drag', 83,17,26,66,50)
perform_action('drag', 17,83,66,66,50)

but I need to be able to do all of that in one go for the test to pass, and I don't know what to do for that. 但是我需要能够一次完成所有这些操作,才能使测试通过,而且我不知道该怎么做。 I imagine it has something to do with calabash-androids support for multi-touch gestures, but I am at a loss. 我想这与calabash-androids对多点触摸手势的支持有关,但是我很茫然。

It's not a pretty solution but you could use a recorded event with adb. 这不是一个很好的解决方案,但是您可以将记录的事件与adb一起使用。 Have a look at this post and see if it helps - Fire a pinch in/out command to Android phone using adb 看看这篇文章,看看是否有帮助- 使用adb向Android手机发射捏合输入/输出命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM