量angular器如何使用npm属性读取器从属性文件调用具有多个套件值的键

我有一个要求,我需要在conf.js文件外存储一些数据。

所以我已经安装了属性阅读器节点模块,但我在访问某些关键值时遇到一些问题。 以下是我的属性文件和conf.js文件

config.properties文件

[main] browserName = chrome shardTestFiles = true maxInstances = 4 suites = ../specs/folder1/*.js 

conf.js文件

 var PropertiesReader = require('properties-reader'); var properties = PropertiesReader('config.properties'); multiCapabilities: [ { 'browserName': properties.get('main.browserName'), shardTestFiles: properties.get('main.shardTestFiles'), maxInstances: properties.get('main.maxInstances'), }, suites: { Suite : [properties.get('main.suites')], }, 

与上面的configuration我可以执行folder1中的所有规格。 但是当我尝试添加一个以上的文件夹。

config.properties文件

 [main] browserName = chrome shardTestFiles = true maxInstances = 4 suites = ../specs/folder1/*.js,../specs/folder2/*.js 

我越来越低于错误。

 BEFORE LAUNCH WARNING - pattern ../specs/folder1/*.js,../specs/folder2/*.js did not match any files. 

什么是在.properties文件中存储多个文件夹path的语法,以便我可以在我的conf.js文件中调用它们

这里有一个小小的棘手的错误。 套件中定义的每个套件应该是规范path的数组。

[properties.get('main.suites')] – 这将只返回一个string,而不是一个数组

您需要拆分testingpath以形成一个数组来完成这项工作

 var PropertiesReader = require('properties-reader'); var properties = PropertiesReader('config.properties'); suites: { Suite: properties.get('main.suites').split(","), },