作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 UItests 中,屏幕截图附加到 XCTest 报告中,如下所示:
let screenshot = windows.firstMatch.screenshot()
let attachment = XCTAttachment(screenshot: screenshot)
attachment.lifetime = .keepAlways
attachment.name = named
sender.add(attachment)
他们在报告中是这样的:
我想做的是在 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/
在 UItests 中,屏幕截图附加到 XCTest 报告中,如下所示: let screenshot = windows.firstMatch.screenshot() let attachment
我是一名优秀的程序员,十分优秀!