有什么方法可以在Azure DevOps测试结果选项卡中显示赛普拉斯测试结果吗? [英] Is there any way to show Cypress Test Results in Azure DevOps Test Results Tab?

查看:57
本文介绍了有什么方法可以在Azure DevOps测试结果选项卡中显示赛普拉斯测试结果吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种解决方案,以在发布管道的Azure DevOps结果选项卡中显示赛普拉斯的测试结果.现在,Mocha Awesome测试结果HTML报告已创建.但是需要一种解决方案来在Azure中集成并显示结果.有人可以建议我们如何解决类似的问题吗?

解决方案

当前天蓝色的devops结果"选项卡不支持html测试结果.您需要使用junit report生成xml测试结果.然后使用任务 在上面的示例中显示了屏幕截图.我有 npm install 任务来安装cypress和其他依赖项.命令行任务运行 npx cypress run .最后发布测试结果任务,将测试结果发布给天蓝色的开发人员.

如果要在发布管道中显示测试结果.您需要将测试结果文件包含在工件中,然后将包含测试结果的工件发布给天蓝色的开发人员.并在您的发布管道中添加一个发布测试结果任务以发布那些测试结果.

还有另一种在发布管道中显示测试结果的方法是在发布管道中运行cypress测试.您需要将cypress测试文件包含在工件中,然后发布到azure devop,并在press管道中运行cypress run命令,然后使用发布测试结果任务来发布测试结果.您可以在更多信息

如果您要使devops支持html格式测试结果,则已经有用户提出意见要提交给Microsoft.您可以此处并为该声音投票或提交新功能请求.

I'm seeking a solution to display Cypress test results, in Azure DevOps results tab in the release pipeline. Right now, Mocha Awesome test results HTML report is created. But need a solution to integrate and show results in the Azure. Could someone please advise on how can we resolve a similar problem?

解决方案

Currently azure devops results tab donot support html test results. You need to generate xml test result with junit reporter. And then to publish the test results with task Publish Test Results.

So you may need to configure your cypress.json file to specifically set junit as the reporter. For below simple example:

{
  "integrationFolder": "cypress/integration/examples",
  "reporter": "junit",
  "reporterOptions": {
    "mochaFile": "tests/test-output-[hash].xml",
    "toConsole": true,
    "attachments": true
  },
  "video": false,
  "pluginsFile": "cypress/plugins/index.js",
  "supportFile": "cypress/support/index.js"
 }

And also you need to add task Publish Test Results in your pipeline to publish the test result to azure devops.

In above example shown in the screenshot. I have npm install task to install cypress and other dependencies. The command line task run npx cypress run. and at last publish test results task publish the test results to azure devops.

If you want to show the test results in release pipeline. You need to include the test result files in the artifacts and publish the artifacts which has the test results to azure devops. And in your release pipeline add a publish test results task to publish those test results.

There is another way to show test result in release pipeline is to run your cypress test in release pipeline. You need to include you cypress test files in the artifacts and publish to azure devops and run cypress run command in the press pipeline and then publish the test results with publish test results task. You can refer this blog for more information

If you want to azure devops to support html format test results, there are user voices already submit to microsoft. you can go here and vote for this voice or submit a new feature request.

这篇关于有什么方法可以在Azure DevOps测试结果选项卡中显示赛普拉斯测试结果吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆