-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Does bluepill support running Xcode UI testing? #16
Comments
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 It would be great if you can tweak the code base a bit and let us know the result. |
When you compile an XCUITest there are no 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 |
Looks like the target application isn't being pulled from the XCUITest
|
Hmm, this should be doable, we just need to fill some extra fields in the Check In Let me know if you that works :D |
I tried the above solution and also added the target app bundle identifier like this But I still can't get my tests to run. I don't think the test application is launching properly |
To make the UI Tests work, you need to set a few properties on
You can peek a bit here how Facebook is doing it: https://github.com/facebook/FBSimulatorControl/blob/master/XCTestBootstrap/Bundles/FBTestConfiguration.m#L85-L95 |
@plu love it, thanks! |
@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 Does FBSimualatorControl support running XCTUITest? |
Yes, it's working there. |
Some good news here. Finally got this working with the help in FBSimulatorControl. Will submit a PR for this. |
@oliverhu when will this pr merged into the latest code to support xcode ui testing? |
it is contingent on #55 , hopefully sometime next week :D |
Update: the support is available in #68, please check it out. The branch works locally but can't pass CircleCI, still trying to figure out why 😕 |
@oliverhu I ran your branch locally and ran into two issues running UI tests. In BPPacker.packTests(), I was getting a exception any on xctFile any time it tried to access part of it. While debugging, looks like the file type for some reason is an Array so I fixed it locally by changing the data type from BPXCTestFile to NSArray and and used xctFile.firstObject. Not sure if there is something different that should be done. The other issue is a race condition when trying to run more than 1 UI test in parallel. The same test runs across all the simulators. If I put a debug point in BPRunner.run() after a simulator is started, specifically
and wait a few seconds to continue the program, then it will run different tests on the different simulators, without the breakpoint it runs the same test. Let me know if you need more specifics. |
@djrenfro it would be great if you could get a PR based on that branch to fix the first issue (and a test case to reproduce the second issue) |
@oliverhu PR to fix the first issue in #82 |
@djrenfro found the problem - NSTemporaryDirectory() returns the same temporary path under different Bluepill-ci processes :( And in my branch, I added a constant session identifier for all blupill-cli. Pushed a fix, should work now. |
@oliverhu That fixed the issue I was having, working well now |
Cool. Also for the CI issue, it is only reproducible with CircleCI but not with Travis, we are considering moving back to Travis and merge this branch in. |
The PR is merged, please try it out and report issues :) |
i tried running latest master with ui test bundle and just got |
@jimmyeisenhauer Try looking at #93 |
making the change in #93 got it working thanks! Has anyone else tried the -i option with UI tests? I just get the error |
it also looks like it will not run with ONLY a UI test bundle - |
@jimmyeisenhauer could you open an issue for that? |
I'm using the latest and greatest from Is it a well known issue or this should have been fixed on |
@fabiomassimo is the number of UI tests >> the number of unit tests? In current setup, if say you have 100 unit tests and 25 UI tests, and you have 5 simulators to run all of them - we will do the math as (100 + 25) / 5 = 25, so each simulator will take 25 tests. As a result, all UI tests will run in the simulator. |
Thank you for explaining me that! It makes sense now. What if I want to run only UI Tests then? In that case the algorithm should parallelise the UI test cases. I started to look into this too but I wonder if the |
@fabiomassimo I think you want the |
I can see why you've split the tests that way... but in a project where unit tests outweigh UI tests (trending towards optimal testing pyramid https://martinfowler.com/bliki/TestPyramid.html), little time-saving gains will be achieved. It's more or less guaranteed that the length of any given UI test will exceed that of a given unit test, likely by order(s) of magnitude. Would it be possible to treat the unit and UI test suites as separate entities? For example, If I have 100 unit tests and 20 UI tests |
@DNCGraef ;-) Read the read.me carefully, you'll find a flag called no-split, simply put your unit test target there. |
Nice tip - I'll try that :D |
Update Checkstyle regex to correctly parse line & char values from output
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!
The text was updated successfully, but these errors were encountered: