How do i overwrite protractor.conf.js values from the command line?(如何从命令行覆盖 protractor.conf.js 值?)
问题描述
我目前有量角器设置可以在我们的集成服务器上运行.在 protractor.conf.js 文件中,我有以下内容:
I currently have protractor setup to run on our integration server. Inside the protractor.conf.js file i have the following:
multiCapabilities: [{
'browserName': 'firefox',
'platform': 'MAC'
}, {
'browserName': 'chrome',
'platform': 'MAC'
}]
我想在从命令行本地运行时覆盖它.我试过以下没有成功
I would like to override this when running locally from the command line. I've tried the following with no success
protractor --verbose --browser=chrome
问题:从命令行本地运行时,如何切换到仅使用单个 chrome 实例?
Question: How do i switch to only using a single instance of chrome when running locally from the command line?
推荐答案
这是个问题.
根据源码,浏览器
命令行参数是 capabilities.browserName
的别名.
According to the source code, browser
command line argument is an alias of capabilities.browserName
.
根据 referenceConf.js
文档:
According to the referenceConf.js
documentation:
// If you would like to run more than one instance of WebDriver on the same
// tests, use multiCapabilities, which takes an array of capabilities.
// If this is specified, capabilities will be ignored.
multiCapabilities: [],
换句话说,由于指定了 multiCapabilities
,capabilities
将被忽略.
In other words, since multiCapabilities
are specified, capabilities
are ignored.
您可以尝试从命令行重置 multiCapabilities
:
What you can try to do is to reset multiCapabilities
from command-line:
protractor --verbose --browser=chrome --multiCapabilities
作为另一种解决方法,使用单独的配置文件来运行单个浏览器实例.
As an another workaround, have a separate config file for running a single browser instance.
另外,相关主题列表:
- 添加了对 multiCapabilities 对象和 splitTestsBetweenCapabilities 布尔值的支持
- Multicapabilities 规范忽略命令行上的 --specs 标志并继续运行
这篇关于如何从命令行覆盖 protractor.conf.js 值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从命令行覆盖 protractor.conf.js 值?
基础教程推荐
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 直接将值设置为滑块 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01