Xcode 7-如何为UI测试启动界面记录? [英] Xcode 7 - How to initiate interface recording for UI Testing?

查看:55
本文介绍了Xcode 7-如何为UI测试启动界面记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在看WWDC 2015会议104"Xcode的新功能",并发现在Xcode 7中,我可以记录接口单元测试以自动单击按钮,输入文本等.

I'm looking at the WWDC 2015 session 104 "What's new in Xcode" and see that in Xcode 7 I can record interface unit tests to automate clicking on buttons, enter text, etc.

我创建了一个包含UITests的新项目,但是我实际上如何开始记录UITests的界面交互?

I have a new project created with UITests included, but how do I actually start recording interface interactions for UITests?

以下是测试中包含的代码段:

Here's the snippet included in the test:

- (void)setUp {
    [super setUp];

    // Put setup code here. This method is called before the invocation of each test method in the class.

    // In UI tests it is usually best to stop immediately when a failure occurs.
    self.continueAfterFailure = NO;
    // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
    [[[XCUIApplication alloc] init] launch];
}

推荐答案

记录"按钮是主文本编辑器左下角的红色按钮. 当您不在可记录的方法中时,该按钮将显示为灰色.

The record button is the red button in the bottom left corner of your main text editor. The button will be greyed out when you are not in a method that you can record into.

这篇关于Xcode 7-如何为UI测试启动界面记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆