从命令行开始查找XCode UITests的报告(Where to find report for XCode UITests started from commandline)

编程入门 行业动态 更新时间:2024-10-28 13:19:07
命令行开始查找XCode UITests的报告(Where to find report for XCode UITests started from commandline)

我正在寻找一种方法来打开从命令行开始测试后的报告。

使用命令行开始测试:

xcodebuild -scheme "Application Test Schema" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s Plus,OS=9.3' test

在测试结束时,我列出了失败的测试用例:

Test Suite 'AppUITests.xctest' failed at 2016-07-11 12:00:10.376. Executed 17 tests, with 1 failure (0 unexpected) in 389.167 (389.217) seconds Test Suite 'Selected tests' failed at 2016-07-11 12:00:10.377. Executed 17 tests, with 1 failure (0 unexpected) in 389.167 (389.219) seconds Failing tests: -[MainScreenTests test14_ClickOnButtonOpensKeyboard()]

我想弄清楚发生了什么,测试“test14_ClickOnButtonOpensKeyboard”,读取堆栈跟踪等...我可以在哪里找到此运行的报告?

我检查了XCode报告导航器历史记录,它不包含从命令行启动的上次运行。

XCode版本7.3.1

I am looking for a way to open report after tests started from commandline has been finished.

Tests were started using commandline:

xcodebuild -scheme "Application Test Schema" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6s Plus,OS=9.3' test

In the end of testing I have listed test cases that are failed:

Test Suite 'AppUITests.xctest' failed at 2016-07-11 12:00:10.376. Executed 17 tests, with 1 failure (0 unexpected) in 389.167 (389.217) seconds Test Suite 'Selected tests' failed at 2016-07-11 12:00:10.377. Executed 17 tests, with 1 failure (0 unexpected) in 389.167 (389.219) seconds Failing tests: -[MainScreenTests test14_ClickOnButtonOpensKeyboard()]

I want to figure out whats happened to test "test14_ClickOnButtonOpensKeyboard", read stacktrace, etc... Where I can find report for this run?

I checked XCode Report Navigator history and it does not contain last run started from command line.

XCode version 7.3.1

最满意答案

日志保存在派生数据文件夹下

通常~/Library/Developer/Xcode/DerivedData/<mangled app folder>/Logs/Test/ 。 看看xcodebuild的日志,找出确切的位置。

在Test文件夹下,您将找到包含整个测试序列的plist。 您应该将按键Root> TestableSummaries> Tests> Item n> Subtests all向下导航到ActivitySummaries键,该键包含单个步骤,包括对Attachments文件夹中包含的屏幕截图的引用。

如果您不关心存储在plist中的结构化信息并且只需要原始文本日志,您还可以检查具有相同名称的plist的文件夹,该文件夹包含每个测试会话的日志文件。

PS如果您想知道为什么每次测试后派生数据文件夹增长如此之多,请查看Attachment文件夹大小...

Logs are save under your derived data folder

Typically ~/Library/Developer/Xcode/DerivedData/<mangled app folder>/Logs/Test/. Take a look at xcodebuild's logs to find out the exact location.

Under the Test folder you'll find a plist with the entire test sequence. You should navigate the keys Root > TestableSummaries > Tests > Item n > Subtests all down to the ActivitySummaries key which will contain the single steps including a reference to screenshots that are contained in the Attachments folder.

If you don't care about the structured information stored in the plist and just need a raw text log you can also check the folder with the same name of the plist which contains a log file per test session.

P.S. If you're wondering why the derive data folder grows so much after each test, take a look at the Attachment folder size...

更多推荐

本文发布于:2023-04-29 09:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335999.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令行   报告   UITests   XCode   commandline

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!