Grunt tasks to manage a selenium instance.
Want to see pretty graphs? Log in now!
npm install grunt-selenium-launcher
|2||downloads in the last day|
|15||downloads in the last week|
|85||downloads in the last month|
|Last Published By|
|Version||0.1.1 last updated 6 months ago|
|Keywords||grunt, selenium, launcher|
A Grunt task to launch a selenium server.
Load the task:
Call the task:
grunt.registerTask 'e2e-tests', [ 'selenium-launch', 'cucumberjs' ]
Use the settings exported to the environment to connect to the correct instance:
var driver = new require("selenium-webdriver").Builder() .usingServer(process.env.SELENIUM_HUB) .withCapabilities(webdriver.Capabilities.firefox()) .build()
Attempt to launch a selenium instance, binding to
process.env.SELENIUM_LAUNCHER_PORT. If that port is unavailable, the launcher will iterate ports until it finds one available, and then resets
process.env.SELENIUM_LAUNCHER_PORT to that. The task completes when the server is running and bound. The server is automatically killed when the grunt process exits - no need to take extreme steps to ensure the process isn't left a zombie.
process.env.SELENIUM_LAUNCHER_PORT If set when running grunt, defines the preferred port to run Selenium on. After the task has run, has the value of the port selenium bound on.
process.env.SELENIUM_HUB After the task has run, has the string URI for webdriver hub connection. Use this string when connecting clients to selenium.