@wdio/protocols 6.1.14 → 6.6.0

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.
package/index.d.ts ADDED
@@ -0,0 +1,85 @@
1
+ declare namespace WDIOProtocols {
2
+ type CommandPath = 'string'
3
+ type CommandMethod = 'POST' | 'GET' | 'DELETE'
4
+ type Protocol = Record<CommandPath, Record<CommandMethod, CommandEndpoint>>
5
+
6
+ /**
7
+ * describes a command endpoint
8
+ */
9
+ interface CommandEndpoint {
10
+ /**
11
+ * command name
12
+ */
13
+ command: string
14
+ /**
15
+ * command description
16
+ */
17
+ description: string
18
+ /**
19
+ * link to specification reference
20
+ */
21
+ ref: URL
22
+ /**
23
+ * supported command parameters
24
+ */
25
+ parameters: CommandParameters[]
26
+ /**
27
+ * variables within the command path (e.g. /:sessionId/element)
28
+ */
29
+ variables?: CommandPathVariables[]
30
+ /**
31
+ * supported environments
32
+ */
33
+ support?: SupportedEnvironments
34
+ /**
35
+ * set to true if command is only supported in Selenium Hub Node
36
+ */
37
+ isHubCommand?: boolean,
38
+ /**
39
+ * information on return data
40
+ */
41
+ returns?: CommandReturnObject
42
+ }
43
+
44
+ interface CommandReturnObject {
45
+ type: string
46
+ name: string
47
+ description: string
48
+ }
49
+
50
+ interface CommandPathVariables {
51
+ name: string
52
+ description: string
53
+ }
54
+
55
+ interface CommandParameters {
56
+ name: string,
57
+ type: string,
58
+ description: string,
59
+ required: boolean
60
+ }
61
+
62
+ type Platform = 'ios' | 'android'
63
+ type Environments = 'XCUITest' | 'UIAutomation' | 'UiAutomator'
64
+
65
+ /**
66
+ * supported mobile environments, e.g.
67
+ * ```
68
+ * "ios": {
69
+ * "UIAutomation": "8.0 to 9.3"
70
+ * }
71
+ * ```
72
+ */
73
+ type SupportedEnvironments = Record<Platform, Record<Environments, string>>
74
+ }
75
+
76
+ declare module "@wdio/protocols" {
77
+ export default WDIOProtocols
78
+ export const WebDriverProtocol: WDIOProtocols.Protocol
79
+ export const MJsonWProtocol: WDIOProtocols.Protocol
80
+ export const JsonWProtocol: WDIOProtocols.Protocol
81
+ export const AppiumProtocol: WDIOProtocols.Protocol
82
+ export const ChromiumProtocol: WDIOProtocols.Protocol
83
+ export const SauceLabsProtocol: WDIOProtocols.Protocol
84
+ export const SeleniumProtocol: WDIOProtocols.Protocol
85
+ }
package/package.json CHANGED
@@ -1,19 +1,15 @@
1
1
  {
2
2
  "name": "@wdio/protocols",
3
- "version": "6.1.14",
3
+ "version": "6.6.0",
4
4
  "description": "Utility package providing information about automation protocols",
5
5
  "author": "Christian Bromann <christian@saucelabs.com>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/master/packages/wdio-protocols",
7
7
  "license": "MIT",
8
8
  "main": "./index",
9
+ "types": "./index.d.ts",
9
10
  "engines": {
10
11
  "node": ">=10.0.0"
11
12
  },
12
- "scripts": {
13
- "compile": "echo \"nothing to compile\"",
14
- "build": "echo \"nothing to build\"",
15
- "test": "echo \"run json linting tests\""
16
- },
17
13
  "repository": {
18
14
  "type": "git",
19
15
  "url": "git://github.com/webdriverio/webdriverio.git"
@@ -28,5 +24,5 @@
28
24
  "publishConfig": {
29
25
  "access": "public"
30
26
  },
31
- "gitHead": "1db0b8de0f2efd9e63bf76b01fe01f7e9985f03f"
27
+ "gitHead": "643b1f237c0c7e4eb0e28fca31d963d3b19a073c"
32
28
  }
@@ -49,7 +49,7 @@
49
49
  "required": true
50
50
  }],
51
51
  "returns": {
52
- "type": "Object",
52
+ "type": "object",
53
53
  "name": "log",
54
54
  "description": "log output of desired type (see example)"
55
55
  }
@@ -178,7 +178,7 @@
178
178
  "required": false
179
179
  }],
180
180
  "returns": {
181
- "type": "Object",
181
+ "type": "object",
182
182
  "name": "hasRegression",
183
183
  "description": "An object containing the result as well as metrics about the result."
184
184
  }
@@ -198,10 +198,78 @@
198
198
  ],
199
199
  "parameters": [],
200
200
  "returns": {
201
- "type": "Object",
201
+ "type": "object",
202
202
  "name": "testResults",
203
203
  "description": "An object containing the score as well as metrics around how smooth the UX of the page was during the test."
204
204
  }
205
205
  }
206
+ },
207
+ "/session/:sessionId/sauce/ondemand/mock": {
208
+ "POST": {
209
+ "command": "mockRequest",
210
+ "description": "Mocks a network resource.",
211
+ "ref": "https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands",
212
+ "parameters": [{
213
+ "name": "url",
214
+ "type": "string",
215
+ "description": "URL glob to match url to mock.",
216
+ "required": true
217
+ }, {
218
+ "name": "filterOptions",
219
+ "description": "Additional filter options for url to mock (e.g. headers, method).",
220
+ "type": "object",
221
+ "required": false
222
+ }],
223
+ "returns": {
224
+ "type": "object",
225
+ "name": "mockId",
226
+ "description": "An object containing the id of a mock resource."
227
+ }
228
+ }
229
+ },
230
+ "/session/:sessionId/sauce/ondemand/mock/:mockId": {
231
+ "GET": {
232
+ "command": "getMockCalls",
233
+ "description": "Receive request information about requests that match the mocked resource.",
234
+ "ref": "https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands",
235
+ "variables": [{
236
+ "name": "mockId",
237
+ "description": "the id of a mock"
238
+ }],
239
+ "parameters": [],
240
+ "returns": {
241
+ "type": "object",
242
+ "name": "requests",
243
+ "description": "A list of request information."
244
+ }
245
+ },
246
+ "DELETE": {
247
+ "command": "clearMockCalls",
248
+ "description": "Clear list of mock calls.",
249
+ "ref": "https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands",
250
+ "variables": [{
251
+ "name": "mockId",
252
+ "description": "the id of a mock"
253
+ }],
254
+ "parameters": [{
255
+ "type": "boolean",
256
+ "name": "restore",
257
+ "description": "Set to true if mock should be restored as well."
258
+ }]
259
+ },
260
+ "POST": {
261
+ "command": "respondMock",
262
+ "description": "Respond if mock matches a specific resource.",
263
+ "ref": "https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands",
264
+ "variables": [{
265
+ "name": "mockId",
266
+ "description": "the id of a mock"
267
+ }],
268
+ "parameters": [{
269
+ "type": "object",
270
+ "name": "payload",
271
+ "description": "Information on mock response."
272
+ }]
273
+ }
206
274
  }
207
275
  }
@@ -730,7 +730,7 @@
730
730
  "ref": "https://w3c.github.io/webdriver/#dfn-delete-cookie",
731
731
  "variables": [{
732
732
  "name": "name",
733
- "description": "name of the cookie to retrieve"
733
+ "description": "name of the cookie to delete"
734
734
  }],
735
735
  "parameters": []
736
736
  }