问题
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.
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];
}
回答1:
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.
来源:https://stackoverflow.com/questions/32232780/xcode-7-how-to-initiate-interface-recording-for-ui-testing