我已经实现了黄瓜量角器的例子,它工作良好,当我添加
resultJsonOutputFile: 'report.json' 为了生成json报告,只有当所有步骤都成功时才会生成报告,但如果其中一个步骤失败,则不会生成报告,有人会有任何原因导致这种情况发生吗?
protractor.conf文件
exports.config = {
getPageTimeout: 600000,
allScriptsTimeout: 700000,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities: {
'browserName': 'chrome'
},
specs: [
'/home/git/adap_gateway/src/test/features/*.feature'
],
baseURL: 'http://localhost:8099/',
cucumberOpts: {
require: '/home/git/adap_gateway/src/test/javascript/stepDef/stepDefinitions.js',
},
resultJsonOutputFile: 'report.json'
}; 特征文件
Feature: Running Cucumber with Protractor
Scenario: Protractor and Cucumber Test
Given I go to "http://localhost:8099/#/"
When I add login credential
Then I go to scenario home page
Then I go to scenario details page
Then I go to edit attack tree page
Then build attack tree发布于 2018-04-30 17:50:14
将json输出结果放入cucumberOpts。
尝试如下所示:
cucumberOpts: {
strict: true,
format: 'json:reports/current/cucumber_report.json',
'format-options': '{"colorsEnabled": true }',
require: [
'features/step_definitions/*.js',
'features/step_definitions/shared/*.js',
'support/*.js'
],
},https://stackoverflow.com/questions/43710646
复制相似问题