3

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];
}
4

1 に答える 1

10

記録ボタンは、メイン テキスト エディタの左下隅にある赤いボタンです。記録できるメソッドにない場合、ボタンはグレー表示されます。

Xcode UI テスト記録ボタン

于 2015-08-27T18:59:37.153 に答える