windows 命令提示符中未显示审计报告
Audit reports not appearing on windows command prompt
这听起来可能是新手,但有点卡壳所以敢问。
我正在尝试使用 Protractor 辅助功能插件获取辅助功能审计报告。
我正在使用演示脚本:
describe("TC_001",function(){
it("using demo site", function(){
browser.get("http://juliemr.github.io/protractor-demo");
expect(browser.getTitle()).toEqual('Super Calculator');
});
});
这是conf.js
exports.config = {
framework : 'jasmine2',
seleniumServerJar : './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
seleniumPort : '4444',
/*capabilities : {
browserName : 'firefox'
},*/
specs :['./TC_001.js'],
jasmineNodeopts:{
defaultTimeoutInterval:500000
},
plugins:[{
chromeA11DevTools:{
treatWarningsAsFailures:true
},
package:'protractor-accessibility-plugin'
//path:'node_modules/protractor/plugins/accessibility'
}],
onPrepare: function(){
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './testresults',
filePrefix: 'xmloutput'
}));
}
};
我可以 运行 脚本正常,使用 'protractor conf.js' 但是没有审计报告出现在命令提示符中。
如有任何帮助,我们将不胜感激。谢谢!
编辑
根据建议,我更新了配置文件以 JSON 格式报告结果。
var JSONReporter = require('jasmine-json-test-reporter');
exports.config = {
seleniumServerJar : './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
seleniumPort : '4444',
/*capabilities : {
browserName : 'firefox'
},*/
specs :['./TC_001.js'],
jasmineNodeopts:{
defaultTimeoutInterval:500000
},
plugins:[{
chromeA11DevTools:{
treatWarningsAsFailures:true
},
//package:'protractor-accessibility-plugin'
path:'node_modules/protractor/plugins/accessibility'
}],
framework : 'jasmine2',
onPrepare: function(){
/*var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './testresults',
filePrefix: 'xmloutput'
}));*/
var JSONReporter = require('jasmine-json-test-reporter');
jasmine.getEnv().addReporter(new JSONReporter({
file:'jamine-test-results.json',
beautify: true,
indentationLevel:4
}));
}
};
这确实会生成 JSON 文件,但结果没有可访问性审核的痕迹。
{
"suite1": {
"id": "suite1",
"description": "TC_001",
"fullName": "TC_001",
"failedExpectations": [],
"status": "finished",
"specs": [
{
"id": "spec0",
"description": "using demo site",
"fullName": "TC_001 using demo site",
"failedExpectations": [],
"passedExpectations": [
{
"matcherName": "toEqual",
"message": "Passed.",
"stack": "",
"passed": true
}
],
"pendingReason": "",
"status": "passed"
}
]
}
}
目前不支持 jasmine 记者的辅助功能插件,相反,您可以使用 JSON 格式在以下帮助下生成报告:resultJsonOutputFile
,有关更多详细信息,您可以查看以下答案量角器的作者本人 ;)
exports.config = {
seleniumServerJar : './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
seleniumPort : '4444',
/*capabilities : {
browserName : 'firefox'
},*/
specs :['./TC_001.js'],
jasmineNodeopts:{
defaultTimeoutInterval:500000
},
plugins:[{
chromeA11DevTools:{
treatWarningsAsFailures:true
},
//package:'protractor-accessibility-plugin'
path:'node_modules/protractor/plugins/accessibility'
}],
framework : 'jasmine2',
resultJsonOutputFile : './Report.json',
onPrepare: function(){
/*var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './testresults',
filePrefix: 'xmloutput'
}));*/
}
};
它将在您当前的目录中创建Report.json
!
终于我让它工作了,那是因为打字错误。我使用的是 'chromeA11DevTools' 而不是 'chromeA11YDevTools'。
感谢所有帮助过的人。
对于刚开始的人 - 这个视频很棒 - https://www.youtube.com/watch?v=_2Pt6Xx94Bc&index=2&list=PLcqd8qPb2GfPdO-ptcsYL7NVgBbMoKaNu
这听起来可能是新手,但有点卡壳所以敢问。
我正在尝试使用 Protractor 辅助功能插件获取辅助功能审计报告。
我正在使用演示脚本:
describe("TC_001",function(){
it("using demo site", function(){
browser.get("http://juliemr.github.io/protractor-demo");
expect(browser.getTitle()).toEqual('Super Calculator');
});
});
这是conf.js
exports.config = {
framework : 'jasmine2',
seleniumServerJar : './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
seleniumPort : '4444',
/*capabilities : {
browserName : 'firefox'
},*/
specs :['./TC_001.js'],
jasmineNodeopts:{
defaultTimeoutInterval:500000
},
plugins:[{
chromeA11DevTools:{
treatWarningsAsFailures:true
},
package:'protractor-accessibility-plugin'
//path:'node_modules/protractor/plugins/accessibility'
}],
onPrepare: function(){
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './testresults',
filePrefix: 'xmloutput'
}));
}
};
我可以 运行 脚本正常,使用 'protractor conf.js' 但是没有审计报告出现在命令提示符中。
如有任何帮助,我们将不胜感激。谢谢!
编辑
根据建议,我更新了配置文件以 JSON 格式报告结果。
var JSONReporter = require('jasmine-json-test-reporter');
exports.config = {
seleniumServerJar : './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
seleniumPort : '4444',
/*capabilities : {
browserName : 'firefox'
},*/
specs :['./TC_001.js'],
jasmineNodeopts:{
defaultTimeoutInterval:500000
},
plugins:[{
chromeA11DevTools:{
treatWarningsAsFailures:true
},
//package:'protractor-accessibility-plugin'
path:'node_modules/protractor/plugins/accessibility'
}],
framework : 'jasmine2',
onPrepare: function(){
/*var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './testresults',
filePrefix: 'xmloutput'
}));*/
var JSONReporter = require('jasmine-json-test-reporter');
jasmine.getEnv().addReporter(new JSONReporter({
file:'jamine-test-results.json',
beautify: true,
indentationLevel:4
}));
}
};
这确实会生成 JSON 文件,但结果没有可访问性审核的痕迹。
{
"suite1": {
"id": "suite1",
"description": "TC_001",
"fullName": "TC_001",
"failedExpectations": [],
"status": "finished",
"specs": [
{
"id": "spec0",
"description": "using demo site",
"fullName": "TC_001 using demo site",
"failedExpectations": [],
"passedExpectations": [
{
"matcherName": "toEqual",
"message": "Passed.",
"stack": "",
"passed": true
}
],
"pendingReason": "",
"status": "passed"
}
]
}
}
目前不支持 jasmine 记者的辅助功能插件,相反,您可以使用 JSON 格式在以下帮助下生成报告:resultJsonOutputFile
,有关更多详细信息,您可以查看以下答案量角器的作者本人 ;)
exports.config = {
seleniumServerJar : './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
seleniumPort : '4444',
/*capabilities : {
browserName : 'firefox'
},*/
specs :['./TC_001.js'],
jasmineNodeopts:{
defaultTimeoutInterval:500000
},
plugins:[{
chromeA11DevTools:{
treatWarningsAsFailures:true
},
//package:'protractor-accessibility-plugin'
path:'node_modules/protractor/plugins/accessibility'
}],
framework : 'jasmine2',
resultJsonOutputFile : './Report.json',
onPrepare: function(){
/*var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: './testresults',
filePrefix: 'xmloutput'
}));*/
}
};
它将在您当前的目录中创建Report.json
!
终于我让它工作了,那是因为打字错误。我使用的是 'chromeA11DevTools' 而不是 'chromeA11YDevTools'。
感谢所有帮助过的人。
对于刚开始的人 - 这个视频很棒 - https://www.youtube.com/watch?v=_2Pt6Xx94Bc&index=2&list=PLcqd8qPb2GfPdO-ptcsYL7NVgBbMoKaNu