xctest - xcodebuild error DVTAssertions: ASSERTION FAILURE while execution single command line test,但所有测试用例命令工作正常
问题描述
我可以通过以下命令使用 XCUItest 执行我的项目:
xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone
8,OS=11.4'
该命令运行良好,并且我的所有测试用例都运行。
我想执行一个 .swift 文件。所以我使用了以下命令:
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
上面的命令抛出以下错误:
命令行中的用户默认值:IDETestRunOnlyIdentifiers = ("Maple/MapleUITests/DashboardTests")
--- xcodebuild:警告:无法在工作区“Maple.xcworkspace”中打开项目文件“/Users/amit.jathar/sdm-maple-ios/MaplePlayground.playground”。
2018-07-12 17:44:55.000 xcodebuild[13879:5394085] [MT] DVTAssertions:/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-14161/IDEFoundation/Execution/Schemes/IDETestSchemeAction 中的断言失败.m:272
详细信息:(anyTestRunSpecification) 不应为零。对象: 方法:-testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters:schemeCommand:actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock: 线程: {number = 1, name = main} 提示:
回溯: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:](在 DVTFoundation 中)1 _DVTAssertionHandler(在 DVTFoundation 中)2 _DVTAssertionFailureHandler(在 DVTFoundation 中)3 -[IDETestSchemeAction testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters:schemeCommand :actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock:] (在 IDEFoundation 中)4 -[IDEScheme _executionOperationForSchemeOperationParameters:build:onlyBuild:buildParameters:title:buildLog:dontActuallyRunCommands:restorePersistedBuildResults:deviceAvailableChecker:error:actionCallbackBlock:] (在 IDEFoundation 中)5 -[ IDEScheme schemeOperationForSchemeOperationParameters:buildLog:overridingProperties:overridingBuildConfiguration:dontActuallyRunCommands:restorePersistedBuildResults:deviceAvailableChecker:error:completionBlock:](在 IDEFoundation 中)6 -[IDEScheme schemeOperationForSchemeOperationParameters:buildLog:overridingProperties:overridingBuildConfiguration:dontActuallyRunCommands:restorePersistedBuildResults:error:completionBlock:](在 IDEFoundation 中)7-[Xcode3CommandLine:(在 XcodeSection3_build]WithTimingSection ) 8 -[Xcode3CommandLineBuildTool run] (在 Xcode3Core 中) 9 main (在 xcodebuild 中) 10 start (在 libdyld.dylib 中) 中止陷阱:6](在 IDEFoundation 中)7 -[Xcode3CommandLineBuildTool _buildWithTimingSection:](在 Xcode3Core 中)8 -[Xcode3CommandLineBuildTool 运行](在 Xcode3Core 中)9 main(在 xcodebuild 中)10 start(在 libdyld.dylib 中)中止陷阱:6](在 IDEFoundation 中)7 -[Xcode3CommandLineBuildTool _buildWithTimingSection:](在 Xcode3Core 中)8 -[Xcode3CommandLineBuildTool 运行](在 Xcode3Core 中)9 main(在 xcodebuild 中)10 start(在 libdyld.dylib 中)中止陷阱:6
解决方案
推荐阅读
- javascript - 如何访问护照中的整个用户对象
- javascript - 如何将 JSON 文件转换为 JS 数组
- google-cloud-firestore - SwiftUI 和 Picker 和 FireStore 返回文档 ID 不落
- flask - url_for 的烧瓶蓝图问题
- wordpress - 触发高级自定义字段 (ACF) 'acf/save_post' 操作
- python - PayPal 是否仍支持通过 HTTP REST API 的活动报告和余额?
- flutter - 项目目录中没有 Podfile | 颤振 - firebase 身份验证
- minecraft - WorldEdit 如何处理画笔?
- python - 以 JSON 格式获取存储过程结果
- java - 我需要重命名我在java中生成的json对象的键