Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode UI Testing: Unable to find test runner app containing test bundle path

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

The error in XCode

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 ?

like image 894
smad Avatar asked Jun 14 '16 11:06

smad


People also ask

How do I add a UI test to Xcode project?

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.

How do I run XCUITest?

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.

How do I run all test cases in Xcode?

⌘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.

What is XCUI test?

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.


1 Answers

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...

like image 82
smad Avatar answered Oct 09 '22 17:10

smad