Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you run Xcuitests in parallel?

Wondering if anyone has found a way to run Xcuitests in parallel. Pretty sure this functionality isn't built in but it may be possible to write a script that can spread it over multiple machines if you can run a specific Xcuitest from the command line.

So sub question, how do you run a specific Xcuitest from the command line?

I'd appreciate it if anyone's played around with this and can share what they've learned or if they have any resources they could point me to. Thanks!

like image 897
Joe Susnick Avatar asked Sep 27 '15 16:09

Joe Susnick


2 Answers

Update- I was able to run a suite of tests across 4 simulators simultaneously using https://github.com/linkedin/bluepill

I have been able to run one test on a physical device and one on a simulator simultaneously. Additionally It might be possible to run more if you install additional versions of Xcode. Just be aware when using xcodebuild you need to use xcode --select to specify which xcode to run things on.

Finally with Xcode 8 we have the ability to run individual testcases with the -only-testing: flag. Run your xcodebuild command as you normally would and append -only-testing:YOURTESTBUNDLE/YOURTESTSUITE/YOURTESTCASE

Good luck!

like image 193
h.w.powers Avatar answered Nov 17 '22 11:11

h.w.powers


If you want to run the same XCUITests on multiple platforms (simulators and devices) in parallel then you can use following command with Xcode 9:

xcodebuild test -workspace YourApp.xcworkspace \
                -scheme "YourUITestsTarget" \
                -destination "platform=iOS Simulator,OS=11.4,name=iPad Pro (12.9-inch)" \
                -destination "platform=iOS,name=Visput iPad Pro"

You can define as many destinations as you need.

like image 2
Vlad Papko Avatar answered Nov 17 '22 13:11

Vlad Papko