简体   繁体   English

iOS测试:如何模拟用户操作

[英]iOS Testing: How to simulate user actions

I want to test a scenario in iOS and XCode 5. Here's the scenario 我想在iOS和XCode 5中测试一个方案。
1. Run the app 1.运行应用
2. Press home button to send app to background 2.按主页按钮将应用发送到后台
3. Press Phone app, then edit the Contacts 3.按电话应用程序,然后编辑联系人
4. Get the app into foreground 4.将应用程序置于前台

Is there a way to automatically/programmatically simulate such user actions? 有没有一种方法可以自动/以编程方式模拟此类用户操作? Any help would be much appreciated. 任何帮助将非常感激。 Thank you. 谢谢。

要将应用程序发送到后台,可以使用target.deactivateAppForDuration()但我认为没有一种方法可以使用UI工具访问内置于iOS的应用程序。

Have a look at Calabash for iOS. 看看适用于iOS的Calabash。 I have tried this with Android and it works great. 我已经在Android上尝试过了,效果很好。 Basically what you do is to write a Ruby script where you specify the sequence of actions, which are then translated and applied on the app. 基本上,您要做的是编写一个Ruby脚本,在其中指定操作顺序,然后将其翻译并应用于应用程序。

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

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