- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我需要在 Protractor 中生成测试报告。我浏览了一些教程,但这些教程对我来说并不清楚。
当我尝试安装 npm 时,出现以下错误。
运行后,将创建名为 node_modules 的文件夹。但是,我不明白为什么我无法安装 npm。请帮忙。
-编辑-
我正在使用this生成 Protractor 报告的教程。
我将 var HtmlReporter = require('protractor-html-screenshot-reporter')
添加到我的 conf.js
这是我的完整文件。
// conf.js
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['invoice.js'],
capabilities: {
browserName: 'chrome',
},
jasmineNodeOpts: {
showColors: true, // Use colors in the command line report.
}
var HtmlReporter = require('protractor-html-screenshot-reporter');
var reporter=new HtmlReporter({
baseDirectory: './protractor-result', // a location to store screen shots.
docTitle: 'Protractor Demo Reporter',
docName: 'protractor-demo-tests-report.html'
});
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['invoice.js'],
onPrepare: function() {
jasmine.getEnv().addReporter(reporter);
}
}
}
发生以下错误。
请告诉我该怎么做。提前致谢。
最佳答案
您的 conf.js
格式错误 - 您无法在对象定义中定义变量。它应该看起来像这样:
var HtmlReporter = require('protractor-html-screenshot-reporter');
var reporter = new HtmlReporter({
baseDirectory: './protractor-result', // a location to store screen shots.
docTitle: 'Protractor Demo Reporter',
docName: 'protractor-demo-tests-report.html'
});
exports.config = {
framework: 'jasmine',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['invoice.js'],
capabilities: {
browserName: 'chrome',
},
jasmineNodeOpts: {
showColors: true, // Use colors in the command line report.
},
onPrepare: function() {
jasmine.getEnv().addReporter(reporter);
}
}
请注意,我从未使用过 Protractor,因此我无法保证这是一个有效的配置,但它应该可以对您的语法错误进行排序。
关于node.js - 不能使用 var HtmlReporter = require ('protractor-html-screenshot-reporter' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35913632/
您通常会在类名或方法名中使用良好或有些成熟的缩写。但是您如何使用 CamelCase 或 camelBack? HTMLReport 与 HtmlReport CustomerDAO 与 Custom
我正在测试 Backbone Marionette 应用程序。测试页面由以下脚本组成: Jasmine : Jasmine HTML 记者: 我的规范: 设置:已复制 window.onload 代码
我正在尝试将自动测试的屏幕截图添加到我的 pytest-html 报告中 我已添加到plugin.py: def pytest_runtest_makereport(__multicall__, it
我正在制作一个演示 Canopy 的演示文稿我正在尝试让 LiveHtmlReporter 工作,但没有成功。到目前为止,我已经能够打开显示模板的浏览器并将报告保存到磁盘,但报告永远不会随着测试运行的
我需要在 Protractor 中生成测试报告。我浏览了一些教程,但这些教程对我来说并不清楚。 当我尝试安装 npm 时,出现以下错误。 运行后,将创建名为 node_modules 的文件夹。但是,
我是一名优秀的程序员,十分优秀!