Skip to content

Run your WD.js driven tests in multiple browsers, at the same time !

Notifications You must be signed in to change notification settings

chartbeat/wd-parallel-async

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Run your WD.js driven tests in multiple browsers, at the same time !

Update node to latest

http://nodejs.org/#download

Install

npm install wd-parallel-async

Authors

License

Writing a test!

Start by importing the required libraries.

var webdriver = require('wd-parallel-async')
  , assert = require('assert');

Then create the parallelizer.

var parallelizer = webdriver.parallelizer();

You can go ahead and call parallelizer.run(desired, test). Here is an example with chrome and firefox. In your test function write your test as if you were writting it with WD.js.

parallelizer.run([{ 
    browserName:'chrome',
    tags: ["examples"],
    name: "This is an example test",
},{
    browserName:'firefox',
    tags: ["examples"],
    name: "This is an example test",
}], function(browser, desired) {

    browser.on('status', function(info){
		console.log('\x1b[36m%s\x1b[0m', info);
    });
    
    browser.on('command', function(meth, path){
		console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path);
    });
    
    browser.init(desired, function() {
		browser.get("http://saucelabs.com/test/guinea-pig", function() {
	    	browser.title(function(err, title) {
			assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!');
				browser.elementById('submit', function(err, el) {
		    		browser.clickElement(el, function() {
						browser.eval("window.location.href", function(err, title) {
			    			assert.ok(~title.indexOf('#'), 'Wrong title!');
  			   	 			browser.quit()
						})
		    		})
				})
	    	})
		})
    })
});

Supported Methods

All tests are run with WD.js check the docs for information about available methods.

Full JsonWireProtocol mapping:

full mapping

More docs!

WD is simply implementing the Selenium JsonWireProtocol, for more details see the official docs:
 - http://code.google.com/p/selenium/wiki/JsonWireProtocol

About

Run your WD.js driven tests in multiple browsers, at the same time !

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%