
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
grunt-webdriver
Advanced tools
grunt-webdriver is a grunt plugin to run selenium tests with BusterJS and webdriverjs
grunt-webdriver is a grunt plugin to run selenium tests with BusterJS and webdriverjs
This plugin requires Grunt ~0.4.0
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-webdriver --save-dev
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-webdriver');
In your project's Gruntfile, add a section named webdriver
to the data
object passed into grunt.initConfig()
.
Run this task with the grunt webdriver
command.
grunt.initConfig({
webdriver: {
dev: {
url: '<start-url>',
tests: ['<path-to-your-testfiles>']
}
},
})
Type: String
Default: chrome
Options: chrome | firefox | opera | safari | phantomjs
Defines the browser. If PhantomJS (>v1.8
) is installed, you
can run your Selenium tests in a headless browser. These tests are much faster as standard
browser tests.
Type: String
Default: dots
Options: dots | specification | quiet | xml | tap | html | teamcity
Reporters visualize progress and results of test runs. Some are desired for continious integration tests. Find more information in the BusterJS documentation.
Type: String
Define a path to save the test output from the buster reporters.
Type: String
Default: silent
Options silent | verbose
Set log level of webdriverjs API
Type: String
Default: standard MacOSX browser path (e.g. Chrome: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
Specify the binary path for the indicated browser (important for windows user)
In this example, the minimum required options are used to execute a simple test script.
grunt.initConfig({
webdriver: {
dev: {
url: 'http://github.com',
tests: './test/github-test.js'
}
},
})
The corresponding Hello World test script, using webdriverjs API to search the grunt-webdriver repository on GitHub. See more functions and test examples in the webdriverjs repository.
'use strict';
exports.name = "Simple Github Test";
exports.setUp = function(){
// ...
};
exports.tests = [{
name: "checks if title contains the search query",
func: function(done) {
var query = 'grunt-webdriver';
exports.driver
.click('.search a')
.setValue('.search-page-input',query)
.click('#search_form .button')
.getTitle(function(title) {
buster.assertions.assert(title.indexOf(query) !== -1);
})
.end(done);
}}
];
exports.tearDown = function() {
// ...
}
Please fork, add specs, and send pull requests! In lieu of a formal styleguide, take care to maintain the existing coding style.
FAQs
grunt-webdriver is a grunt plugin to run selenium tests with the WebdriverIO test runner
The npm package grunt-webdriver receives a total of 983 weekly downloads. As such, grunt-webdriver popularity was classified as not popular.
We found that grunt-webdriver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.