jwebdriver
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -0,0 +0,0 @@ YUI.add("yuidoc-meta", function(Y) { |
@@ -0,0 +0,0 @@ YUI.add('api-filter', function (Y) { |
@@ -0,0 +0,0 @@ YUI.add('api-list', function (Y) { |
@@ -0,0 +0,0 @@ YUI.add('api-search', function (Y) { |
@@ -0,0 +0,0 @@ YUI().use( |
@@ -0,0 +0,0 @@ YUI().use('node', function(Y) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A webdriver client for Node.js", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"url": "http://yaniswang.com/jwebdriver/", | ||
@@ -75,3 +75,3 @@ "logo": "https://raw.github.com/yaniswang/jWebDriver/master/logo_s.png" | ||
"line": 1, | ||
"description": "A webdriver client for Node.js\n<p>\n此对象是jwebdriver组件的入口,主要用来初始化及同步运行测试代码。\n</p>\n<pre>\nvar JWebDriver = require('jwebdriver');\nJWebDriver.config({\n\t'logMode': 'all',\n\t'host': 'localhost',\n\t'port': 4444\n});\nvar wd = new JWebDriver({'browserName':'chrome'});\nwd.run(function(browser, $){\n\tbrowser.url(\"http://www.baidu.com/\");\n\tvar kw = $('#kw');\n\tkw.val('mp3').submit();\n\tbrowser.close();\n});\n</pre>" | ||
"description": "A webdriver client for Node.js\n<p>\n此对象是jwebdriver组件的入口,主要用来初始化及同步运行测试代码。\n</p>\n<pre>\nvar JWebDriver = require('jwebdriver');\nJWebDriver.config({\n\t'logMode': 'all',\n\t'host': 'localhost',\n\t'port': 4444\n});\nvar wd = new JWebDriver({'browserName':'chrome'});\nwd.run(function(browser, $){\n\tbrowser.url(\"http://www.baidu.com/\");\n\tvar kw = $('#kw');\n\tkw.val('mp3').submit();\n\tbrowser.end();\n});\n</pre>" | ||
} | ||
@@ -82,3 +82,3 @@ }, | ||
"file": "lib\\browser.js", | ||
"line": 155, | ||
"line": 151, | ||
"description": "初始化浏览器对象", | ||
@@ -110,3 +110,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 180, | ||
"line": 176, | ||
"description": "输出日志", | ||
@@ -137,3 +137,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 214, | ||
"line": 210, | ||
"description": "检查返回值是否有错误,适用于所有WebDriver API的返回值", | ||
@@ -159,3 +159,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 226, | ||
"line": 222, | ||
"description": "检查返回值是否正确,适用于所有WebDriver API的返回值", | ||
@@ -181,3 +181,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 237, | ||
"line": 233, | ||
"description": "执行webdriver命令", | ||
@@ -214,3 +214,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 312, | ||
"line": 308, | ||
"description": "发起HTTP请求到webdriver的接口", | ||
@@ -247,3 +247,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 396, | ||
"line": 398, | ||
"description": "延迟一定时间", | ||
@@ -269,3 +269,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 412, | ||
"line": 414, | ||
"description": "返回窗口句柄", | ||
@@ -292,3 +292,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 423, | ||
"line": 425, | ||
"description": "切换到另一个Window或Frame", | ||
@@ -315,3 +315,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 445, | ||
"line": 447, | ||
"description": "返回或者设置当前窗口的大小", | ||
@@ -344,3 +344,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 472, | ||
"line": 474, | ||
"description": "最大化当前窗口", | ||
@@ -359,3 +359,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 484, | ||
"line": 486, | ||
"description": "返回或者设置当前窗口的坐标", | ||
@@ -388,3 +388,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 511, | ||
"line": 513, | ||
"description": "关闭当前窗口", | ||
@@ -403,3 +403,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 523, | ||
"line": 525, | ||
"description": "结束浏览器会话", | ||
@@ -418,3 +418,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 535, | ||
"line": 537, | ||
"description": "设置操作超时时间\n<p>\n注:script包括同步和异步两种代码\n</p>", | ||
@@ -445,3 +445,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 557, | ||
"line": 559, | ||
"description": "打开或者返回当前URL", | ||
@@ -468,3 +468,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 575, | ||
"line": 577, | ||
"description": "控制浏览器回到后一个URL", | ||
@@ -483,3 +483,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 587, | ||
"line": 589, | ||
"description": "控制浏览器回到前一个URL", | ||
@@ -498,3 +498,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 599, | ||
"line": 601, | ||
"description": "刷新当前页面", | ||
@@ -513,3 +513,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 611, | ||
"line": 613, | ||
"description": "返回当前页面title", | ||
@@ -528,3 +528,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 621, | ||
"line": 623, | ||
"description": "返回当前页面源代码", | ||
@@ -543,3 +543,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 631, | ||
"line": 633, | ||
"description": "返回当前页面下所有cookie", | ||
@@ -558,3 +558,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 641, | ||
"line": 643, | ||
"description": "添加cookie到当前页面\n<p>\n这里可以查看WebDriver官方定义的<a href=\"http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object\" target=\"_blank\">cookie对象</a>\n</p>", | ||
@@ -580,3 +580,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 657, | ||
"line": 659, | ||
"description": "删除cookie", | ||
@@ -602,3 +602,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 675, | ||
"line": 677, | ||
"description": "执行Javascript脚本", | ||
@@ -635,3 +635,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 706, | ||
"line": 708, | ||
"description": "获取弹出窗口的文本(alert, confirm, prompt)", | ||
@@ -650,3 +650,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 716, | ||
"line": 718, | ||
"description": "输入prompt中的值", | ||
@@ -665,3 +665,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 728, | ||
"line": 730, | ||
"description": "关闭弹出窗口", | ||
@@ -688,3 +688,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 741, | ||
"line": 743, | ||
"description": "获取或保存当前网页截图\n<p>\nfilePath为可选项,若有则保存到文件\n</p>", | ||
@@ -711,3 +711,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 759, | ||
"line": 761, | ||
"description": "获取按键映射后的字符数组", | ||
@@ -733,3 +733,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 774, | ||
"line": 776, | ||
"description": "发送按键序列到当前焦点对象上", | ||
@@ -755,3 +755,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 787, | ||
"line": 789, | ||
"description": "在当前光标处触发单击事件", | ||
@@ -777,3 +777,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 806, | ||
"line": 808, | ||
"description": "在当前光标处触发双击事件", | ||
@@ -792,3 +792,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 818, | ||
"line": 820, | ||
"description": "在当前光标处触发鼠标左键按下", | ||
@@ -807,3 +807,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 830, | ||
"line": 832, | ||
"description": "移动到指定对象中间或坐标点", | ||
@@ -834,3 +834,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 859, | ||
"line": 861, | ||
"description": "在当前光标处触发鼠标左键按起", | ||
@@ -849,3 +849,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 871, | ||
"line": 873, | ||
"description": "拖放", | ||
@@ -876,3 +876,3 @@ "itemtype": "method", | ||
"file": "lib\\browser.js", | ||
"line": 885, | ||
"line": 887, | ||
"description": "等待对象出现或消失", | ||
@@ -879,0 +879,0 @@ "itemtype": "method", |
jWebDriver change logs | ||
==================== | ||
## ver 0.9.3 (2013-1-3) | ||
## ver 0.9.3 (2013-1-6) | ||
fix: | ||
1. fix waitFor: browser.waitFor('#id', false, 60000) | ||
1. fix: waitFor: browser.waitFor('#id', false, 60000) | ||
2. fix: remove proxy from default config | ||
3. fix: can't work with selenium server 2.28 | ||
4. fix: close nodejs agent for http | ||
## ver 0.9.2 (2012-11-21) | ||
@@ -31,2 +35,3 @@ | ||
## ver 0.9.1 (2012-11-4) | ||
@@ -33,0 +38,0 @@ |
@@ -9,3 +9,3 @@ var JWebDriver = require('../'); | ||
var wd = new JWebDriver({'browserName':'chrome'}); | ||
var wd = new JWebDriver({'browserName':'firefox'}); | ||
@@ -12,0 +12,0 @@ wd.run(function(browser, $){ |
@@ -68,7 +68,3 @@ /** | ||
'version': '', | ||
'platform': 'ANY', | ||
'javascriptEnabled': true, | ||
'proxy': { | ||
'proxyType': 'direct' | ||
} | ||
'platform': 'ANY' | ||
} | ||
@@ -223,3 +219,3 @@ | ||
isError: function(result){ | ||
var status = result.status; | ||
var status = result && result.status; | ||
return status !== undefined && status !== 0; | ||
@@ -344,8 +340,21 @@ }, | ||
requestOptions.headers = { | ||
'content-type': 'application/json', | ||
'charset': 'charset=UTF-8', | ||
'content-length': data.length | ||
'Accept': 'application/json; charset=utf-8', | ||
'Content-Type': 'application/json;charset=UTF-8', | ||
'Content-Length': data.length | ||
} | ||
requestOptions.agent = false; | ||
var req = http.request(requestOptions, function(res){ | ||
if ( /^302|303$/.test(res.statusCode) && self.sessionId === null) { | ||
try{ | ||
var match = res.headers.location.match(/wd\/hub\/session\/(.+)$/i); | ||
if(match !== null){ | ||
self.sessionId = match[1]; | ||
self.log('RESULT', self.sessionId); | ||
} | ||
} | ||
catch(e){ | ||
} | ||
return doCallback(''); | ||
} | ||
var arrResBuffers = [], resBufferSize = 0; | ||
@@ -363,19 +372,3 @@ res.on('data', function (data) { | ||
responseStr = resBuffer.toString('utf-8'); | ||
if(self.sessionId === null){ | ||
try{ | ||
var match = res.headers.location.match(/wd\/hub\/session\/(\d+)$/i); | ||
if(match !== null){ | ||
self.sessionId = match[1]; | ||
self.log('RESULT', self.sessionId); | ||
} | ||
} | ||
catch(e){ | ||
} | ||
} | ||
if(callback){//异步模式 | ||
callback(responseStr); | ||
} | ||
else if(fiber){//同步模式 | ||
fiber.run(); | ||
} | ||
doCallback(responseStr); | ||
}); | ||
@@ -394,2 +387,11 @@ }); | ||
function doCallback(data){ | ||
if(callback){//异步模式 | ||
callback(data); | ||
} | ||
else if(fiber){//同步模式 | ||
fiber.run(); | ||
} | ||
} | ||
if(callback === undefined && fiber){ | ||
@@ -941,4 +943,2 @@ Fiber.yield(); | ||
_timer2 = setTimeout(function(){ | ||
clearTimeout(_timer1); | ||
_timer1 = null; | ||
self.log('ERROR', 'waitFor timeout: ' + using + ' , ' + value); | ||
@@ -945,0 +945,0 @@ //标记超时,getElement返回时结束当前等待请求 |
@@ -18,3 +18,3 @@ /** | ||
* kw.val('mp3').submit(); | ||
* browser.close(); | ||
* browser.end(); | ||
* }); | ||
@@ -21,0 +21,0 @@ * </pre> |
{ | ||
"name": "jwebdriver", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "A webdriver client for node.js", | ||
@@ -5,0 +5,0 @@ "main": "./index", |
@@ -58,3 +58,3 @@ jWebDriver | ||
browser.sleep(1000); | ||
browser.close(); | ||
browser.end(); | ||
}); | ||
@@ -61,0 +61,0 @@ |
@@ -12,3 +12,3 @@ | ||
runBrowserTest('firefox'); | ||
runBrowserTest('ie'); | ||
// runBrowserTest('ie'); | ||
@@ -15,0 +15,0 @@ function runBrowserTest(browserName){ |
@@ -12,3 +12,3 @@ | ||
runBrowserTest('firefox'); | ||
runBrowserTest('ie'); | ||
// runBrowserTest('ie'); | ||
@@ -15,0 +15,0 @@ function runBrowserTest(browserName){ |
{ | ||
"name": "jWebDriver API", | ||
"description": "A webdriver client for Node.js", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"url": "http://yaniswang.com/jwebdriver/", | ||
@@ -6,0 +6,0 @@ "logo": "https://raw.github.com/yaniswang/jWebDriver/master/logo_s.png", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
691593
4440