简体   繁体   English

如何在量角器茉莉花中报告每个测试的执行时间?

[英]How to report execution time of each test in protractor-jasmine?

Is there a ready-made way to display execution time of every 'it' block in protractor and jasmine?是否有现成的方法来显示 protractor 和 jasmine 中每个“it”块的执行时间? I want to display the execution time of each test wether it failed or succeeded.我想显示每个测试的执行时间,无论它失败还是成功。

Install jasmine-spec-reporter npm library and add the below code to your config file.安装jasmine-spec-reporter npm 库并将以下代码添加到您的config文件中。

/* Jasmin specReporter */
const { SpecReporter } = require('jasmine-spec-reporter');
 jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true, displayDuration: true } }));

Hope it helps you希望对你有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM