Closed
Description
I managed to run bluepill against one of my apps with a bunch of UI tests based on Xcode UI testing. However I'm getting the following error. A bit googling suggests that this might be due to UI testing having different test template/config than "regular" XCTests. Is Xcode UI testing supported by bluepill? :)
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'No target application path specified via test configuration: <XCTestConfiguration: 0x60800011a9d0>
Thanks!
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
oliverhu commentedon Jan 19, 2017
hey @dyang , we haven't actually tested this with Xcode UI testing. Our UI tests are all KIF tests.
We collect the test target by searching SampleApp.app/Plugin/*.xctest. You can test by adding a
additional-xctests
flag in the config file to the UI testing target and try from there.It would be great if you can tweak the code base a bit and let us know the result.
krze commentedon Jan 19, 2017
When you compile an XCUITest there are no
.xctest
files generated in the target app's plugin folder. Instead it's placed inside the runner, namedTEST_TARGET_NAME-runner.app/Plugin/TEST_TARGET_NAME.xctest
.I gave what you said a whirl and all 5 sims exited with the same error:
When checking valid runtimes:
I'll install a 10.1 sim and give it another shot
oliverhu commentedon Jan 19, 2017
@krze that's another issue mentioned in #8 , you need to download iOS 10.1 simulator Or alternatively, search for BP_DEFAULT_RUNTIME and change the value to 10.2
krze commentedon Jan 19, 2017
Looks like the target application isn't being pulled from the XCUITest
.xctest
file:oliverhu commentedon Jan 19, 2017
Hmm, this should be doable, we just need to fill some extra fields in the
XCTestConfiguration
file.Check
XCTestConfiguration.h
andSimulatorHelper.m
In
SimulatorHelper.m
:Add
[xctConfig setTargetApplicationPath:PATH_TO_APP];
to+ (NSString *)testEnvironmentWithConfiguration:(BPConfiguration *)config;
should do the trick.Let me know if you that works :D
casshill commentedon Jan 20, 2017
I tried the above solution and also added the target app bundle identifier like this
[xctConfig setTargetApplicationBundleID:BUNDLE_ID];
But I still can't get my tests to run. I don't think the test application is launching properly
<testcase classname="..." name="test..." time="61.096000"> <failure type="Failure" message="-[...Tests test...] : UI Testing Failure - Unable to update application state promptly.">
plu commentedon Jan 20, 2017
To make the UI Tests work, you need to set a few properties on
XCTestConfiguration
:testsMustRunOnMainThread
initializeForUITesting
targetApplicationPath
targetApplicationBundleID
You can peek a bit here how Facebook is doing it: https://github.com/facebook/FBSimulatorControl/blob/master/XCTestBootstrap/Bundles/FBTestConfiguration.m#L85-L95
oliverhu commentedon Jan 20, 2017
@plu love it, thanks!
oliverhu commentedon Jan 20, 2017
@plu it turns out to be more complicated than I thought. I managed to set the environment same as the one Xcode is using to run UI test (arguments, environment and XCTestConfiguration)
And get:
And it got stuck at the launching app statement. Searched some old threads from Xctool, there is extra
testmanagerdr
to deal with to run XCTUITest?Does FBSimualatorControl support running XCTUITest?
32 remaining items