Xcode 7 - 如何为UI测试启动界面录制?

Ale*_*one 3 xctest ios9 xcode7 xcode-ui-testing

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

我有一个包含UITests的新项目,但我如何开始记录UITests的界面交互?

以下是测试中包含的片段:

- (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];
}
Run Code Online (Sandbox Code Playgroud)

Kev*_*vin 10

记录按钮是主文本编辑器左下角的红色按钮.如果您没有可以录制的方法,该按钮将显示为灰色.

Xcode UI测试记录按钮