Starts a Selenium server in the background.
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-selenium --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-selenium');
In your project's Gruntfile, add a section named selenium
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
selenium: {
options: {
version: '2.37.0',
drivers: [{
name: 'chrome',
filename: 'chromedriver'
}, {
name: 'ie',
filename: 'IEDriverServer'
}],
hostname: 'localhost',
port: 4444,
timeOut: 10000
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: String
Default value: 'node_modules/protractor/selenium'
Path to the Selenium server Jar file and web driver files.
Type: String
Default value: 'selenium-server-standalone-'
Prefix for the Selenium server Jar file. The version number and file extension will be appended.
Type: String
Default value: '2.37.0'
Version number for Selenium server. Appended to the filenamePrefix.
Type: Array
Default value: '[{ name: 'chrome', filename: 'chromedriver' }]'
Array of webdrivers to use.
Type: String
Name of the webdriver, used in the command line argument to pass the driver: -Dwebdriver.name.driver=...
.
Type: Array
Filename of the webdriver, without extension.
Type: String
Default value: 'localhost'
Hostname or IP address of Selenium.
Type: Integer
Default value: '4444'
Port number of Selenium.
Type: Integer
Default value: '10000'
Time out in milliseconds. If Selenium server doesn't start within the given time, the server is stopped.
In this example, the default options are used to do something with whatever. So if the testing
file has the content Testing
and the 123
file had the content 1 2 3
, the generated result would be Testing, 1 2 3.
grunt.initConfig({
selenium: {
options: {
version: '2.37.0'
},
e2e-unix: {
options: {
drivers: [{
name: 'chrome',
filename: 'chromedriver'
}]
}
},
e2e-win: {
options: {
drivers: [{
name: 'ie',
filename: 'IEDriverServer'
}]
}
}
},
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)