CF256
CF256

Reputation: 187

Output of UI tests when running tests in parallell

I am trying to run UI tests in parallell from the command line using xcodebuild.

The command I'm using is:

xcodebuild 
     -verbose 
     -workspace "MyWorkspace.xcworkspace" 
     -scheme "User Interface Tests" 
     -sdk iphonesimulator 
     -destination 'platform=iOS Simulator,id=5193368C-B000-4ED1-99F6-E23F7BAB9F69' 
     -destination 'platform=iOS Simulator,id=9B751E0D-8268-4DDF-ADAC-CBF2508F4CCC'
     test

The test execution works fine on both devices, but I can't see any log messages anywhere. I.e.

t = 25.90s Tap "MenuButton" Button
t = 25.90s Wait for no.test.myapp to idle
t = 26.14s Find the "MenuButton" Button
t = 26.35s Wait for no.test.myapp to idle
t = 26.39s Synthesize event
t = 26.46s Wait for no.test.myapp to idle
t = 27.09s Tap "FooBar" StaticText

When I only have one destination I can see the log/output of the test (the same output you can see when running tests from Xcode). However, when I add a second destination, the only information that's shown is:

Test case 'Foo.testBar() passed on iPhone 8'

or

Test case 'Foo.testBar() failed on iPhone 6s'.

This is not very helpful as I would like to know where in the test it failed.

Is this output being logged anywhere? Ideally I would like to see the step-by-step log for each device I run the test on.

Upvotes: 2

Views: 1364

Answers (2)

ablarg
ablarg

Reputation: 2490

You can control the location of your TestSummaries.plist (which you can feed to xchtmlreport) by adding this flag to your xcodebuild command:

-resultBundlePath resultsDir

You should remove the folder between each test run. If you are going to run in parallel, you will probably want a separate results path for each xcodebuild invocation.

Upvotes: 0

Oletha
Oletha

Reputation: 7639

There will be an .xcactivitylog in your derived data folder, which is usually at the following path:

~/Library/Developer/Xcode/DerivedData/<your-app-name>/Logs/Test/

If you've done lots of test runs recently, you'll see a few different logs; feel free to remove these before each test run to keep the directory clean and easy to navigate.

Upvotes: 2

Related Questions