@appium/base-driver 9.16.2 → 9.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +0,0 @@
1
- ## jsonwp-status
2
-
3
- Library of status codes for the Selenium [JSON Wire Protocol](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md).
4
-
5
-
6
- ### Usage
7
-
8
- ```
9
- import { statusCodes } from 'appium-base-driver';
10
-
11
- statusCodes.NoSuchContext;
12
- // -> {code: 35, summary: 'No such context found'}
13
- ```
14
-
15
- ```
16
- import { getSummaryByCode } from 'appium-base-driver';
17
-
18
- getSummaryByCode(0);
19
- // -> 'The command executed successfully.'
20
- ```
@@ -1,100 +0,0 @@
1
- ## webdriver and mobile-json-wire protocols
2
-
3
- An abstraction of the Mobile JSON Wire Protocol ([spec](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md)) and the W3C Wire Protocol ([spec](https://www.w3.org/TR/webdriver/) with Appium extensions (as specified [here](http://www.w3.org/TR/webdriver/#protocol-extensions)).
4
-
5
- ### Protocol Detection
6
-
7
- In the event that a session is requested, and both MJSONWP _and_ W3C capabilities are provided, like this
8
-
9
- ```
10
- {
11
- "capabilities: {
12
- "alwaysMatch": {...},
13
- "firstMatch": [{...}, ...]
14
- },
15
- "desiredCapabilities": {...}
16
- }
17
- ```
18
-
19
- a W3C session will be served _unless_ the W3C Capabilities are incomplete. So if the `"desiredCapabilities"` object has more keys
20
- then whatever the capabilities were matched for the W3C capabilities, then an MJSONWP session will be served instead
21
-
22
-
23
- ### Endpoints in the protocol
24
-
25
- The Mobile JSON Wire Protocol package gives access to a number of endpoints documented [here](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md).
26
-
27
- The W3C WebDriver Protocol package gives access to a number of endpoints documented in the [official documentation](https://www.w3.org/TR/webdriver/) and the
28
- [simplified spec](https://github.com/jlipps/simple-wd-spec)
29
-
30
- ### Protocol
31
-
32
- The basic class, subclassed by drivers that will use the protocol.
33
-
34
-
35
- ### routeConfiguringFunction (driver)
36
-
37
- This function gives drivers access to the protocol routes. It returns a function that itself will take an [Express](http://expressjs.com/) application.
38
-
39
-
40
- ### isSessionCommand (command)
41
-
42
- Checks if the `command` needs to have a session associated with it.
43
-
44
-
45
- ### ALL_COMMANDS
46
-
47
- An array of all the commands that will be dispatched to by the Mobile JSON Wire Proxy endpoints.
48
-
49
-
50
- ### NO_SESSION_ID_COMMANDS
51
-
52
- An array of commands that do not need a session associated with them.
53
-
54
-
55
- ### Errors
56
-
57
- This package exports a number of classes and methods related to Selenium error handling. There are error classes for each Selenium error type (see [JSONWP Errors](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Response_Status_Codes), as well as the context errors in the [mobile spec](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts).
58
-
59
- The list of errors, and their meanings, can be found [here for JSONWP](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/errors.md) and
60
- [here for W3C Errors](https://www.w3.org/TR/webdriver/#handling-errors))
61
-
62
- There are, in addition, two helper methods for dealing with errors
63
-
64
- `isErrorType (err, type)`
65
-
66
- - checks if the `err` object is a Mobile JSON Wire Protocol error of a particular type
67
- - arguments
68
- - `err` - the error object to test
69
- - `type` - the error class to test against
70
- - usage
71
- ```js
72
- import { errors, isErrorType } from 'mobile-json-wire-protocol';
73
-
74
- try {
75
- // do some stuff...
76
- } catch (err) {
77
- if (isErrorType(err, errors.InvalidCookieDomainError)) {
78
- // process...
79
- }
80
- }
81
- ```
82
-
83
- `errorFromCode (code, message)`
84
-
85
- - retrieve the appropriate error for an error code, with the supplied message.
86
- - arguments
87
- - `code` - the integer error code for a Mobile JSON Wire Protocol error
88
- - `message` - the message to be encapsulated in the error
89
- - usage
90
- ```js
91
- import { errors, errorFromCode } from 'mobile-json-wire-protocol';
92
-
93
- let error = errorFromCode(6, 'an error has occurred');
94
-
95
- console.log(error instanceof errors.NoSuchDriverError);
96
- // => true
97
-
98
- console.log(error.message === 'an error has occurred');
99
- // => true
100
- ```