我想通过grunt为浏览器功能矩阵运行cucumberjs测试。grunt cucumberjs多个并行运行
矩阵配置“咕噜”正常(qcuberbatch是当地咕噜任务定义):
grunt.initConfig
qcumberbatch:
options:
steps: 'src/features/integration/steps'
tags: '[email protected]'
browserstack:
'browserstack.user' : process.env.BS_USER
'browserstack.key' : process.env.BS_ACCESS_KEY
'browserstack.tunnel' : 'true' # This was the secret!
matrix: [
browser: 'firefox'
browser_version: '26.0'
os: 'Windows'
os_version : '7',
,
browser : 'IE',
browser_version : '9.0',
os : 'Windows',
os_version : '7',
resolution : '1024x768'
]
hub: "http://hub.browserstack.com/wd/hub"
local:
files:
src: ['src/features/integration/*']
options:
hub: 'http://localhost:4444/wd/hub'
matrix: ['firefox']
browserstack:
files:
src: ['src/features/integration/*']
failing:
files:
src: ['src/features/integration/*']
options:
tags: '@ShouldFail'
默认选项有它使用Firefox和IE浏览器在Windows 7上运行针对browserstack,与当地的测试覆盖browserstack使用本地硒webdriver枢纽。
黄瓜世界设定了一个构造函数取功能对象:
module.exports = class World
###
Create a new world, assuming firefox capabilities.
@param {string} browser property name from the `webdriver.Capabilities`
list.
###
constructor: (capabilities = {browserName: "firefox"})->
@driver = new webdriver.Builder().
usingServer(process.env.SELENIUM_HUB).
withCapabilities(capabilities).build()
@driver.manage().timeouts().setScriptTimeout(10000)
的问题,从咕噜运行这个时候,是cucumberjs没有任何编程接口(即我见)。如果没有配置在运行时加载哪几个功能块的能力,我应该怎么做才能在cucumberjs run和grunt之间传递功能?
扩展到这个想法,在env var中将JSON传递的能力如何?然后解析你的世界中的那个JSON字符串,并让你的对象返回。 – jbpros