Skip to content

Instantly share code, notes, and snippets.

@cefn
Created August 12, 2015 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cefn/92de780976090bf89485 to your computer and use it in GitHub Desktop.
Save cefn/92de780976090bf89485 to your computer and use it in GitHub Desktop.
var chai = require("chai"),
chaiAsPromised = require("chai-as-promised"),
selenium = require("selenium-standalone"),
wd = require("wd"),
Q=require("q");
chai.use(chaiAsPromised);
chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;
describe("The End of the Internet", function(){
var browser = wd.promiseChainRemote();
var seleniumProcess = null;
before(function(){
return Q.all([
new Promise(function(resolve, reject){
selenium.start([], function(err, child){
seleniumProcess = child;
resolve(arguments)
})
}),
browser.init({browserName:"chrome"}),
])
})
after(function(){
seleniumProcess.kill("SIGINT");
seleniumProcess = null;
})
it("Can reach the end of the internet", function(){
return browser.get("http://www.wwwdotcom.com/")
.title()
.should.eventually.equal("The Last Page of the Internet")
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment