Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you run a specific Xcuitest from the command line?

Playing with iOS 9.0, Xcode GM and the new Xcuitesting framework. How can I run a specific test from the command line instead of having to click play in the ide? I know there's a shortcut to run all the tests but I want to run a single test.

Thanks!

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

Joe Susnick


People also ask

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.

What is the difference between XCTest and XCUITest?

XCTest / XCUITest is pure iOS and cannot help the team that needs to test both iOS and Android devices. XCUITest was built for the iOS and Xcode Developer in mind and focuses less on the QA Automation Engineer.

Which test framework does XCUITest use?

What is XCUITest framework? Developed by Apple in 2015, XCUITest is an automated UI test framework for performing iOS automation testing. It utilizes XCTest - an integrated test framework for Xcode by Apple.


1 Answers

You should be able to do that with xctool command line tool for running specific test class,

xctool -workspace YourWorkspace.xcworkspace -scheme YourScheme test -only myUITestTarget:UITestClass

You can also use xcodebuild to run the entire test suite as explained here, https://krausefx.com/blog/run-xcode-7-ui-tests-from-the-command-line

like image 139
Sushant Avatar answered Nov 10 '22 16:11

Sushant