继this问题,我试过(naievely)要做到这一点:
量角器测试/功能/量角器-conf.js --params.test_set = dev_test
和
量角器-conf.js:
exports.config = { // ... 规格:[browser.params.test_set +'/ *功能'],
...但当然,因为浏览器是不是在那个conf文件是解析时定义这是行不通的。
所以,我怎么能实现这样的效果:将参数传递到量角器确定的规格
解决方案使用 - 规格
命令行参数:
- 规格
文件,以测试的逗号分隔列表
量角器测试/功能/量角器-conf.js --specs = dev_test / *功能
注意 dev_test / *功能
将传递到量角器的命令行界面,将根据当前的工作目录(的来源$ C $ C )。
Following the lead of this question, I tried (naievely) to do this:
protractor test/features/protractor-conf.js --params.test_set=dev_test
and
protractor-conf.js:
exports.config = {
// ...
specs: [browser.params.test_set+'/*.feature'],
... but of course it doesn't work because browser is not defined at the time that the conf file is parse.
So how could I achieve this effect: passing a parameter to protractor that determines the specs?
解决方案Use the --specs
command-line argument:
--specs
Comma-separated list of files to test
protractor test/features/protractor-conf.js --specs=dev_test/*.feature
Note that dev_test/*.feature
would be passed into the protractor's command-line-interface which would resolve the paths based on the current working directory (source code).