I have written UI Tests in XCode 7.3.1 on a dedicated target. I can record a UI test but if I try to launch it (all tests or a single one), I got the following error :
Unable to find test runner app containing test bundle path /Users/dle/Library/Developer/Xcode/DerivedData/Keecoach-exynmciqyehgmxcfxhkpksrqifsb/Build/Products/Debug-iphonesimulator/DemoKeecoachUITests-Runner.app/PlugIns/DemoKeecoachUITests.app
I do not really understand the message except that it appears a runner app has to launch the tests and that runner app is not existing. This DemoKeecoachUITests-Runner.app
does not actually exist on my disk.
I cannot find anybody else mentionning the problem anywhere... I get the same error if I launch the tests in command line with xctool
. I have the same problem on other computers, but I do not have the problem on other project, so it is related to the project. Any clue ?
The easiest way to add a unit test target to your project is to select the Include Tests checkbox when you create the project. Selecting the checkbox creates targets for unit tests and UI tests. To add a unit test target to an existing Xcode project, choose File > New > Target.
To run the XCUITests on XCode, you can click the highlighted icon below to see your newly created UI Test targets. You can hover on the “testExample()” test case and click the “Play” icon to run that specific test to see if everything was set up properly.
⌘U will build and run all your test cases. It is the most commonly used shortcut when creating unit test cases. It is equivalent to ⌘R (build & run) while doing app development. You can use this shortcut to build your test target and run all the test cases in your test target.
XCUITest is a UI testing framework launched by Apple in 2015. With XCUITest, we can test user interface or Apple platform apps using Swift or Objective-C programming language.
Found it!
Was due to the Wrapper Extension
build setting. It was set to app
for the project and so inherited for each target. I switched it to nothing for the projet, app
for the application target and xctest
for the test targets.
Now the generated binaries for tests are ABCTests.xctest
and not ABCTests.app
anymore. It was probably like this from a long time, but I don't know for what reason...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With