5

I can execute my project using XCUItest with following command:

xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 
8,OS=11.4'

This command works fine, and all my test cases run.

I want to execute a single .swift file. so I used the following command:

xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.4' -only-testing:/Users/amit.jathar/Maple/MapleUITests/DashboardTests.swift

The above command throws following error:

User defaults from command line: IDETestRunOnlyIdentifiers = ( "Maple/MapleUITests/DashboardTests" )

--- xcodebuild: WARNING: Unable to open project file '/Users/amit.jathar/sdm-maple-ios/MaplePlayground.playground' in workspace 'Maple.xcworkspace'.

2018-07-12 17:44:55.000 xcodebuild[13879:5394085] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-14161/IDEFoundation/Execution/Schemes/IDETestSchemeAction.m:272

Details: (anyTestRunSpecification) should not be nil. Object: Method: -testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters:schemeCommand:actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock: Thread: {number = 1, name = main} Hints:

Backtrace: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation) 1 _DVTAssertionHandler (in DVTFoundation) 2 _DVTAssertionFailureHandler (in DVTFoundation) 3 -[IDETestSchemeAction testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters:schemeCommand:actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock:] (in IDEFoundation) 4 -[IDEScheme _executionOperationForSchemeOperationParameters:build:onlyBuild:buildParameters:title:buildLog:dontActuallyRunCommands:restorePersistedBuildResults:deviceAvailableChecker:error:actionCallbackBlock:] (in IDEFoundation) 5 -[IDEScheme schemeOperationForSchemeOperationParameters:buildLog:overridingProperties:overridingBuildConfiguration:dontActuallyRunCommands:restorePersistedBuildResults:deviceAvailableChecker:error:completionBlock:] (in IDEFoundation) 6 -[IDEScheme schemeOperationForSchemeOperationParameters:buildLog:overridingProperties:overridingBuildConfiguration:dontActuallyRunCommands:restorePersistedBuildResults:error:completionBlock:] (in IDEFoundation) 7 -[Xcode3CommandLineBuildTool _buildWithTimingSection:] (in Xcode3Core) 8 -[Xcode3CommandLineBuildTool run] (in Xcode3Core) 9 main (in xcodebuild) 10 start (in libdyld.dylib) Abort trap: 6

Amit Jathar
  • 319
  • 3
  • 14
  • 1
    I've have figured it out! The parameter : -only-testing:/Users/amit.jathar/Maple/MapleUITests/DashboardTests.swift should not be used with absolute path of the test suite file, instead it should be the relative path inside the scheme, like: -only-testing:MapleUITests/DashboardTests – Amit Jathar Jul 13 '18 at 04:30

0 Answers0