gpt4 book ai didi

ios - 如何在 jenkins 中获取 XCTAttachments

转载 作者:行者123 更新时间:2023-11-28 14:11:10 25 4
gpt4 key购买 nike

在 UItests 中,屏幕截图附加到 XCTest 报告中,如下所示:

let screenshot = windows.firstMatch.screenshot()
let attachment = XCTAttachment(screenshot: screenshot)
attachment.lifetime = .keepAlways
attachment.name = named
sender.add(attachment)

他们在报告中是这样的:

report

我想做的是在 jenkins 工作中将屏幕截图显示为工件。我如何在 jenkins 中检索这些屏幕截图?

或者换句话说,这些附件是位于光盘上的某个位置,还是我可以自动将它们保存在某个位置?

最佳答案

您可能想要运行 archiveArtifacts进入您的管道并拉入附件。完成后,它们将显示在 Jenkins 的作业构建 View 中。为此,我有类似于以下的管道代码。

dir('./build/DerivedData/Logs/Test/Attachments') {
//Archive the screenshots
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*.png'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*.jpg'
}

关于ios - 如何在 jenkins 中获取 XCTAttachments,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52518238/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com