selenium-webdriver 4.0.0-alpha.8 → 4.0.0-beta.1

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.
Files changed (53) hide show
  1. package/CHANGES.md +14 -1
  2. package/LICENSE +202 -0
  3. package/NOTICE +2 -0
  4. package/README.md +0 -0
  5. package/chrome.js +0 -0
  6. package/chromium.js +7 -202
  7. package/devtools/CDPConnection.js +0 -0
  8. package/edge.js +1 -1
  9. package/example/chrome_android.js +45 -0
  10. package/{lib/atoms/make-atoms-module.js → example/chrome_mobile_emulation.js} +26 -15
  11. package/example/firefox_channels.js +84 -0
  12. package/example/google_search.js +50 -0
  13. package/example/google_search_test.js +70 -0
  14. package/example/headless.js +63 -0
  15. package/example/logging.js +64 -0
  16. package/firefox.js +10 -9
  17. package/http/index.js +0 -0
  18. package/http/util.js +3 -3
  19. package/ie.js +0 -0
  20. package/index.js +2 -2
  21. package/io/exec.js +0 -0
  22. package/io/index.js +4 -4
  23. package/io/zip.js +0 -0
  24. package/lib/actions.js +16 -15
  25. package/lib/atoms/find-elements.js +4 -3
  26. package/lib/atoms/get-attribute.js +0 -0
  27. package/lib/atoms/is-displayed.js +0 -0
  28. package/lib/atoms/mutation-listener.js +38 -0
  29. package/lib/by.js +1 -1
  30. package/lib/capabilities.js +2 -2
  31. package/lib/command.js +2 -0
  32. package/lib/error.js +0 -0
  33. package/lib/http.js +17 -1
  34. package/lib/input.js +0 -0
  35. package/lib/logging.js +0 -0
  36. package/lib/promise.js +1 -1
  37. package/lib/proxy.js +0 -0
  38. package/lib/session.js +0 -0
  39. package/lib/symbols.js +0 -0
  40. package/lib/until.js +17 -15
  41. package/lib/webdriver.js +322 -50
  42. package/net/index.js +0 -0
  43. package/net/portprober.js +8 -8
  44. package/opera.js +0 -0
  45. package/package.json +8 -8
  46. package/proxy.js +0 -0
  47. package/remote/index.js +0 -0
  48. package/safari.js +0 -0
  49. package/testing/index.js +509 -0
  50. package/.eslintrc.js +0 -27
  51. package/.prettierrc +0 -4
  52. package/devtools/generator/protocol-dts-generator.js +0 -429
  53. package/lib/README +0 -5
package/lib/http.js CHANGED
@@ -76,7 +76,7 @@ function requireAtom(module, bazelTarget) {
76
76
  * @return {string} The headers as a string.
77
77
  */
78
78
  function headersToString(headers) {
79
- let ret = []
79
+ const ret = []
80
80
  headers.forEach(function (value, name) {
81
81
  ret.push(`${name.toLowerCase()}: ${value}`)
82
82
  })
@@ -234,6 +234,14 @@ const COMMAND_MAP = new Map([
234
234
  ],
235
235
  [cmd.Name.SUBMIT_ELEMENT, post('/session/:sessionId/element/:id/submit')],
236
236
  [cmd.Name.GET_ELEMENT_TEXT, get('/session/:sessionId/element/:id/text')],
237
+ [
238
+ cmd.Name.GET_COMPUTED_ROLE,
239
+ get('/session/:sessionId/element/:id/computedrole'),
240
+ ],
241
+ [
242
+ cmd.Name.GET_COMPUTED_LABEL,
243
+ get('/session/:sessionId/element/:id/computedlabel'),
244
+ ],
237
245
  [cmd.Name.GET_ELEMENT_TAG_NAME, get('/session/:sessionId/element/:id/name')],
238
246
  [
239
247
  cmd.Name.IS_ELEMENT_SELECTED,
@@ -402,6 +410,14 @@ const W3C_COMMAND_MAP = new Map([
402
410
  post('/session/:sessionId/element/:id/value'),
403
411
  ],
404
412
  [cmd.Name.GET_ELEMENT_TEXT, get('/session/:sessionId/element/:id/text')],
413
+ [
414
+ cmd.Name.GET_COMPUTED_ROLE,
415
+ get('/session/:sessionId/element/:id/computedrole'),
416
+ ],
417
+ [
418
+ cmd.Name.GET_COMPUTED_LABEL,
419
+ get('/session/:sessionId/element/:id/computedlabel'),
420
+ ],
405
421
  [cmd.Name.IS_ELEMENT_ENABLED, get('/session/:sessionId/element/:id/enabled')],
406
422
  [
407
423
  cmd.Name.GET_ELEMENT_ATTRIBUTE,
package/lib/input.js CHANGED
File without changes
package/lib/logging.js CHANGED
File without changes
package/lib/promise.js CHANGED
@@ -51,7 +51,7 @@ function isPromise(value) {
51
51
  */
52
52
  function delayed(ms) {
53
53
  return new Promise((resolve) => {
54
- setTimeout(() => resolve(), ms)
54
+ setTimeout(resolve, ms)
55
55
  })
56
56
  }
57
57
 
package/lib/proxy.js CHANGED
File without changes
package/lib/session.js CHANGED
File without changes
package/lib/symbols.js CHANGED
File without changes
package/lib/until.js CHANGED
@@ -68,7 +68,7 @@ const webdriver = require('./webdriver'),
68
68
  * @return {!Condition<boolean>} A new condition.
69
69
  */
70
70
  exports.ableToSwitchToFrame = function ableToSwitchToFrame(frame) {
71
- var condition
71
+ let condition
72
72
  if (typeof frame === 'number' || frame instanceof webdriver.WebElement) {
73
73
  condition = (driver) => attemptToSwitchFrames(driver, frame)
74
74
  } else {
@@ -137,13 +137,14 @@ exports.alertIsPresent = function alertIsPresent() {
137
137
  * @return {!Condition<boolean>} The new condition.
138
138
  */
139
139
  exports.titleIs = function titleIs(title) {
140
- return new Condition('for title to be ' + JSON.stringify(title), function (
141
- driver
142
- ) {
143
- return driver.getTitle().then(function (t) {
144
- return t === title
145
- })
146
- })
140
+ return new Condition(
141
+ 'for title to be ' + JSON.stringify(title),
142
+ function (driver) {
143
+ return driver.getTitle().then(function (t) {
144
+ return t === title
145
+ })
146
+ }
147
+ )
147
148
  }
148
149
 
149
150
  /**
@@ -188,13 +189,14 @@ exports.titleMatches = function titleMatches(regex) {
188
189
  * @return {!Condition<boolean>} The new condition.
189
190
  */
190
191
  exports.urlIs = function urlIs(url) {
191
- return new Condition('for URL to be ' + JSON.stringify(url), function (
192
- driver
193
- ) {
194
- return driver.getCurrentUrl().then(function (u) {
195
- return u === url
196
- })
197
- })
192
+ return new Condition(
193
+ 'for URL to be ' + JSON.stringify(url),
194
+ function (driver) {
195
+ return driver.getCurrentUrl().then(function (u) {
196
+ return u === url
197
+ })
198
+ }
199
+ )
198
200
  }
199
201
 
200
202
  /**