Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Unit and UI tests to an existing project in Xcode

Tags:

xcode

Lets say I have an existing project in Xcode, and for whatever reason, did not add Unit Tests or UI Tests. Can I add the test projects to the project later in Xcode 7?

like image 954
James Parsons Avatar asked Jan 12 '16 13:01

James Parsons


2 Answers

Yes!

You can add new test targets for UI and unit tests by navigating File > New > Target > Test. When that's done, add new test cases by navigating File > New > File > Source.

Test Target

like image 114
Chris Droukas Avatar answered Oct 13 '22 06:10

Chris Droukas


Tests are targets.

Select the project in the navigation view then Menu File > New > Target… and Test of the proper SDK.

Choose UI Testing Bundle or Unit Test Bundle.

Repeat the procedure to add the other test bundle.

like image 28
vadian Avatar answered Oct 13 '22 05:10

vadian