Andrey M.
Andrey M.

Reputation: 3079

How to import XCTest suite

I've created my project without XCTest support. But now after long time development i want to cover my project with unit tests. And i want do it with XCTest.

How to import XCTest suite into existing project previously created without XCTest support ?

Upvotes: 0

Views: 1442

Answers (2)

Aditya Malviya
Aditya Malviya

Reputation: 2149

Adding XCTest target to an existing project is simple you can refer

https://automationwithaditya.wordpress.com/2017/08/21/getting-started-to-xctest-automation-framework/

or follow the steps 1. Click on project 2. Add the target choose the one which you want. Follow this image

Upvotes: 0

Nelly v
Nelly v

Reputation: 239

You can add new Unit/UI test case classes through "file-> new-> file -> UI test case class or Unit test class". Make sure that the target membership is set for only the test target and not the regular targets (you can see that in the file inspector). If you currently have no test target, you can add that through "file -> new -> target -> iOS UI testing bundle or iOS Unit Testing Bundle" and add relevant files to the this target.

Upvotes: 3

Related Questions