1
votes

I created a ui test class:

import Foundation
import XCTest
@testable import TestProject

@available(iOS 9.0, *)
class ChangeWishListUITests: XCTestCase {

    func testExample() {
        // Use recording to get started writing UI tests.
        // Use XCTAssert and related functions to verify your tests produce the correct results.


    }

}

Run app on iphone 6 simulator with ios 9.3: enter image description here

But, record button, like in this tutorial: https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/RecordingUITests.html#//apple_ref/doc/uid/TP40010215-CH75-SW1

didn't appear.

enter image description here

3
sometimes you need to press cursor inside testExample() test case, also take a look at this stackoverflow.com/questions/31874855/…Eugene Gordin

3 Answers

1
votes
  1. your cursor has to be inside the method that you want to implement (because Xcode generates the code to the cursor position)

If this doesn't help:

  1. sometimes Xcode appears to be instable when you add a UI test to an existing project. The following sequence helped me in some cases:

    • clean the project
    • restart Xcode
    • rebuild the project
    • click inside the test method to set the cursor

Sometimes I had to do this two times.

  1. Your simulator has to run at least iOS 9.0
1
votes

In my case I had forgotten to add a UI Test target in the project and assign the test file to this target

0
votes

the debug area is hidden...

toggle debug editor on keyboard by pressing "shift + command + y" simultaneously