我有一个运行 Protractor/Jasmine 的 Gulp 配置文件,如下所示:
.pipe($.protractor.protractor({ configFile: 'protractor.conf.js', args: args || ['--baseUrl', 'http://localhost:' + basePort] }))
但控制台中显示的报告只是点,而不是实际的规范测试。如何让 Jasmine 变得冗长?
这可以通过 Jasmine 1 中的 isVerbose
选项实现,但我找不到 Jasmine 2 的等效选项。
最佳答案
我们正在做的是设置这些 Jasmine 设置:
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
includeStackTrace: true,
defaultTimeoutInterval: 100000,
print: function() {}
}
并使用 jasmine-spec-reporter
package它提供了一个很好且详细的测试输出:
onPrepare: function () {
var SpecReporter = require('jasmine-spec-reporter');
// jasmine spec reporter
jasmine.getEnv().addReporter(new SpecReporter({
displayStacktrace: 'all',
displayPendingSpec: true,
displaySpecDuration: true
}));
}
关于jasmine - 使用 Jasmine 2、Protractor 和 Gulp 显示规范文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36066035/