Testing XCTest and UI in iOS

I am new to unit testing in iOS and I need to write unit test for the iOS 7 application. I see that XCTest writes unit test using the test navigator and editor assistant. Because “unit testing” means we are testing a piece of code [which may be the only method or group of related methods]. How to write unit test for user interface? Let's say we have a settings screen at the beginning of the application that has some set of parameters that the user must select, and then it will be saved in NSUserDefaults for later use. My question is: how do we use XCTest to: 1. Show the UI [the user interface is in the storyboard] to be able to check various user interface elements on it,including user interface user interface.

Maybe I'm a little confused about using XCTest testing for UI, so it would be great if anyone could clarify above.

I also saw apple UIAutomation, but how can we integrate it into our test target?

+3
source share
2 answers

If you want to test the user interface of your application (as you specify), you need to perform "system tests" or "integration tests", not unit tests. So you need to research UIAutomation instead of XCTests.

. Xcode , . web, .

+4

All Articles