我想通過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