自定义量角器测试报告/输出 [英] Customize the protractor test report/output

查看:65
本文介绍了自定义量角器测试报告/输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试通过在命令提示符下提供以下命令来获取文件中的量角器测试结果.量角器 conf.js > location\result.txt在那里我可以看到量角器测试的完整输出.

Hi I'm trying to get the protractor test results in a file by giving the following command in command prompt. protractor conf.js > location\result.txt where I could see the complete output of the protractor test.

在以自定义方式运行量角器测试后,我能否在 txt 文件中只获取已执行的规范和失败的数量?

我需要这种自定义方式的报告,因为如果所有量角器测试都通过,我需要运行一个 shell 脚本.

I need my report in this customized way as I need to run a shell script if all the protractor tests are passed.

推荐答案

我们有两种方法可以满足您的要求.但它会以 .json 格式给出最终结果.如果你真的只需要 .txt 格式,你可以将 .json 转换为 .text

We have two ways to fulfill your requirement. but it will give final results in .json format. If you really needed only .txt format you convert .json to .text

方法:

  1. 在 conf.js 文件中声明参数 'resultJsonOutputFile:' 值如下-

  1. Declare parameter 'resultJsonOutputFile:' value in conf.js file as follows-

resultJsonOutputFile:'./testResults.json',//以.json格式存储最终结果的输出文件路径

resultJsonOutputFile:'./testResults.json', //output file path to store the final results in .json format

  1. 在运行量角器时从命令行传递输出文件路径:

  1. Pass the output file path from command line while running the protractor:

命令:

  protractor --resultJsonOutputFile='../outputFilePath.json' protractor.conf.js

如果您需要任何建议/帮助,请在这里ping,我很乐意为您提供帮助.

If you need any suggestions/help, please ping here, i'm happy to help you.

这篇关于自定义量角器测试报告/输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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