如何使用一个参数来量角器配置文件选择步骤?量角器、如何使用、配置文件、步骤

2023-09-13 03:49:07 作者:酒入愁肠

继this问题,我试过(naievely)要做到这一点:

量角器测试/功能/量角器-conf.js --params.test_set = dev_test

量角器-conf.js:

  exports.config = {   // ...  规格:[browser.params.test_set +'/ *功能'], 

...但当然,因为浏览器是不是在那个conf文件是解析时定义这是行不通的。

所以,我怎么能实现这样的效果:将参数传递到量角器确定的规格

解决方案

使用 - 规格命令行参数:

  

- 规格文件,以测试的逗号分隔列表

 量角器测试/功能/量角器-conf.js --specs = dev_test / *功能 
一步一步教你用Altium进行开关电源PCB设计之炫酷的3D封装设计

注意 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).