@wdio/protocols 6.6.0 → 6.12.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 CHANGED
@@ -18,7 +18,7 @@ declare namespace WDIOProtocols {
18
18
  /**
19
19
  * link to specification reference
20
20
  */
21
- ref: URL
21
+ ref: string
22
22
  /**
23
23
  * supported command parameters
24
24
  */
@@ -50,6 +50,13 @@ declare namespace WDIOProtocols {
50
50
  interface CommandPathVariables {
51
51
  name: string
52
52
  description: string
53
+
54
+ /**
55
+ * the following are given for path variables, we should still define
56
+ * it as values are populated automatically
57
+ */
58
+ required?: boolean
59
+ type?: string
53
60
  }
54
61
 
55
62
  interface CommandParameters {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/protocols",
3
- "version": "6.6.0",
3
+ "version": "6.12.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",
@@ -24,5 +24,5 @@
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  },
27
- "gitHead": "643b1f237c0c7e4eb0e28fca31d963d3b19a073c"
27
+ "gitHead": "e8bae1e8becee38ee362989dc91bdd0c831512e9"
28
28
  }
@@ -252,23 +252,6 @@
252
252
  }
253
253
  }
254
254
  },
255
- "/session/:sessionId/reporting/generate_test_report": {
256
- "POST": {
257
- "command": "generateTestReport",
258
- "description": "Generates a report for testing. Extension for [Reporting API](https://developers.google.com/web/updates/2018/09/reportingapi).",
259
- "ref": "https://w3c.github.io/reporting/#generate-test-report-command",
260
- "parameters": [{
261
- "name": "message",
262
- "type": "string",
263
- "description": "Message to be displayed in the report.",
264
- "required": true
265
- }, {
266
- "name": "group",
267
- "type": "string",
268
- "description": "Specifies the endpoint group to deliver the report to."
269
- }]
270
- }
271
- },
272
255
  "/session/:sessionId/file": {
273
256
  "POST": {
274
257
  "command": "file",
@@ -95,7 +95,7 @@
95
95
  "required": true
96
96
  }],
97
97
  "returns": {
98
- "type": "String",
98
+ "type": "string",
99
99
  "name": "url",
100
100
  "description": "current document URL of the top-level browsing context."
101
101
  }
@@ -132,7 +132,7 @@
132
132
  "ref": "https://w3c.github.io/webdriver/#dfn-get-title",
133
133
  "parameters": [],
134
134
  "returns": {
135
- "type": "String",
135
+ "type": "string",
136
136
  "name": "title",
137
137
  "description": "Returns a string which is the same as `document.title` of the current top-level browsing context."
138
138
  }
@@ -145,7 +145,7 @@
145
145
  "ref": "https://w3c.github.io/webdriver/#dfn-get-window-handle",
146
146
  "parameters": [],
147
147
  "returns": {
148
- "type": "String",
148
+ "type": "string",
149
149
  "name": "handle",
150
150
  "description": "Returns a string which is the window handle for the current top-level browsing context."
151
151
  }
@@ -199,6 +199,74 @@
199
199
  }
200
200
  }
201
201
  },
202
+ "/session/:sessionId/print": {
203
+ "POST": {
204
+ "command": "printPage",
205
+ "description": "The Print Page command renders the document to a paginated PDF document.",
206
+ "ref": "https://w3c.github.io/webdriver/#print-page",
207
+ "parameters": [{
208
+ "name": "orientation",
209
+ "type": "string",
210
+ "description": "page orientation. Default: `portrait`",
211
+ "required": false
212
+ }, {
213
+ "name": "scale",
214
+ "type": "number",
215
+ "description": "page scale. Default: `1`",
216
+ "required": false
217
+ }, {
218
+ "name": "background",
219
+ "type": "boolean",
220
+ "description": "page background. Default: `false`",
221
+ "required": false
222
+ }, {
223
+ "name": "width",
224
+ "type": "number",
225
+ "description": "page width in cm. Default: `21.59` from page",
226
+ "required": false
227
+ }, {
228
+ "name": "height",
229
+ "type": "number",
230
+ "description": "page height in cm. Default: `27.94` from page",
231
+ "required": false
232
+ }, {
233
+ "name": "top",
234
+ "type": "number",
235
+ "description": "page margin in cm from top margin. Default: `1`",
236
+ "required": false
237
+ }, {
238
+ "name": "bottom",
239
+ "type": "number",
240
+ "description": "page margin in cm from bottom margin. Default: `1`",
241
+ "required": false
242
+ }, {
243
+ "name": "left",
244
+ "type": "number",
245
+ "description": "page margin in cm from left margin. Default: `1`",
246
+ "required": false
247
+ }, {
248
+ "name": "right",
249
+ "type": "number",
250
+ "description": "page margin in cm from right margin. Default: `1`",
251
+ "required": false
252
+ }, {
253
+ "name": "shrinkToFit",
254
+ "type": "boolean",
255
+ "description": "shrink pdf to fit in page. Default: `true`",
256
+ "required": false
257
+ }, {
258
+ "name": "pageRanges",
259
+ "type": "object[]",
260
+ "description": "page ranges. Default `[]`",
261
+ "required": false
262
+ }],
263
+ "returns": {
264
+ "type": "string",
265
+ "name": "pdf",
266
+ "description": "The base64-encoded PDF representation of the paginated document."
267
+ }
268
+ }
269
+ },
202
270
  "/session/:sessionId/frame": {
203
271
  "POST": {
204
272
  "command": "switchToFrame",
@@ -320,7 +388,7 @@
320
388
  "required": true
321
389
  }],
322
390
  "returns": {
323
- "type": "String",
391
+ "type": "WebDriver.ElementReference[]",
324
392
  "name": "element",
325
393
  "description": "A JSON representation of an element object."
326
394
  }
@@ -343,7 +411,7 @@
343
411
  "required": true
344
412
  }],
345
413
  "returns": {
346
- "type": "String[]",
414
+ "type": "WebDriver.ElementReference[]",
347
415
  "name": "elements",
348
416
  "description": "A (possibly empty) JSON list of representations of an element object."
349
417
  }
@@ -370,7 +438,7 @@
370
438
  "required": true
371
439
  }],
372
440
  "returns": {
373
- "type": "String",
441
+ "type": "WebDriver.ElementReference",
374
442
  "name": "element",
375
443
  "description": "A JSON representation of an element object."
376
444
  }
@@ -397,7 +465,7 @@
397
465
  "required": true
398
466
  }],
399
467
  "returns": {
400
- "type": "String[]",
468
+ "type": "WebDriver.ElementReference[]",
401
469
  "name": "elements",
402
470
  "description": "A (possibly empty) JSON list of representations of an element object."
403
471
  }
@@ -410,7 +478,7 @@
410
478
  "ref": "https://w3c.github.io/webdriver/#dfn-get-active-element",
411
479
  "parameters": [],
412
480
  "returns": {
413
- "type": "String",
481
+ "type": "string",
414
482
  "name": "element",
415
483
  "description": "A JSON representation of an element object."
416
484
  }
@@ -464,7 +532,7 @@
464
532
  }],
465
533
  "parameters": [],
466
534
  "returns": {
467
- "type": "String",
535
+ "type": "string",
468
536
  "name": "attribute",
469
537
  "description": "The named attribute of the element."
470
538
  }
@@ -484,7 +552,7 @@
484
552
  }],
485
553
  "parameters": [],
486
554
  "returns": {
487
- "type": "String",
555
+ "type": "string",
488
556
  "name": "property",
489
557
  "description": "The named property of the element, accessed by calling GetOwnProperty on the element object."
490
558
  }
@@ -504,7 +572,7 @@
504
572
  }],
505
573
  "parameters": [],
506
574
  "returns": {
507
- "type": "String",
575
+ "type": "string",
508
576
  "name": "cssValue",
509
577
  "description": "The computed value of the parameter corresponding to property name from the element's style declarations (unless the document type is xml, in which case the return value is simply the empty string)."
510
578
  }
@@ -521,7 +589,7 @@
521
589
  }],
522
590
  "parameters": [],
523
591
  "returns": {
524
- "type": "String",
592
+ "type": "string",
525
593
  "name": "text",
526
594
  "description": "The visible text of the element (including child elements), following the algorithm defined in the Selenium Atoms for [`bot.dom.getVisibleText`](https://github.com/SeleniumHQ/selenium/blob/e09e28f016c9f53196cf68d6f71991c5af4a35d4/javascript/atoms/dom.js#L981)."
527
595
  }
@@ -538,7 +606,7 @@
538
606
  }],
539
607
  "parameters": [],
540
608
  "returns": {
541
- "type": "String",
609
+ "type": "string",
542
610
  "name": "text",
543
611
  "description": "The tagName attribute of the element."
544
612
  }
@@ -777,7 +845,7 @@
777
845
  "ref": "https://w3c.github.io/webdriver/#dfn-get-alert-text",
778
846
  "parameters": [],
779
847
  "returns": {
780
- "type": "String",
848
+ "type": "string",
781
849
  "name": "alertText",
782
850
  "description": "The message of the user prompt."
783
851
  }
@@ -801,7 +869,7 @@
801
869
  "ref": "https://w3c.github.io/webdriver/#dfn-take-screenshot",
802
870
  "parameters": [],
803
871
  "returns": {
804
- "type": "String",
872
+ "type": "string",
805
873
  "name": "screenshot",
806
874
  "description": "The base64-encoded PNG image data comprising the screenshot of the initial viewport."
807
875
  }
@@ -823,10 +891,332 @@
823
891
  "required": false
824
892
  }],
825
893
  "returns": {
826
- "type": "String",
894
+ "type": "string",
827
895
  "name": "screenshot",
828
896
  "description": "The base64-encoded PNG image data comprising the screenshot of the visible region of an element’s bounding rectangle after it has been scrolled into view."
829
897
  }
830
898
  }
899
+ },
900
+ "/session/:sessionId/element/:elementId/computedrole": {
901
+ "GET": {
902
+ "command": "getElementComputedRole",
903
+ "description": "Get the computed WAI-ARIA role of an element.",
904
+ "ref": "https://w3c.github.io/webdriver/#get-computed-role",
905
+ "variables": [{
906
+ "name": "elementId",
907
+ "description": "the id of an element returned in a previous call to Find Element(s)"
908
+ }],
909
+ "parameters": [],
910
+ "returns": {
911
+ "type": "string",
912
+ "name": "role",
913
+ "description": "The result of computing the WAI-ARIA role of element."
914
+ }
915
+ }
916
+ },
917
+ "/session/:sessionId/element/:elementId/computedlabel": {
918
+ "GET": {
919
+ "command": "getElementComputedLabel",
920
+ "description": "Get the accessible name of the element.",
921
+ "ref": "https://w3c.github.io/webdriver/#get-computed-label",
922
+ "variables": [{
923
+ "name": "elementId",
924
+ "description": "the id of an element returned in a previous call to Find Element(s)"
925
+ }],
926
+ "parameters": [],
927
+ "returns": {
928
+ "type": "string",
929
+ "name": "label",
930
+ "description": "The result of a Accessible Name and Description Computation for the Accessible Name of the element."
931
+ }
932
+ }
933
+ },
934
+ "/session/:sessionId/permissions": {
935
+ "POST": {
936
+ "command": "setPermissions",
937
+ "description": "Simulates user modification of a PermissionDescriptor's permission state. __Note:__ this feature has not landed in all browsers yet.",
938
+ "ref": "https://w3c.github.io/permissions/#set-permission-command",
939
+ "examples": [
940
+ [
941
+ "// set midi permissions",
942
+ "browser.setPermissions({",
943
+ " name: 'midi',",
944
+ " sysex; true",
945
+ ", 'granted'); // can be also 'denied' or 'prompt'"
946
+ ]
947
+ ],
948
+ "parameters": [{
949
+ "name": "descriptor",
950
+ "type": "object",
951
+ "description": "Each powerful feature has one or more aspects that websites can request permission to access. To describe these aspects, each feature defines a subtype of PermissionDescriptor to be its permission descriptor type. __Note:__ this feature has not landed in all browsers yet.",
952
+ "required": true
953
+ }, {
954
+ "name": "state",
955
+ "type": "string",
956
+ "description": "Determines whether permission is granted, denied or prompted.",
957
+ "required": true
958
+ }, {
959
+ "name": "oneRealm",
960
+ "type": "boolean",
961
+ "description": "Whether or not to apply permissions to all execution contexts.",
962
+ "required": false
963
+ }]
964
+ }
965
+ },
966
+ "/session/:sessionId/reporting/generate_test_report": {
967
+ "POST": {
968
+ "command": "generateTestReport",
969
+ "description": "Generates a report for testing. Extension for [Reporting API](https://developers.google.com/web/updates/2018/09/reportingapi). __Note:__ this feature has not landed in all browsers yet.",
970
+ "ref": "https://w3c.github.io/reporting/#automation",
971
+ "parameters": [{
972
+ "name": "message",
973
+ "type": "string",
974
+ "description": "Message to be displayed in the report.",
975
+ "required": true
976
+ }, {
977
+ "name": "group",
978
+ "type": "string",
979
+ "description": "Specifies the endpoint group to deliver the report to."
980
+ }]
981
+ }
982
+ },
983
+ "/session/:sessionId/sensor": {
984
+ "POST": {
985
+ "command": "createMockSensor",
986
+ "description": "Creates a mock sensor to emulate sensors like Ambient Light Sensor. __Note:__ this feature has not landed in all browsers yet.",
987
+ "ref": "https://w3c.github.io/sensors/#create-mock-sensor-command",
988
+ "parameters": [{
989
+ "name": "mockSensorType",
990
+ "type": "string",
991
+ "description": "Type of sensor API to mock, e.g. 'ambient-light'",
992
+ "required": true
993
+ }, {
994
+ "name": "maxSamplingFrequency",
995
+ "type": "number",
996
+ "description": "A double representing frequency in Hz that is used to set maximum supported sampling frequency for the associated mock sensor."
997
+ }, {
998
+ "name": "minSamplingFrequency",
999
+ "type": "number",
1000
+ "description": "A double representing frequency in Hz that is used to set minimum supported sampling frequency for the associated mock sensor."
1001
+ }]
1002
+ }
1003
+ },
1004
+ "/session/:sessionId/sensor/:type": {
1005
+ "GET": {
1006
+ "command": "getMockSensor",
1007
+ "description": "Retrieves information about a given type of mock sensor. __Note:__ this feature has not landed in all browsers yet.",
1008
+ "ref": "https://w3c.github.io/sensors/#get-mock-sensor-command",
1009
+ "variables": [{
1010
+ "name": "type",
1011
+ "description": "Mock sensor type to retrieve information from."
1012
+ }],
1013
+ "parameters": [],
1014
+ "returns": {
1015
+ "type": "object",
1016
+ "name": "sensorReading",
1017
+ "description": "Values of the mock sensor reading."
1018
+ }
1019
+ },
1020
+ "POST": {
1021
+ "command": "updateMockSensor",
1022
+ "description": "Updates the mock sensor type. __Note:__ this feature has not landed in all browsers yet.",
1023
+ "ref": "https://w3c.github.io/sensors/#update-mock-sensor-reading-command",
1024
+ "variables": [{
1025
+ "name": "type",
1026
+ "description": "Mock sensor type to update information for."
1027
+ }],
1028
+ "parameters": [{
1029
+ "name": "mockSensorType",
1030
+ "type": "string",
1031
+ "description": "Type of sensor API to mock, e.g. 'ambient-light'",
1032
+ "required": true
1033
+ }, {
1034
+ "name": "maxSamplingFrequency",
1035
+ "type": "number",
1036
+ "description": "A double representing frequency in Hz that is used to set maximum supported sampling frequency for the associated mock sensor."
1037
+ }, {
1038
+ "name": "minSamplingFrequency",
1039
+ "type": "number",
1040
+ "description": "A double representing frequency in Hz that is used to set minimum supported sampling frequency for the associated mock sensor."
1041
+ }]
1042
+ },
1043
+ "DELETE": {
1044
+ "command": "deleteMockSensor",
1045
+ "description": "The Delete Session command closes any top-level browsing contexts associated with the current session, terminates the connection, and finally closes the current session. __Note:__ this feature has not landed in all browsers yet.",
1046
+ "ref": "https://w3c.github.io/sensors/#delete-mock-sensor-command",
1047
+ "variables": [{
1048
+ "name": "type",
1049
+ "description": "Mock sensor type to delete."
1050
+ }],
1051
+ "parameters": []
1052
+ }
1053
+ },
1054
+ "/session/:sessionId/time_zone": {
1055
+ "POST": {
1056
+ "command": "setTimeZone",
1057
+ "description": "Simulates the changing of a time zone for the purposes of testing. __Note:__ this feature has not landed in all browsers yet.",
1058
+ "ref": "https://w3c.github.io/sensors/#create-mock-sensor-command",
1059
+ "parameters": [{
1060
+ "name": "time_zone",
1061
+ "type": "string",
1062
+ "description": "Name of the timezone, e.g. Asia/Tokyo",
1063
+ "required": true
1064
+ }]
1065
+ }
1066
+ },
1067
+ "/session/:sessionId/authenticator": {
1068
+ "POST": {
1069
+ "command": "addVirtualAuthenticator",
1070
+ "description": "Creates a software [Virtual Authenticator](https://www.w3.org/TR/webauthn-2/#virtual-authenticators).",
1071
+ "ref": "https://www.w3.org/TR/webauthn-2/#sctn-automation-add-virtual-authenticator",
1072
+ "parameters": [{
1073
+ "name": "protocol",
1074
+ "type": "string",
1075
+ "description": "Valid values: 'ctap1/u2f', 'ctap2', 'ctap2_1'",
1076
+ "required": false
1077
+ }, {
1078
+ "name": "transport",
1079
+ "type": "string",
1080
+ "description": "Valid values: 'usb', 'nfc', 'ble' or 'internal'",
1081
+ "required": false
1082
+ }, {
1083
+ "name": "hasResidentKey",
1084
+ "type": "boolean",
1085
+ "description": "",
1086
+ "required": false
1087
+ }, {
1088
+ "name": "hasUserVerification",
1089
+ "type": "boolean",
1090
+ "description": "",
1091
+ "required": false
1092
+ }, {
1093
+ "name": "isUserConsenting",
1094
+ "type": "boolean",
1095
+ "description": "",
1096
+ "required": false
1097
+ }, {
1098
+ "name": "isUserVerified",
1099
+ "type": "boolean",
1100
+ "description": "",
1101
+ "required": false
1102
+ }, {
1103
+ "name": "extensions",
1104
+ "type": "object[]",
1105
+ "description": "",
1106
+ "required": false
1107
+ }, {
1108
+ "name": "uvm",
1109
+ "type": "object[]",
1110
+ "description": "",
1111
+ "required": false
1112
+ }]
1113
+ }
1114
+ },
1115
+ "/session/:sessionId/authenticator/:authenticatorId": {
1116
+ "DELETE": {
1117
+ "command": "removeVirtualAuthenticator",
1118
+ "description": "Removes a previously created Virtual Authenticator.",
1119
+ "ref": "https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-virtual-authenticator",
1120
+ "variables": [{
1121
+ "name": "authenticatorId",
1122
+ "description": "id of authenticator"
1123
+ }],
1124
+ "parameters": []
1125
+ }
1126
+ },
1127
+ "/session/:sessionId/authenticator/:authenticatorId/credential": {
1128
+ "POST": {
1129
+ "command": "addCredential",
1130
+ "description": "Injects a Public Key Credential Source into an existing Virtual Authenticator.",
1131
+ "ref": "https://www.w3.org/TR/webauthn-2/#sctn-automation-add-credential",
1132
+ "parameters": [{
1133
+ "name": "credentialId",
1134
+ "type": "string",
1135
+ "description": "The Credential ID encoded using Base64url Encoding.",
1136
+ "required": true
1137
+ }, {
1138
+ "name": "isResidentCredential",
1139
+ "type": "boolean",
1140
+ "description": "If set to true, a client-side discoverable credential is created. If set to false, a server-side credential is created instead.",
1141
+ "required": true
1142
+ }, {
1143
+ "name": "rpId",
1144
+ "type": "string",
1145
+ "description": "The Relying Party ID the credential is scoped to.",
1146
+ "required": true
1147
+ }, {
1148
+ "name": "privateKey",
1149
+ "type": "string",
1150
+ "description": "An asymmetric key package containing a single private key per [RFC5958], encoded using Base64url Encoding.",
1151
+ "required": true
1152
+ }, {
1153
+ "name": "userHandle",
1154
+ "type": "string",
1155
+ "description": "The userHandle associated to the credential encoded using Base64url Encoding. This property may not be defined.",
1156
+ "required": true
1157
+ }, {
1158
+ "name": "signCount",
1159
+ "type": "number",
1160
+ "description": "The initial value for a signature counter associated to the public key credential source.",
1161
+ "required": true
1162
+ }, {
1163
+ "name": "largeBlob",
1164
+ "type": "string",
1165
+ "description": "The large, per-credential blob associated to the public key credential source, encoded using Base64url Encoding. This property may not be defined.",
1166
+ "required": true
1167
+ }]
1168
+ }
1169
+ },
1170
+ "/session/:sessionId/authenticator/:authenticatorId/credentials": {
1171
+ "GET": {
1172
+ "command": "getCredentials",
1173
+ "description": "Returns one Credential Parameters object for every Public Key Credential Source stored in a Virtual Authenticator, regardless of whether they were stored using Add Credential or `navigator.credentials.create()`.",
1174
+ "ref": "https://www.w3.org/TR/webauthn-2/#sctn-automation-get-credentials",
1175
+ "variables": [{
1176
+ "name": "authenticatorId",
1177
+ "description": "id of authenticator"
1178
+ }],
1179
+ "parameters": []
1180
+ },
1181
+ "DELETE": {
1182
+ "command": "removeAllCredentials",
1183
+ "description": "Removes all Public Key Credential Sources stored on a Virtual Authenticator.",
1184
+ "ref": "https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-all-credentials",
1185
+ "variables": [{
1186
+ "name": "authenticatorId",
1187
+ "description": "id of authenticator"
1188
+ }],
1189
+ "parameters": []
1190
+ }
1191
+ },
1192
+ "/session/:sessionId/authenticator/:authenticatorId/credentials/:credentialId": {
1193
+ "DELETE": {
1194
+ "command": "removeCredential",
1195
+ "description": "Removes a Public Key Credential Source stored on a Virtual Authenticator.",
1196
+ "ref": "https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-credential",
1197
+ "variables": [{
1198
+ "name": "authenticatorId",
1199
+ "description": "id of authenticator"
1200
+ }, {
1201
+ "name": "credentialId",
1202
+ "description": "id of credential"
1203
+ }],
1204
+ "parameters": []
1205
+ }
1206
+ },
1207
+ "/session/:sessionId/authenticator/:authenticatorId/credentials/:credentialId/uv": {
1208
+ "POST": {
1209
+ "command": "setUserVerified",
1210
+ "description": "The Set User Verified extension command sets the isUserVerified property on the Virtual Authenticator.",
1211
+ "ref": "https://www.w3.org/TR/webauthn-2/#sctn-automation-set-user-verified",
1212
+ "variables": [{
1213
+ "name": "authenticatorId",
1214
+ "description": "id of authenticator"
1215
+ }, {
1216
+ "name": "credentialId",
1217
+ "description": "id of credential"
1218
+ }],
1219
+ "parameters": []
1220
+ }
831
1221
  }
832
1222
  }