selenium-webdriver
Advanced tools
Comparing version 2.32.1 to 2.33.0
@@ -0,1 +1,6 @@ | ||
## v2.33.0 | ||
* Added support for WebDriver's logging API | ||
* FIXED: 5511: Added webdriver.manage().timeouts().pageLoadTimeout(ms) | ||
## v2.32.1 | ||
@@ -2,0 +7,0 @@ |
@@ -52,2 +52,3 @@ // Copyright 2012 Selenium committers | ||
http: require('./http'), | ||
logging: base.exportPublicApi('webdriver.logging'), | ||
promise: base.exportPublicApi('webdriver.promise'), | ||
@@ -54,0 +55,0 @@ stacktrace: base.exportPublicApi('webdriver.stacktrace') |
@@ -24,5 +24,3 @@ // Copyright 2010 WebDriver committers | ||
goog.require('goog.object'); | ||
/** | ||
@@ -61,3 +59,7 @@ * Error codes from the WebDriver wire protocol: | ||
MOVE_TARGET_OUT_OF_BOUNDS: 34, | ||
SQL_DATABASE_ERROR: 35 | ||
SQL_DATABASE_ERROR: 35, | ||
INVALID_XPATH_SELECTOR: 51, | ||
INVALID_XPATH_SELECTOR_RETURN_TYPE: 52, | ||
// The following error codes are derived straight from HTTP return codes. | ||
METHOD_NOT_ALLOWED: 405 | ||
}; | ||
@@ -85,8 +87,22 @@ | ||
/** @type {string} */ | ||
this.state = | ||
bot.Error.CODE_TO_STATE_[code] || bot.Error.State.UNKNOWN_ERROR; | ||
/** @override */ | ||
this.message = opt_message || ''; | ||
var name = this.state.replace(/((?:^|\s+)[a-z])/g, function(str) { | ||
// IE<9 does not support String#trim(). Also, IE does not include 0xa0 | ||
// (the non-breaking-space) in the \s character class, so we have to | ||
// explicitly include it. | ||
return str.toUpperCase().replace(/^[\s\xa0]+/g, ''); | ||
}); | ||
var l = name.length - 'Error'.length; | ||
if (l < 0 || name.indexOf('Error', l) != l) { | ||
name += 'Error'; | ||
} | ||
/** @override */ | ||
this.name = (/**@type {string}*/ bot.Error.NAMES_[code] || | ||
bot.Error.NAMES_[bot.ErrorCode.UNKNOWN_ERROR]); | ||
this.name = name; | ||
@@ -105,28 +121,75 @@ // Generate a stacktrace for our custom error; ensure the error has our | ||
/** | ||
* A map of error codes to error names. | ||
* @const | ||
* @private {!Object.<string>} | ||
* Status strings enumerated in the W3C WebDriver working draft. | ||
* @enum {string} | ||
* @see http://www.w3.org/TR/webdriver/#status-codes | ||
*/ | ||
bot.Error.NAMES_ = goog.object.create( | ||
bot.ErrorCode.NO_SUCH_ELEMENT, 'NoSuchElementError', | ||
bot.ErrorCode.NO_SUCH_FRAME, 'NoSuchFrameError', | ||
bot.ErrorCode.UNKNOWN_COMMAND, 'UnknownCommandError', | ||
bot.ErrorCode.STALE_ELEMENT_REFERENCE, 'StaleElementReferenceError', | ||
bot.ErrorCode.ELEMENT_NOT_VISIBLE, 'ElementNotVisibleError', | ||
bot.ErrorCode.INVALID_ELEMENT_STATE, 'InvalidElementStateError', | ||
bot.ErrorCode.UNKNOWN_ERROR, 'UnknownError', | ||
bot.ErrorCode.ELEMENT_NOT_SELECTABLE, 'ElementNotSelectableError', | ||
bot.ErrorCode.XPATH_LOOKUP_ERROR, 'XPathLookupError', | ||
bot.ErrorCode.NO_SUCH_WINDOW, 'NoSuchWindowError', | ||
bot.ErrorCode.INVALID_COOKIE_DOMAIN, 'InvalidCookieDomainError', | ||
bot.ErrorCode.UNABLE_TO_SET_COOKIE, 'UnableToSetCookieError', | ||
bot.ErrorCode.MODAL_DIALOG_OPENED, 'ModalDialogOpenedError', | ||
bot.ErrorCode.NO_MODAL_DIALOG_OPEN, 'NoModalDialogOpenError', | ||
bot.ErrorCode.SCRIPT_TIMEOUT, 'ScriptTimeoutError', | ||
bot.ErrorCode.INVALID_SELECTOR_ERROR, 'InvalidSelectorError', | ||
bot.ErrorCode.SQL_DATABASE_ERROR, 'SqlDatabaseError', | ||
bot.ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS, 'MoveTargetOutOfBoundsError'); | ||
bot.Error.State = { | ||
ELEMENT_NOT_SELECTABLE: 'element not selectable', | ||
ELEMENT_NOT_VISIBLE: 'element not visible', | ||
IME_ENGINE_ACTIVATION_FAILED: 'ime engine activation failed', | ||
IME_NOT_AVAILABLE: 'ime not available', | ||
INVALID_COOKIE_DOMAIN: 'invalid cookie domain', | ||
INVALID_ELEMENT_COORDINATES: 'invalid element coordinates', | ||
INVALID_ELEMENT_STATE: 'invalid element state', | ||
INVALID_SELECTOR: 'invalid selector', | ||
JAVASCRIPT_ERROR: 'javascript error', | ||
MOVE_TARGET_OUT_OF_BOUNDS: 'move target out of bounds', | ||
NO_SUCH_ALERT: 'no such alert', | ||
NO_SUCH_DOM: 'no such dom', | ||
NO_SUCH_ELEMENT: 'no such element', | ||
NO_SUCH_FRAME: 'no such frame', | ||
NO_SUCH_WINDOW: 'no such window', | ||
SCRIPT_TIMEOUT: 'script timeout', | ||
SESSION_NOT_CREATED: 'session not created', | ||
STALE_ELEMENT_REFERENCE: 'stale element reference', | ||
SUCCESS: 'success', | ||
TIMEOUT: 'timeout', | ||
UNABLE_TO_SET_COOKIE: 'unable to set cookie', | ||
UNEXPECTED_ALERT_OPEN: 'unexpected alert open', | ||
UNKNOWN_COMMAND: 'unknown command', | ||
UNKNOWN_ERROR: 'unknown error', | ||
UNSUPPORTED_OPERATION: 'unsupported operation' | ||
}; | ||
/** | ||
* A map of error codes to state string. | ||
* @private {!Object.<bot.ErrorCode, bot.Error.State>} | ||
*/ | ||
bot.Error.CODE_TO_STATE_ = {}; | ||
goog.scope(function() { | ||
var map = bot.Error.CODE_TO_STATE_; | ||
var code = bot.ErrorCode; | ||
var state = bot.Error.State; | ||
map[code.ELEMENT_NOT_SELECTABLE] = state.ELEMENT_NOT_SELECTABLE; | ||
map[code.ELEMENT_NOT_VISIBLE] = state.ELEMENT_NOT_VISIBLE; | ||
map[code.IME_ENGINE_ACTIVATION_FAILED] = state.IME_ENGINE_ACTIVATION_FAILED; | ||
map[code.IME_NOT_AVAILABLE] = state.IME_NOT_AVAILABLE; | ||
map[code.INVALID_COOKIE_DOMAIN] = state.INVALID_COOKIE_DOMAIN; | ||
map[code.INVALID_ELEMENT_COORDINATES] = state.INVALID_ELEMENT_COORDINATES; | ||
map[code.INVALID_ELEMENT_STATE] = state.INVALID_ELEMENT_STATE; | ||
map[code.INVALID_SELECTOR_ERROR] = state.INVALID_SELECTOR; | ||
map[code.INVALID_XPATH_SELECTOR] = state.INVALID_SELECTOR; | ||
map[code.INVALID_XPATH_SELECTOR_RETURN_TYPE] = state.INVALID_SELECTOR; | ||
map[code.JAVASCRIPT_ERROR] = state.JAVASCRIPT_ERROR; | ||
map[code.METHOD_NOT_ALLOWED] = state.UNSUPPORTED_OPERATION; | ||
map[code.MOVE_TARGET_OUT_OF_BOUNDS] = state.MOVE_TARGET_OUT_OF_BOUNDS; | ||
map[code.NO_MODAL_DIALOG_OPEN] = state.NO_SUCH_ALERT; | ||
map[code.NO_SUCH_ELEMENT] = state.NO_SUCH_ELEMENT; | ||
map[code.NO_SUCH_FRAME] = state.NO_SUCH_FRAME; | ||
map[code.NO_SUCH_WINDOW] = state.NO_SUCH_WINDOW; | ||
map[code.SCRIPT_TIMEOUT] = state.SCRIPT_TIMEOUT; | ||
map[code.SESSION_NOT_CREATED] = state.SESSION_NOT_CREATED; | ||
map[code.STALE_ELEMENT_REFERENCE] = state.STALE_ELEMENT_REFERENCE; | ||
map[code.SUCCESS] = state.SUCCESS; | ||
map[code.TIMEOUT] = state.TIMEOUT; | ||
map[code.UNABLE_TO_SET_COOKIE] = state.UNABLE_TO_SET_COOKIE; | ||
map[code.MODAL_DIALOG_OPENED] = state.UNEXPECTED_ALERT_OPEN; | ||
map[code.UNKNOWN_ERROR] = state.UNKNOWN_ERROR; | ||
map[code.UNSUPPORTED_OPERATION] = state.UNKNOWN_COMMAND; | ||
}); // goog.scope | ||
/** | ||
* Flag used for duck-typing when this code is embedded in a Firefox extension. | ||
@@ -133,0 +196,0 @@ * This is required since an Error thrown in one component and then reported |
// This file has been auto-generated; do not edit by hand | ||
goog.addDependency("object/object.js", ["goog.object"], []); | ||
goog.addDependency("../atoms/error.js", ["bot.Error","bot.ErrorCode"], ["goog.object"]); | ||
goog.addDependency("../atoms/error.js", ["bot.Error","bot.ErrorCode"], []); | ||
goog.addDependency("../atoms/userAgent.js", ["bot.userAgent"], ["goog.string","goog.userAgent","goog.userAgent.product","goog.userAgent.product.isVersion"]); | ||
@@ -16,2 +15,3 @@ goog.addDependency("string/string.js", ["goog.string","goog.string.Unicode"], []); | ||
goog.addDependency("structs/structs.js", ["goog.structs"], ["goog.array","goog.object"]); | ||
goog.addDependency("object/object.js", ["goog.object"], []); | ||
goog.addDependency("structs/map.js", ["goog.structs.Map"], ["goog.iter.Iterator","goog.iter.StopIteration","goog.object","goog.structs"]); | ||
@@ -26,3 +26,3 @@ goog.addDependency("iter/iter.js", ["goog.iter","goog.iter.Iterator","goog.iter.StopIteration"], ["goog.array","goog.asserts"]); | ||
goog.addDependency("../atoms/response.js", ["bot.response","bot.response.ResponseObject"], ["bot.Error","bot.ErrorCode"]); | ||
goog.addDependency("../webdriver/webdriver.js", ["webdriver.Alert","webdriver.UnhandledAlertError","webdriver.WebDriver","webdriver.WebElement"], ["bot.Error","bot.ErrorCode","bot.response","goog.array","goog.object","webdriver.ActionSequence","webdriver.Command","webdriver.CommandName","webdriver.Key","webdriver.Locator","webdriver.Session","webdriver.promise"]); | ||
goog.addDependency("../webdriver/webdriver.js", ["webdriver.Alert","webdriver.UnhandledAlertError","webdriver.WebDriver","webdriver.WebElement"], ["bot.Error","bot.ErrorCode","bot.response","goog.array","goog.object","webdriver.ActionSequence","webdriver.Command","webdriver.CommandName","webdriver.Key","webdriver.Locator","webdriver.Session","webdriver.logging","webdriver.promise"]); | ||
goog.addDependency("../webdriver/actionsequence.js", ["webdriver.ActionSequence"], ["goog.array","webdriver.Button","webdriver.Command","webdriver.CommandName","webdriver.Key"]); | ||
@@ -32,2 +32,3 @@ goog.addDependency("../webdriver/locators.js", ["webdriver.Locator","webdriver.Locator.Strategy"], ["bot.json","goog.object"]); | ||
goog.addDependency("../webdriver/session.js", ["webdriver.Session"], []); | ||
goog.addDependency("../webdriver/logging.js", ["webdriver.logging"], ["goog.object"]); | ||
goog.addDependency("../webdriver/promise.js", ["webdriver.promise","webdriver.promise.ControlFlow","webdriver.promise.Deferred","webdriver.promise.Promise"], ["goog.array","goog.object","webdriver.EventEmitter","webdriver.stacktrace.Snapshot"]); | ||
@@ -34,0 +35,0 @@ goog.addDependency("../webdriver/events.js", ["webdriver.EventEmitter"], []); |
@@ -165,2 +165,3 @@ // Copyright 2011 Software Freedom Conservancy. All Rights Reserved. | ||
SET_SCRIPT_TIMEOUT: 'setScriptTimeout', | ||
SET_TIMEOUT: 'setTimeout', | ||
@@ -217,3 +218,5 @@ ACCEPT_ALERT: 'acceptAlert', | ||
GET_LOGS: 'getLogs' | ||
GET_AVAILABLE_LOG_TYPES: 'getAvailableLogTypes', | ||
GET_LOG: 'getLog', | ||
GET_SESSION_LOGS: 'getSessionLogs' | ||
}; | ||
@@ -220,0 +223,0 @@ |
@@ -266,2 +266,4 @@ // Copyright 2011 Software Freedom Conservancy. All Rights Reserved. | ||
get('/session/:sessionId/screenshot')). | ||
put(webdriver.CommandName.SET_TIMEOUT, | ||
post('/session/:sessionId/timeouts')). | ||
put(webdriver.CommandName.SET_SCRIPT_TIMEOUT, | ||
@@ -289,2 +291,6 @@ post('/session/:sessionId/timeouts/async_script')). | ||
post('/session/:sessionId/alert_text')). | ||
put(webdriver.CommandName.GET_LOG, post('/session/:sessionId/log')). | ||
put(webdriver.CommandName.GET_AVAILABLE_LOG_TYPES, | ||
get('/session/:sessionId/log/types')). | ||
put(webdriver.CommandName.GET_SESSION_LOGS, post('/logs')). | ||
build(); | ||
@@ -291,0 +297,0 @@ |
{ | ||
"name": "selenium-webdriver", | ||
"version": "2.32.1", | ||
"version": "2.33.0", | ||
"description": "The official WebDriver JavaScript bindings from the Selenium project", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
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
657735
55
16908