Skip to content

Instantly share code, notes, and snippets.

@tthew
Created January 14, 2014 18:47
Show Gist options
  • Save tthew/8423532 to your computer and use it in GitHub Desktop.
Save tthew/8423532 to your computer and use it in GitHub Desktop.
var assert = require('assert');
var path = require('path');
var protractor = require('protractor');
var webdriver = require('selenium-webdriver');
var browser = process.env.browser || 'chrome';
var driver = new webdriver.Builder()
.usingServer('http://localhost:4444/wd/hub')
.withCapabilities(webdriver.Capabilities[browser]())
.build();
driver
.manage()
.timeouts()
.setScriptTimeout(100000);
process.on('exit', function () {
driver.quit();
console.log('exited');
});
var World = function (callback) {
this.By = protractor.By;
this.assert = assert;
this.browser = protractor.wrapDriver(driver);
this.ptor = protractor;
callback();
};
module.exports.World = World;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment