问题
i am completely new to xcode ui application test. i have the source of the ios app. But i have to test the app using xcode ui test. currently i am adding new test classes to my ui test by creating new file and adding test cases by recording.
I can run my test class individually. But i want to execute all my test classes at a time. How i can do this.
I am completely new in this domain. Any kind of help will be appreciated.
U can also give me a ui test project link or any link which can help me. I have gone through the apple.developers website.
回答1:
To run all of your tests, you can use the following command in Terminal:
$ xcodebuild test
Alternatively, you can use Scan for a simpler interface.
To automate the running of your tests, you can create a shell script to run this command. If you want the shell script to run automatically, use Jenkins or similar continuous integration software to run the shell script at specified intervals.
You can set a job up to run your tests using xcodebuild
or scan
, and send an email when the job completes, or just when it fails. There's an excellent blog post on how to install Jenkins on OS X here: https://nickcharlton.net/posts/installing-jenkins-osx-yosemite.html and I've written a blog post with notes about some things that might catch you out with the configuration: http://qualitytesting.tumblr.com/post/142473883709/building-with-jenkins-and-xcode. The email feature is available by default so you just need to configure the email addresses you want to receive the notification when you configure your job.
To run all the tests inside Xcode, you can use cmd+U or go to the Test Navigator on the left-hand side and click the play button that appears when you hover over your test suite.
回答2:
Not sure that I understand, but what happens when you press cmd-U?
Make sure that the UI tests are enabled for the scheme.
来源:https://stackoverflow.com/questions/37676690/run-all-test-classes-in-xcode-ui-test