Comparing version 0.0.1 to 0.0.2
@@ -74,2 +74,5 @@ var http = require("http"); | ||
} | ||
if (desired && desired.name) { | ||
this.desiredCapabilities.name = desired.name; | ||
} | ||
@@ -80,3 +83,3 @@ var req = http.request(_this.options, function(res) { | ||
_this.sessionID = locationArr[locationArr.length - 1]; | ||
if (cb) { cb() } | ||
if (cb) { cb(_this.sessionID) } | ||
}); | ||
@@ -83,0 +86,0 @@ }); |
{ "name" : "wd" | ||
, "description" : "WebDriver/Selenium 2 node.js client" | ||
, "tags" : ["web", "automation", "browser", "javascript"] | ||
, "version" : "0.0.1" | ||
, "version" : "0.0.2" | ||
, "author" : "Adam Christian <adam.christian@gmail.com>" | ||
@@ -16,2 +16,2 @@ , "repository" : | ||
, "directories" : { "lib" : "./lib" } | ||
} | ||
} |
@@ -7,3 +7,3 @@ # WD.js -- A super light weight WebDriver/Selenium 2 client for node.js | ||
## Install - SOON | ||
## Install | ||
@@ -17,5 +17,3 @@ <pre> | ||
<pre> | ||
): cd lib | ||
): node | ||
> var wd = require("./main") | ||
): wd shell | ||
> x = wd.createWebDriver() or wd.createWebDriver("ondemand.saucelabs.com", 80, "username", "apikey") | ||
@@ -28,1 +26,32 @@ > x.init() or x.init({desired capabilities ovveride}) | ||
</pre> | ||
## Writing a test! | ||
<pre> | ||
var wd = require("wd") | ||
//get a new intsance | ||
var browser = wd.createWebDriver(); | ||
//instantiate the session | ||
browser.init(function() { | ||
//goto url | ||
browser.get("http://www.jelly.io", function() { | ||
//exec js | ||
browser.exec("window.location.href", function(o) { | ||
//print the js output | ||
console.log(o); | ||
//goto another url | ||
browser.get("http://www.seleniumhq.org", function() { | ||
//close the browser | ||
browser.close(function() { | ||
//kill the session | ||
browser.quit() | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
</pre> |
7687
8
214
54