Skip to content

Commit 18f77ac

Browse files
committed
atoms: reorder enums and correct docs
1 parent a286dfa commit 18f77ac

File tree

1 file changed

+35
-37
lines changed

1 file changed

+35
-37
lines changed

Diff for: javascript/atoms/error.js

+35-37
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,40 @@ goog.provide('bot.ErrorCode');
2525

2626

2727
/**
28-
* Error codes from the WebDriver wire protocol:
28+
* Status strings enumerated in the W3C WebDriver protocol.
29+
* @enum {string}
30+
* @see https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors
31+
*/
32+
bot.Error.State = {
33+
ELEMENT_NOT_SELECTABLE: 'element not selectable',
34+
ELEMENT_NOT_VISIBLE: 'element not visible',
35+
INVALID_ARGUMENT: 'invalid argument',
36+
INVALID_COOKIE_DOMAIN: 'invalid cookie domain',
37+
INVALID_ELEMENT_COORDINATES: 'invalid element coordinates',
38+
INVALID_ELEMENT_STATE: 'invalid element state',
39+
INVALID_SELECTOR: 'invalid selector',
40+
INVALID_SESSION_ID: 'invalid session id',
41+
JAVASCRIPT_ERROR: 'javascript error',
42+
MOVE_TARGET_OUT_OF_BOUNDS: 'move target out of bounds',
43+
NO_SUCH_ALERT: 'no such alert',
44+
NO_SUCH_ELEMENT: 'no such element',
45+
NO_SUCH_FRAME: 'no such frame',
46+
NO_SUCH_WINDOW: 'no such window',
47+
SCRIPT_TIMEOUT: 'script timeout',
48+
SESSION_NOT_CREATED: 'session not created',
49+
STALE_ELEMENT_REFERENCE: 'stale element reference',
50+
TIMEOUT: 'timeout',
51+
UNABLE_TO_SET_COOKIE: 'unable to set cookie',
52+
UNEXPECTED_ALERT_OPEN: 'unexpected alert open',
53+
UNKNOWN_COMMAND: 'unknown command',
54+
UNKNOWN_ERROR: 'unknown error',
55+
UNKNOWN_METHOD: 'unknown method',
56+
UNSUPPORTED_OPERATION: 'unsupported operation'
57+
};
58+
59+
60+
/**
61+
* Error codes from the Selenium WebDriver protocol:
2962
* https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#response-status-codes
3063
*
3164
* @enum {number}
@@ -66,9 +99,7 @@ bot.ErrorCode = {
6699

67100

68101
/**
69-
* Error extension that includes error status codes from the WebDriver wire
70-
* protocol:
71-
* https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#response-status-codes
102+
* Represents an error returned from a WebDriver command request.
72103
*
73104
* @param {!bot.ErrorCode} code The error's status code.
74105
* @param {string=} opt_message Optional error message.
@@ -116,39 +147,6 @@ bot.Error = function(code, opt_message) {
116147
goog.inherits(bot.Error, Error);
117148

118149

119-
/**
120-
* Status strings enumerated in the W3C WebDriver working draft.
121-
* @enum {string}
122-
* @see http://www.w3.org/TR/webdriver/#status-codes
123-
*/
124-
bot.Error.State = {
125-
ELEMENT_NOT_SELECTABLE: 'element not selectable',
126-
ELEMENT_NOT_VISIBLE: 'element not visible',
127-
INVALID_ARGUMENT: 'invalid argument',
128-
INVALID_COOKIE_DOMAIN: 'invalid cookie domain',
129-
INVALID_ELEMENT_COORDINATES: 'invalid element coordinates',
130-
INVALID_ELEMENT_STATE: 'invalid element state',
131-
INVALID_SELECTOR: 'invalid selector',
132-
INVALID_SESSION_ID: 'invalid session id',
133-
JAVASCRIPT_ERROR: 'javascript error',
134-
MOVE_TARGET_OUT_OF_BOUNDS: 'move target out of bounds',
135-
NO_SUCH_ALERT: 'no such alert',
136-
NO_SUCH_ELEMENT: 'no such element',
137-
NO_SUCH_FRAME: 'no such frame',
138-
NO_SUCH_WINDOW: 'no such window',
139-
SCRIPT_TIMEOUT: 'script timeout',
140-
SESSION_NOT_CREATED: 'session not created',
141-
STALE_ELEMENT_REFERENCE: 'stale element reference',
142-
TIMEOUT: 'timeout',
143-
UNABLE_TO_SET_COOKIE: 'unable to set cookie',
144-
UNEXPECTED_ALERT_OPEN: 'unexpected alert open',
145-
UNKNOWN_COMMAND: 'unknown command',
146-
UNKNOWN_ERROR: 'unknown error',
147-
UNKNOWN_METHOD: 'unknown method',
148-
UNSUPPORTED_OPERATION: 'unsupported operation'
149-
};
150-
151-
152150
/**
153151
* A map of error codes to state string.
154152
* @private {!Object.<bot.ErrorCode, bot.Error.State>}

0 commit comments

Comments
 (0)