Comparing version 0.1.4 to 0.1.5
@@ -26,3 +26,3 @@ <table class="wikitable"> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
init(desired, cb) -> cb(err, sessionID)<br> | ||
init(desired, cb) -> cb(err, sessionID, capabilities)<br> | ||
Initialize the browser.<br> | ||
@@ -877,3 +877,6 @@ </td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
buttonDown(cb) -> cb(err)<br> | ||
buttonDown(button ,cb) -> cb(err)<br> | ||
button is optional.<br> | ||
{LEFT = 0, MIDDLE = 1 , RIGHT = 2}.<br> | ||
LEFT if not specified.<br> | ||
</td> | ||
@@ -887,3 +890,6 @@ </tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
buttonUp(cb) -> cb(err)<br> | ||
buttonUp(button, cb) -> cb(err)<br> | ||
button is optional.<br> | ||
{LEFT = 0, MIDDLE = 1 , RIGHT = 2}.<br> | ||
LEFT if not specified.<br> | ||
</td> | ||
@@ -911,3 +917,9 @@ </tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
NA | ||
<p> | ||
tap(element) -> cb(err)<br> | ||
Taps element<br> | ||
</p> | ||
<p> | ||
element.tap(cb) -> cb(err)<br> | ||
</p> | ||
</td> | ||
@@ -1118,2 +1130,29 @@ </tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/log">/session/:sessionId/log</a><br> | ||
Get the log for a given log type. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
log(logType, cb) -> cb(err, arrayOfLogs)<br> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
GET <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/log/types">/session/:sessionId/log/types</a><br> | ||
Get available log types. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
logTypes(cb) -> cb(err, arrayOfLogTypes)<br> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
GET <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/application_cache/status">/session/:sessionId/application_cache/status</a><br> | ||
Get the status of the html5 application cache. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
NA | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
EXTRA | ||
@@ -1258,3 +1297,3 @@ </td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
Equivalent to the python sendKeys binding. Upload file if <br> | ||
Equivalent to the python sendKeys binding. Upload file if<br> | ||
a local file is detected, otherwise behaves like type.<br> | ||
@@ -1261,0 +1300,0 @@ element.sendKeys(keys, cb) -> cb(err)<br> |
@@ -93,3 +93,6 @@ { | ||
"DELETE /session/:sessionId/session_storage/key/:key": "Remove the storage item for the given key.", | ||
"GET /session/:sessionId/session_storage/size": "Get the number of items in the storage." | ||
"GET /session/:sessionId/session_storage/size": "Get the number of items in the storage.", | ||
"POST /session/:sessionId/log": "Get the log for a given log type.", | ||
"GET /session/:sessionId/log/types": "Get available log types.", | ||
"GET /session/:sessionId/application_cache/status": "Get the status of the html5 application cache." | ||
} |
@@ -26,3 +26,3 @@ <table class="wikitable"> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
init(desired, cb) -> cb(err, sessionID)<br> | ||
init(desired, cb) -> cb(err, sessionID, capabilities)<br> | ||
Initialize the browser.<br> | ||
@@ -823,3 +823,6 @@ </td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
buttonDown(cb) -> cb(err)<br> | ||
buttonDown(button ,cb) -> cb(err)<br> | ||
button is optional.<br> | ||
{LEFT = 0, MIDDLE = 1 , RIGHT = 2}.<br> | ||
LEFT if not specified.<br> | ||
</td> | ||
@@ -833,3 +836,6 @@ </tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
buttonUp(cb) -> cb(err)<br> | ||
buttonUp(button, cb) -> cb(err)<br> | ||
button is optional.<br> | ||
{LEFT = 0, MIDDLE = 1 , RIGHT = 2}.<br> | ||
LEFT if not specified.<br> | ||
</td> | ||
@@ -853,2 +859,17 @@ </tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/touch/click">/session/:sessionId/touch/click</a><br> | ||
Single tap on the touch enabled device. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
<p> | ||
tap(element) -> cb(err)<br> | ||
Taps element<br> | ||
</p> | ||
<p> | ||
element.tap(cb) -> cb(err)<br> | ||
</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/touch/flick">/session/:sessionId/touch/flick</a><br> | ||
@@ -911,2 +932,20 @@ Flick on the touch screen using finger motion events. | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/log">/session/:sessionId/log</a><br> | ||
Get the log for a given log type. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
log(logType, cb) -> cb(err, arrayOfLogs)<br> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
GET <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/log/types">/session/:sessionId/log/types</a><br> | ||
Get available log types. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
logTypes(cb) -> cb(err, arrayOfLogTypes)<br> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
EXTRA | ||
@@ -1051,3 +1090,3 @@ </td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
Equivalent to the python sendKeys binding. Upload file if <br> | ||
Equivalent to the python sendKeys binding. Upload file if<br> | ||
a local file is detected, otherwise behaves like type.<br> | ||
@@ -1054,0 +1093,0 @@ element.sendKeys(keys, cb) -> cb(err)<br> |
@@ -67,11 +67,2 @@ <table class="wikitable"> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/touch/click">/session/:sessionId/touch/click</a><br> | ||
Single tap on the touch enabled device. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
NA | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/touch/down">/session/:sessionId/touch/down</a><br> | ||
@@ -219,3 +210,12 @@ Finger down on the screen. | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
GET <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/application_cache/status">/session/:sessionId/application_cache/status</a><br> | ||
Get the status of the html5 application cache. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
NA | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> |
@@ -5,3 +5,3 @@ var mappingType = process.argv[2] || 'supported'; | ||
mu = require('mu2'), | ||
_ = require('underscore'); | ||
_ = require('lodash'); | ||
@@ -11,2 +11,3 @@ mu.root = __dirname; | ||
var jsonWireFull = JSON.parse(fs.readFileSync('doc/jsonwire-full.json').toString()); | ||
var jsonDocs = [ | ||
@@ -22,3 +23,3 @@ JSON.parse(fs.readFileSync('tmp/webdriver-dox.json').toString()), | ||
var current = { | ||
jsonWire: { | ||
jsonWire: { | ||
key: jw_k, | ||
@@ -36,10 +37,10 @@ method: jw_k.split(' ')[0], | ||
return (t.type === 'jsonWire') && (t.string === jw_k); | ||
}).length > 0){ | ||
}).size() > 0){ | ||
var orderTag = _(wd_v.tags).filter(function (t) { | ||
return t.type === 'docOrder'; | ||
}); | ||
}).value(); | ||
var order = 1000000; | ||
if (orderTag.length > 0){ | ||
order = parseInt(orderTag[0].string, 10); | ||
} | ||
order = parseInt(orderTag[0].string, 10); | ||
} | ||
var desc = _(wd_v.description.full.split('\n')).filter(function (l) { | ||
@@ -49,3 +50,3 @@ return l !== ''; | ||
return {line: l}; | ||
}); | ||
}).value(); | ||
current.wd_doc.push({ | ||
@@ -58,6 +59,7 @@ 'desc': desc, | ||
}); | ||
current.wd_doc = _(current.wd_doc).sortBy(function (docItem) { | ||
return docItem.order; | ||
}); | ||
current.wd_doc0 = current.wd_doc.length === 0; | ||
}).value(); | ||
current.wd_doc0 = current.wd_doc.length === 0; | ||
current.wd_doc1 = current.wd_doc.length === 1? current.wd_doc : null; | ||
@@ -69,2 +71,3 @@ current.wd_docN = current.wd_doc.length > 1? current.wd_doc: null; | ||
((mappingType === 'unsupported') && (current.wd_doc.length === 0) ) ) { | ||
resMapping.push(current); | ||
@@ -79,3 +82,3 @@ } | ||
return t.type === 'jsonWire'; | ||
}).length === 0){ | ||
}).size() === 0){ | ||
var current = { | ||
@@ -89,3 +92,3 @@ extra: true, | ||
return {line: l}; | ||
}); | ||
}).value(); | ||
current.wd_doc.push({ 'desc': desc }); | ||
@@ -99,3 +102,3 @@ current.wd_doc1 = current.wd_doc; | ||
} | ||
}); | ||
}); | ||
}); | ||
@@ -113,3 +116,3 @@ | ||
var current = { | ||
missing: { | ||
missing: { | ||
key:tag | ||
@@ -123,9 +126,9 @@ }, | ||
return {line: l}; | ||
}); | ||
}).value(); | ||
current.wd_doc.push({desc: desc}); | ||
current.wd_doc1 = current.wd_doc; | ||
resMapping.push(current); | ||
} | ||
} | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -132,0 +135,0 @@ |
@@ -231,16 +231,20 @@ var EventEmitter = require('events').EventEmitter; | ||
opts.headers.Connection = 'keep-alive'; | ||
if (opts.method === 'POST' || opts.method === 'GET') { | ||
opts.headers.Accept = 'application/json'; } | ||
if (opts.method === 'POST') { | ||
opts.headers['Content-Type'] = 'application/json; charset=UTF-8'; } | ||
opts.timeout = this._httpInactivityTimeout; | ||
// we need to check method here to cater for DELETE case | ||
if(opts.method === 'GET' || opts.method === 'POST'){ | ||
opts.headers.Accept = 'application/json'; | ||
} | ||
opts.prepareToSend = function(url, data) { | ||
this.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); | ||
this.url = url; | ||
this.body = data; | ||
if (opts.method === 'POST') { | ||
this.headers['Content-Type'] = 'application/json; charset=UTF-8'; | ||
this.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); | ||
this.body = data; | ||
} | ||
}; | ||
return opts; | ||
}; | ||
var strip = function strip(str) { | ||
@@ -281,3 +285,2 @@ if(typeof(str) !== 'string') { return str; } | ||
var data = JSON.stringify({desiredCapabilities: _desired}); | ||
httpOpts.timeout = this._httpInactivityTimeout; | ||
@@ -358,3 +361,2 @@ httpOpts.prepareToSend(url, data); | ||
} | ||
httpOpts.timeout = this._httpInactivityTimeout; | ||
httpOpts.prepareToSend(url, data); | ||
@@ -1529,4 +1531,4 @@ // building request | ||
/** | ||
* buttonDown(number ,cb) -> cb(err) | ||
* number is optional. | ||
* buttonDown(button ,cb) -> cb(err) | ||
* button is optional. | ||
* {LEFT = 0, MIDDLE = 1 , RIGHT = 2}. | ||
@@ -1540,7 +1542,7 @@ * LEFT if not specified. | ||
var cb = fargs.callback, | ||
number = fargs.all[0]; | ||
button = fargs.all[0]; | ||
this._jsonWireCall({ | ||
method: 'POST' | ||
, relPath: '/buttondown' | ||
, data: {number: number} | ||
, data: {button: button} | ||
, cb: this._simpleCallback(cb) | ||
@@ -1551,4 +1553,4 @@ }); | ||
/** | ||
* buttonUp(number, cb) -> cb(err) | ||
* number is optional. | ||
* buttonUp(button, cb) -> cb(err) | ||
* button is optional. | ||
* {LEFT = 0, MIDDLE = 1 , RIGHT = 2}. | ||
@@ -1562,7 +1564,7 @@ * LEFT if not specified. | ||
var cb = fargs.callback, | ||
number = fargs.all[0]; | ||
button = fargs.all[0]; | ||
this._jsonWireCall({ | ||
method: 'POST' | ||
, relPath: '/buttonup' | ||
, data: {number: number} | ||
, data: {button: button} | ||
, cb: this._simpleCallback(cb) | ||
@@ -1569,0 +1571,0 @@ }); |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"author": "Adam Christian <adam.christian@gmail.com>", | ||
@@ -31,2 +31,6 @@ "contributors": [ | ||
}, | ||
"licenses" : [{ | ||
"type": "Apache", | ||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
}], | ||
"bugs": { | ||
@@ -33,0 +37,0 @@ "url": "https://github.com/admc/wd/issues" |
@@ -284,3 +284,3 @@ # WD.js -- WebDriver/Selenium 2 for node.js | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
init(desired, cb) -> cb(err, sessionID)<br> | ||
init(desired, cb) -> cb(err, sessionID, capabilities)<br> | ||
Initialize the browser.<br> | ||
@@ -1081,3 +1081,6 @@ </td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
buttonDown(cb) -> cb(err)<br> | ||
buttonDown(button ,cb) -> cb(err)<br> | ||
button is optional.<br> | ||
{LEFT = 0, MIDDLE = 1 , RIGHT = 2}.<br> | ||
LEFT if not specified.<br> | ||
</td> | ||
@@ -1091,3 +1094,6 @@ </tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
buttonUp(cb) -> cb(err)<br> | ||
buttonUp(button, cb) -> cb(err)<br> | ||
button is optional.<br> | ||
{LEFT = 0, MIDDLE = 1 , RIGHT = 2}.<br> | ||
LEFT if not specified.<br> | ||
</td> | ||
@@ -1111,2 +1117,17 @@ </tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/touch/click">/session/:sessionId/touch/click</a><br> | ||
Single tap on the touch enabled device. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
<p> | ||
tap(element) -> cb(err)<br> | ||
Taps element<br> | ||
</p> | ||
<p> | ||
element.tap(cb) -> cb(err)<br> | ||
</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/touch/flick">/session/:sessionId/touch/flick</a><br> | ||
@@ -1169,2 +1190,20 @@ Flick on the touch screen using finger motion events. | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
POST <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/log">/session/:sessionId/log</a><br> | ||
Get the log for a given log type. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
log(logType, cb) -> cb(err, arrayOfLogs)<br> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
GET <a href="http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/session/:sessionId/log/types">/session/:sessionId/log/types</a><br> | ||
Get available log types. | ||
</td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
logTypes(cb) -> cb(err, arrayOfLogTypes)<br> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
EXTRA | ||
@@ -1309,3 +1348,3 @@ </td> | ||
<td style="border: 1px solid #ccc; padding: 5px;"> | ||
Equivalent to the python sendKeys binding. Upload file if <br> | ||
Equivalent to the python sendKeys binding. Upload file if<br> | ||
a local file is detected, otherwise behaves like type.<br> | ||
@@ -1312,0 +1351,0 @@ element.sendKeys(keys, cb) -> cb(err)<br> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1439
509620
73
7912