代码之家  ›  专栏  ›  技术社区  ›  Daniel Murali

如何在詹金斯获得兴奋感

  •  0
  • Daniel Murali  · 技术社区  · 6 年前

    在UItests中,测试报告的屏幕截图如下所示:

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

    report

    我想做的是,在jenkins的工作中将截图显示为工件。我怎样才能在詹金斯中找到那些截图?

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

    1 回复  |  直到 6 年前
        1
  •  1
  •   Mark Thormann    6 年前

    你可能会想运行 archiveArtifacts 进入你的管道,把附件拉进去。一旦你这样做了,他们会在Jenkins的job build视图中显示。我有类似于下面的管道代码。

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