webdriverio 7.20.7 → 7.20.8-alpha.504

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 (229) hide show
  1. package/build/cjs/index.d.ts +3 -0
  2. package/build/cjs/index.d.ts.map +1 -0
  3. package/build/cjs/index.js +13 -0
  4. package/build/cjs/package.json +3 -0
  5. package/build/commands/browser/$$.d.ts +10 -1
  6. package/build/commands/browser/$$.d.ts.map +1 -1
  7. package/build/commands/browser/$$.js +16 -9
  8. package/build/commands/browser/$.js +8 -11
  9. package/build/commands/browser/action.d.ts +132 -0
  10. package/build/commands/browser/action.d.ts.map +1 -0
  11. package/build/commands/browser/action.js +13 -0
  12. package/build/commands/browser/actions.d.ts +29 -0
  13. package/build/commands/browser/actions.d.ts.map +1 -0
  14. package/build/commands/browser/actions.js +30 -0
  15. package/build/commands/browser/addCommand.d.ts +1 -1
  16. package/build/commands/browser/addCommand.js +1 -1
  17. package/build/commands/browser/call.d.ts +7 -5
  18. package/build/commands/browser/call.d.ts.map +1 -1
  19. package/build/commands/browser/call.js +8 -9
  20. package/build/commands/browser/custom$$.js +7 -10
  21. package/build/commands/browser/custom$.d.ts +1 -1
  22. package/build/commands/browser/custom$.js +6 -9
  23. package/build/commands/browser/debug.js +8 -14
  24. package/build/commands/browser/deleteCookies.d.ts +3 -3
  25. package/build/commands/browser/deleteCookies.js +4 -7
  26. package/build/commands/browser/execute.d.ts +2 -2
  27. package/build/commands/browser/execute.js +5 -8
  28. package/build/commands/browser/executeAsync.js +3 -6
  29. package/build/commands/browser/getCookies.d.ts +2 -2
  30. package/build/commands/browser/getCookies.js +3 -6
  31. package/build/commands/browser/getPuppeteer.d.ts +1 -1
  32. package/build/commands/browser/getPuppeteer.d.ts.map +1 -1
  33. package/build/commands/browser/getPuppeteer.js +14 -21
  34. package/build/commands/browser/getWindowSize.js +3 -6
  35. package/build/commands/browser/keys.d.ts +20 -10
  36. package/build/commands/browser/keys.d.ts.map +1 -1
  37. package/build/commands/browser/keys.js +29 -24
  38. package/build/commands/browser/mock.d.ts +5 -4
  39. package/build/commands/browser/mock.d.ts.map +1 -1
  40. package/build/commands/browser/mock.js +16 -22
  41. package/build/commands/browser/mockClearAll.js +5 -11
  42. package/build/commands/browser/mockRestoreAll.js +5 -11
  43. package/build/commands/browser/newWindow.js +5 -11
  44. package/build/commands/browser/pause.js +1 -4
  45. package/build/commands/browser/react$$.d.ts.map +1 -1
  46. package/build/commands/browser/react$$.js +16 -17
  47. package/build/commands/browser/react$.d.ts.map +1 -1
  48. package/build/commands/browser/react$.js +13 -14
  49. package/build/commands/browser/reloadSession.js +5 -12
  50. package/build/commands/browser/savePDF.d.ts +14 -14
  51. package/build/commands/browser/savePDF.js +21 -27
  52. package/build/commands/browser/saveRecordingScreen.js +6 -12
  53. package/build/commands/browser/saveScreenshot.js +6 -12
  54. package/build/commands/browser/scroll.d.ts +25 -0
  55. package/build/commands/browser/scroll.d.ts.map +1 -0
  56. package/build/commands/browser/scroll.js +41 -0
  57. package/build/commands/browser/setCookies.d.ts +1 -1
  58. package/build/commands/browser/setCookies.d.ts.map +1 -1
  59. package/build/commands/browser/setCookies.js +5 -7
  60. package/build/commands/browser/setTimeout.js +1 -4
  61. package/build/commands/browser/setWindowSize.js +3 -6
  62. package/build/commands/browser/switchWindow.js +1 -4
  63. package/build/commands/browser/throttle.js +3 -6
  64. package/build/commands/browser/touchAction.d.ts +1 -1
  65. package/build/commands/browser/touchAction.d.ts.map +1 -1
  66. package/build/commands/browser/touchAction.js +3 -6
  67. package/build/commands/browser/uploadFile.d.ts +1 -1
  68. package/build/commands/browser/uploadFile.d.ts.map +1 -1
  69. package/build/commands/browser/uploadFile.js +10 -15
  70. package/build/commands/browser/url.js +3 -6
  71. package/build/commands/browser/waitUntil.d.ts +1 -2
  72. package/build/commands/browser/waitUntil.d.ts.map +1 -1
  73. package/build/commands/browser/waitUntil.js +4 -11
  74. package/build/commands/browser.d.ts +37 -69
  75. package/build/commands/browser.d.ts.map +1 -1
  76. package/build/commands/browser.js +37 -44
  77. package/build/commands/constant.d.ts +1 -1
  78. package/build/commands/constant.d.ts.map +1 -1
  79. package/build/commands/constant.js +6 -12
  80. package/build/commands/element/$$.d.ts +1 -1
  81. package/build/commands/element/$$.d.ts.map +1 -1
  82. package/build/commands/element/$$.js +2 -7
  83. package/build/commands/element/$.d.ts +1 -1
  84. package/build/commands/element/$.d.ts.map +1 -1
  85. package/build/commands/element/$.js +2 -7
  86. package/build/commands/element/addValue.d.ts +10 -14
  87. package/build/commands/element/addValue.d.ts.map +1 -1
  88. package/build/commands/element/addValue.js +23 -27
  89. package/build/commands/element/clearValue.d.ts +1 -1
  90. package/build/commands/element/clearValue.js +2 -5
  91. package/build/commands/element/click.d.ts +1 -1
  92. package/build/commands/element/click.d.ts.map +1 -1
  93. package/build/commands/element/click.js +19 -34
  94. package/build/commands/element/custom$$.js +9 -11
  95. package/build/commands/element/custom$.js +8 -10
  96. package/build/commands/element/doubleClick.d.ts.map +1 -1
  97. package/build/commands/element/doubleClick.js +11 -17
  98. package/build/commands/element/dragAndDrop.d.ts.map +1 -1
  99. package/build/commands/element/dragAndDrop.js +13 -19
  100. package/build/commands/element/getAttribute.js +1 -4
  101. package/build/commands/element/getCSSProperty.d.ts +1 -1
  102. package/build/commands/element/getCSSProperty.d.ts.map +1 -1
  103. package/build/commands/element/getCSSProperty.js +7 -13
  104. package/build/commands/element/getComputedLabel.js +1 -4
  105. package/build/commands/element/getComputedRole.js +1 -4
  106. package/build/commands/element/getHTML.js +7 -13
  107. package/build/commands/element/getLocation.js +3 -5
  108. package/build/commands/element/getProperty.d.ts +5 -5
  109. package/build/commands/element/getProperty.d.ts.map +1 -1
  110. package/build/commands/element/getProperty.js +5 -11
  111. package/build/commands/element/getSize.js +3 -5
  112. package/build/commands/element/getTagName.js +1 -4
  113. package/build/commands/element/getText.js +1 -4
  114. package/build/commands/element/getValue.js +1 -4
  115. package/build/commands/element/isClickable.d.ts.map +1 -1
  116. package/build/commands/element/isClickable.js +10 -13
  117. package/build/commands/element/isDisplayed.js +9 -16
  118. package/build/commands/element/isDisplayedInViewport.js +7 -13
  119. package/build/commands/element/isEnabled.js +1 -4
  120. package/build/commands/element/isEqual.d.ts.map +1 -1
  121. package/build/commands/element/isEqual.js +9 -9
  122. package/build/commands/element/isExisting.js +1 -4
  123. package/build/commands/element/isFocused.js +7 -13
  124. package/build/commands/element/isSelected.js +1 -4
  125. package/build/commands/element/moveTo.d.ts.map +1 -1
  126. package/build/commands/element/moveTo.js +8 -13
  127. package/build/commands/element/nextElement.js +2 -5
  128. package/build/commands/element/parentElement.js +2 -5
  129. package/build/commands/element/previousElement.js +2 -5
  130. package/build/commands/element/react$$.d.ts.map +1 -1
  131. package/build/commands/element/react$$.js +16 -16
  132. package/build/commands/element/react$.d.ts.map +1 -1
  133. package/build/commands/element/react$.js +15 -14
  134. package/build/commands/element/saveScreenshot.js +6 -12
  135. package/build/commands/element/scrollIntoView.d.ts +4 -2
  136. package/build/commands/element/scrollIntoView.d.ts.map +1 -1
  137. package/build/commands/element/scrollIntoView.js +33 -12
  138. package/build/commands/element/selectByAttribute.js +3 -6
  139. package/build/commands/element/selectByIndex.js +3 -6
  140. package/build/commands/element/selectByVisibleText.js +3 -6
  141. package/build/commands/element/setValue.d.ts +13 -14
  142. package/build/commands/element/setValue.d.ts.map +1 -1
  143. package/build/commands/element/setValue.js +14 -17
  144. package/build/commands/element/shadow$$.d.ts +1 -1
  145. package/build/commands/element/shadow$$.d.ts.map +1 -1
  146. package/build/commands/element/shadow$$.js +3 -6
  147. package/build/commands/element/shadow$.js +3 -6
  148. package/build/commands/element/touchAction.js +3 -6
  149. package/build/commands/element/waitForClickable.js +1 -4
  150. package/build/commands/element/waitForDisplayed.js +1 -4
  151. package/build/commands/element/waitForEnabled.js +1 -4
  152. package/build/commands/element/waitForExist.js +1 -4
  153. package/build/commands/element/waitUntil.d.ts +2 -3
  154. package/build/commands/element/waitUntil.d.ts.map +1 -1
  155. package/build/commands/element/waitUntil.js +3 -9
  156. package/build/commands/element.d.ts +49 -99
  157. package/build/commands/element.d.ts.map +1 -1
  158. package/build/commands/element.js +49 -63
  159. package/build/constants.d.ts +67 -0
  160. package/build/constants.d.ts.map +1 -1
  161. package/build/constants.js +105 -12
  162. package/build/index.d.ts +65 -6
  163. package/build/index.d.ts.map +1 -1
  164. package/build/index.js +48 -86
  165. package/build/middlewares.d.ts +1 -1
  166. package/build/middlewares.js +11 -19
  167. package/build/multiremote.js +18 -24
  168. package/build/protocol-stub.d.ts.map +1 -1
  169. package/build/protocol-stub.js +4 -6
  170. package/build/scripts/getHTML.js +1 -4
  171. package/build/scripts/getProperty.d.ts +5 -5
  172. package/build/scripts/getProperty.d.ts.map +1 -1
  173. package/build/scripts/getProperty.js +1 -4
  174. package/build/scripts/isElementClickable.js +1 -4
  175. package/build/scripts/isElementDisplayed.js +2 -5
  176. package/build/scripts/isElementInViewport.js +1 -4
  177. package/build/scripts/isFocused.js +1 -4
  178. package/build/scripts/newWindow.js +1 -4
  179. package/build/scripts/resq.js +3 -9
  180. package/build/scripts/shadowFnFactory.js +2 -6
  181. package/build/types.d.ts +5 -9
  182. package/build/types.d.ts.map +1 -1
  183. package/build/types.js +1 -2
  184. package/build/utils/SevereServiceError.js +1 -4
  185. package/build/utils/Timer.d.ts.map +1 -1
  186. package/build/utils/Timer.js +13 -29
  187. package/build/utils/actions/base.d.ts +32 -0
  188. package/build/utils/actions/base.d.ts.map +1 -0
  189. package/build/utils/actions/base.js +66 -0
  190. package/build/utils/actions/index.d.ts +6 -0
  191. package/build/utils/actions/index.d.ts.map +1 -0
  192. package/build/utils/actions/index.js +5 -0
  193. package/build/utils/actions/key.d.ts +15 -0
  194. package/build/utils/actions/key.d.ts.map +1 -0
  195. package/build/utils/actions/key.js +22 -0
  196. package/build/utils/actions/pointer.d.ts +62 -0
  197. package/build/utils/actions/pointer.d.ts.map +1 -0
  198. package/build/utils/actions/pointer.js +76 -0
  199. package/build/utils/actions/wheel.d.ts +36 -0
  200. package/build/utils/actions/wheel.d.ts.map +1 -0
  201. package/build/utils/actions/wheel.js +20 -0
  202. package/build/utils/detectBackend.d.ts +1 -1
  203. package/build/utils/detectBackend.d.ts.map +1 -1
  204. package/build/utils/detectBackend.js +3 -7
  205. package/build/utils/findStrategy.d.ts.map +1 -1
  206. package/build/utils/findStrategy.js +50 -19
  207. package/build/utils/getElementObject.d.ts +1 -1
  208. package/build/utils/getElementObject.d.ts.map +1 -1
  209. package/build/utils/getElementObject.js +51 -32
  210. package/build/utils/implicitWait.js +3 -9
  211. package/build/utils/index.d.ts +8 -7
  212. package/build/utils/index.d.ts.map +1 -1
  213. package/build/utils/index.js +125 -148
  214. package/build/utils/interception/devtools.d.ts +1 -1
  215. package/build/utils/interception/devtools.d.ts.map +1 -1
  216. package/build/utils/interception/devtools.js +17 -36
  217. package/build/utils/interception/index.d.ts +2 -2
  218. package/build/utils/interception/index.d.ts.map +1 -1
  219. package/build/utils/interception/index.js +10 -13
  220. package/build/utils/interception/types.d.ts +1 -1
  221. package/build/utils/interception/types.d.ts.map +1 -1
  222. package/build/utils/interception/types.js +1 -2
  223. package/build/utils/interception/webdriver.d.ts +1 -1
  224. package/build/utils/interception/webdriver.d.ts.map +1 -1
  225. package/build/utils/interception/webdriver.js +6 -11
  226. package/build/utils/refetchElement.js +3 -9
  227. package/package.json +27 -17
  228. package/async.d.ts +0 -24
  229. package/sync.d.ts +0 -24
@@ -1,10 +1,4 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const logger_1 = __importDefault(require("@wdio/logger"));
7
- const log = (0, logger_1.default)('webdriverio/click');
1
+ import { getBrowserObject } from '../../utils/index.js';
8
2
  /**
9
3
  *
10
4
  * Click on an element.
@@ -84,58 +78,49 @@ const log = (0, logger_1.default)('webdriverio/click');
84
78
  * @param {number=} options.y Number (optional)
85
79
  * @param {number=} options.skipRelease Boolean (optional)
86
80
  */
87
- async function click(options) {
81
+ export default async function click(options) {
88
82
  if (typeof options === 'undefined') {
89
83
  return this.elementClick(this.elementId);
90
84
  }
91
85
  if (typeof options !== 'object' || Array.isArray(options)) {
92
86
  throw new TypeError('Options must be an object');
93
87
  }
94
- let { button = 0, x: xoffset = 0, y: yoffset = 0, skipRelease = false } = options || {};
88
+ let button = (options.button || 0);
89
+ let { x: xoffset = 0, y: yoffset = 0, skipRelease = false } = options || {};
95
90
  if (typeof xoffset !== 'number'
96
91
  || typeof yoffset !== 'number'
97
92
  || !Number.isInteger(xoffset)
98
93
  || !Number.isInteger(yoffset)) {
99
94
  throw new TypeError('Coordinates must be integers');
100
95
  }
101
- if (button === 'left') {
96
+ if (options.button === 'left') {
102
97
  button = 0;
103
98
  }
104
- if (button === 'middle') {
99
+ if (options.button === 'middle') {
105
100
  button = 1;
106
101
  }
107
- if (button === 'right') {
102
+ if (options.button === 'right') {
108
103
  button = 2;
109
104
  }
110
105
  if (![0, 1, 2].includes(button)) {
111
106
  throw new Error('Button type not supported.');
112
107
  }
113
108
  if (this.isW3C) {
114
- await this.performActions([{
115
- type: 'pointer',
116
- id: 'pointer1',
117
- parameters: {
118
- pointerType: 'mouse'
119
- },
120
- actions: [{
121
- type: 'pointerMove',
122
- origin: this,
123
- x: xoffset,
124
- y: yoffset
125
- }, {
126
- type: 'pointerDown',
127
- button
128
- }, {
129
- type: 'pointerUp',
130
- button
131
- }]
132
- }]);
133
- if (!skipRelease)
134
- await this.releaseActions().then(() => null, (err) => log.warn(`Failed to call "releaseAction" command due to: ${err.message}, ignoring!`));
109
+ const browser = getBrowserObject(this);
110
+ await browser.action('pointer', {
111
+ parameters: { pointerType: 'mouse' }
112
+ })
113
+ .move({
114
+ origin: this,
115
+ x: xoffset,
116
+ y: yoffset
117
+ })
118
+ .down({ button })
119
+ .up({ button })
120
+ .perform(skipRelease);
135
121
  return;
136
122
  }
137
123
  const { width, height } = await this.getElementSize(this.elementId);
138
124
  await this.moveToElement(this.elementId, xoffset + (width / 2), yoffset + (height / 2));
139
125
  return this.positionClick(button);
140
126
  }
141
- exports.default = click;
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getElementObject_1 = require("../../utils/getElementObject");
4
- const utils_1 = require("../../utils");
5
- const constants_1 = require("../../constants");
1
+ import { getElements } from '../../utils/getElementObject.js';
2
+ import { getBrowserObject, enhanceElementsArray } from '../../utils/index.js';
3
+ import { ELEMENT_KEY } from '../../constants.js';
6
4
  /**
7
5
  *
8
6
  * The `customs$$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
@@ -28,7 +26,7 @@ const constants_1 = require("../../constants");
28
26
  * @return {ElementArray}
29
27
  */
30
28
  async function custom$$(strategyName, ...strategyArguments) {
31
- const browserObject = (0, utils_1.getBrowserObject)(this);
29
+ const browserObject = getBrowserObject(this);
32
30
  const strategy = browserObject.strategies.get(strategyName);
33
31
  if (!strategy) {
34
32
  /* istanbul ignore next */
@@ -42,7 +40,7 @@ async function custom$$(strategyName, ...strategyArguments) {
42
40
  throw Error(`Can't call custom$ on element with selector "${this.selector}" because element wasn't found`);
43
41
  }
44
42
  const strategyRef = { strategy, strategyName, strategyArguments: [...strategyArguments, this] };
45
- let res = await this.execute(strategy, ...strategyArguments, this);
43
+ let res = await browserObject.execute(strategy, ...strategyArguments, this);
46
44
  /**
47
45
  * if the user's script return just one element
48
46
  * then we convert it to an array as this method
@@ -51,8 +49,8 @@ async function custom$$(strategyName, ...strategyArguments) {
51
49
  if (!Array.isArray(res)) {
52
50
  res = [res];
53
51
  }
54
- res = res.filter((el) => !!el && typeof el[constants_1.ELEMENT_KEY] === 'string');
55
- const elements = res.length ? await getElementObject_1.getElements.call(this, strategyRef, res) : [];
56
- return (0, utils_1.enhanceElementsArray)(elements, this, strategyName, 'custom$$', strategyArguments);
52
+ res = res.filter((el) => !!el && typeof el[ELEMENT_KEY] === 'string');
53
+ const elements = res.length ? await getElements.call(this, strategyRef, res) : [];
54
+ return enhanceElementsArray(elements, this, strategyName, 'custom$$', strategyArguments);
57
55
  }
58
- exports.default = custom$$;
56
+ export default custom$$;
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getElementObject_1 = require("../../utils/getElementObject");
4
- const utils_1 = require("../../utils");
5
- const constants_1 = require("../../constants");
1
+ import { getElement } from '../../utils/getElementObject.js';
2
+ import { getBrowserObject } from '../../utils/index.js';
3
+ import { ELEMENT_KEY } from '../../constants.js';
6
4
  /**
7
5
  *
8
6
  * The `custom$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
@@ -28,7 +26,7 @@ const constants_1 = require("../../constants");
28
26
  * @return {Element}
29
27
  */
30
28
  async function custom$(strategyName, ...strategyArguments) {
31
- const browserObject = (0, utils_1.getBrowserObject)(this);
29
+ const browserObject = getBrowserObject(this);
32
30
  const strategy = browserObject.strategies.get(strategyName);
33
31
  if (!strategy) {
34
32
  throw Error('No strategy found for ' + strategyName);
@@ -41,7 +39,7 @@ async function custom$(strategyName, ...strategyArguments) {
41
39
  throw Error(`Can't call custom$ on element with selector "${this.selector}" because element wasn't found`);
42
40
  }
43
41
  const strategyRef = { strategy, strategyName, strategyArguments: [...strategyArguments, this] };
44
- let res = await this.execute(strategy, ...strategyArguments, this);
42
+ let res = await browserObject.execute(strategy, ...strategyArguments, this);
45
43
  /**
46
44
  * if the user's script returns multiple elements
47
45
  * then we just return the first one as this method
@@ -50,9 +48,9 @@ async function custom$(strategyName, ...strategyArguments) {
50
48
  if (Array.isArray(res)) {
51
49
  res = res[0];
52
50
  }
53
- if (res && typeof res[constants_1.ELEMENT_KEY] === 'string') {
54
- return await getElementObject_1.getElement.call(this, strategyRef, res);
51
+ if (res && typeof res[ELEMENT_KEY] === 'string') {
52
+ return await getElement.call(this, strategyRef, res);
55
53
  }
56
54
  throw Error('Your locator strategy script must return an element');
57
55
  }
58
- exports.default = custom$;
56
+ export default custom$;
@@ -1 +1 @@
1
- {"version":3,"file":"doubleClick.d.ts","sourceRoot":"","sources":["../../../src/commands/element/doubleClick.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAA8B,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,iBAyBnE"}
1
+ {"version":3,"file":"doubleClick.d.ts","sourceRoot":"","sources":["../../../src/commands/element/doubleClick.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAA8B,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,iBAqBnE"}
@@ -1,5 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ import { getBrowserObject } from '../../utils/index.js';
3
2
  /**
4
3
  *
5
4
  * Double-click on an element.
@@ -23,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
22
  * @type action
24
23
  *
25
24
  */
26
- async function doubleClick() {
25
+ export default async function doubleClick() {
27
26
  /**
28
27
  * move to element
29
28
  */
@@ -34,18 +33,13 @@ async function doubleClick() {
34
33
  /**
35
34
  * W3C way of handle the double click actions
36
35
  */
37
- return this.performActions([{
38
- type: 'pointer',
39
- id: 'pointer1',
40
- parameters: { pointerType: 'mouse' },
41
- actions: [
42
- { type: 'pointerMove', origin: this, x: 0, y: 0 },
43
- { type: 'pointerDown', button: 0 },
44
- { type: 'pointerUp', button: 0 },
45
- { type: 'pause', duration: 10 },
46
- { type: 'pointerDown', button: 0 },
47
- { type: 'pointerUp', button: 0 }
48
- ]
49
- }]);
36
+ const browser = getBrowserObject(this);
37
+ return browser.action('pointer', { parameters: { pointerType: 'mouse' } })
38
+ .move({ origin: this })
39
+ .down()
40
+ .up()
41
+ .pause(10)
42
+ .down()
43
+ .up()
44
+ .perform();
50
45
  }
51
- exports.default = doubleClick;
@@ -1 +1 @@
1
- {"version":3,"file":"dragAndDrop.d.ts","sourceRoot":"","sources":["../../../src/commands/element/dragAndDrop.ts"],"names":[],"mappings":"AAOA,aAAK,kBAAkB,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,aAAK,kBAAkB,GAAG;IACtB,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAA8B,WAAW,CACrC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,WAAW,CAAC,OAAO,GAAG,kBAAkB,EAChD,EAAE,QAAa,EAAE,GAAE,kBAAuB,iBAyE7C"}
1
+ {"version":3,"file":"dragAndDrop.d.ts","sourceRoot":"","sources":["../../../src/commands/element/dragAndDrop.ts"],"names":[],"mappings":"AAQA,aAAK,kBAAkB,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,aAAK,kBAAkB,GAAG;IACtB,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAA8B,WAAW,CACrC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,WAAW,CAAC,OAAO,GAAG,kBAAkB,EAChD,EAAE,QAAa,EAAE,GAAE,kBAAuB,iBAqE7C"}
@@ -1,6 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const constants_1 = require("../../constants");
1
+ import { ELEMENT_KEY } from '../../constants.js';
2
+ import { getBrowserObject } from '../../utils/index.js';
4
3
  const ACTION_BUTTON = 0;
5
4
  const sleep = (time = 0) => new Promise((resolve) => setTimeout(resolve, time));
6
5
  /**
@@ -34,7 +33,7 @@ const sleep = (time = 0) => new Promise((resolve) => setTimeout(resolve, time));
34
33
  * @param {DragAndDropOptions=} options dragAndDrop command options
35
34
  * @param {Number=} options.duration how long the drag should take place
36
35
  */
37
- async function dragAndDrop(target, { duration = 10 } = {}) {
36
+ export default async function dragAndDrop(target, { duration = 10 } = {}) {
38
37
  const moveToCoordinates = target;
39
38
  const moveToElement = target;
40
39
  /**
@@ -73,8 +72,8 @@ async function dragAndDrop(target, { duration = 10 } = {}) {
73
72
  await sleep(duration);
74
73
  return this.buttonUp(ACTION_BUTTON);
75
74
  }
76
- const sourceRef = { [constants_1.ELEMENT_KEY]: this[constants_1.ELEMENT_KEY] };
77
- const targetRef = { [constants_1.ELEMENT_KEY]: moveToElement[constants_1.ELEMENT_KEY] };
75
+ const sourceRef = { [ELEMENT_KEY]: this[ELEMENT_KEY] };
76
+ const targetRef = { [ELEMENT_KEY]: moveToElement[ELEMENT_KEY] };
78
77
  const origin = sourceRef;
79
78
  const targetOrigin = isMovingToElement ? targetRef : 'pointer';
80
79
  const targetX = isMovingToElement ? 0 : moveToCoordinates.x;
@@ -82,17 +81,12 @@ async function dragAndDrop(target, { duration = 10 } = {}) {
82
81
  /**
83
82
  * W3C way of handle the drag and drop action
84
83
  */
85
- return this.performActions([{
86
- type: 'pointer',
87
- id: 'finger1',
88
- parameters: { pointerType: 'mouse' },
89
- actions: [
90
- { type: 'pointerMove', duration: 0, origin, x: 0, y: 0 },
91
- { type: 'pointerDown', button: ACTION_BUTTON },
92
- { type: 'pause', duration: 10 },
93
- { type: 'pointerMove', duration, origin: targetOrigin, x: targetX, y: targetY },
94
- { type: 'pointerUp', button: ACTION_BUTTON }
95
- ]
96
- }]).then(() => this.releaseActions());
84
+ const browser = getBrowserObject(this);
85
+ return browser.action('pointer')
86
+ .move({ duration: 0, origin, x: 0, y: 0 })
87
+ .down({ button: ACTION_BUTTON })
88
+ .pause(10)
89
+ .move({ duration, origin: targetOrigin, x: targetX, y: targetY })
90
+ .up({ button: ACTION_BUTTON })
91
+ .perform();
97
92
  }
98
- exports.default = dragAndDrop;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Get an attribute from a DOM-element based on the attribute name.
@@ -26,7 +24,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
24
  * @type property
27
25
  *
28
26
  */
29
- function getAttribute(attributeName) {
27
+ export default function getAttribute(attributeName) {
30
28
  return this.getElementAttribute(this.elementId, attributeName);
31
29
  }
32
- exports.default = getAttribute;
@@ -67,5 +67,5 @@
67
67
  * @return {CSSProperty} The specified css of the element
68
68
  *
69
69
  */
70
- export default function getCSSProperty(this: WebdriverIO.Element, cssProperty: string): Promise<import("../..").ParsedCSSValue>;
70
+ export default function getCSSProperty(this: WebdriverIO.Element, cssProperty: string): Promise<import("../../types.js").ParsedCSSValue>;
71
71
  //# sourceMappingURL=getCSSProperty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCSSProperty.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getCSSProperty.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,wBAA8B,cAAc,CACxC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,WAAW,EAAE,MAAM,2CAsCtB"}
1
+ {"version":3,"file":"getCSSProperty.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getCSSProperty.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,wBAA8B,cAAc,CACxC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,WAAW,EAAE,MAAM,oDAsCtB"}
@@ -1,10 +1,5 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const css_shorthand_properties_1 = __importDefault(require("css-shorthand-properties"));
7
- const utils_1 = require("../../utils");
1
+ import cssShorthandProps from 'css-shorthand-properties';
2
+ import { parseCSS } from '../../utils/index.js';
8
3
  /**
9
4
  *
10
5
  * Get a css property from a DOM-element selected by given selector. The return value
@@ -74,18 +69,18 @@ const utils_1 = require("../../utils");
74
69
  * @return {CSSProperty} The specified css of the element
75
70
  *
76
71
  */
77
- async function getCSSProperty(cssProperty) {
72
+ export default async function getCSSProperty(cssProperty) {
78
73
  /**
79
74
  * Getting the css value of a shorthand property results in different results
80
75
  * given that the behavior of `getComputedStyle` is not defined in this case.
81
76
  * Therefore if we don't deal with a shorthand property run `getElementCSSValue`
82
77
  * otherwise expand it and run the command for each longhand property.
83
78
  */
84
- if (!css_shorthand_properties_1.default.isShorthand(cssProperty)) {
79
+ if (!cssShorthandProps.isShorthand(cssProperty)) {
85
80
  const cssValue = await this.getElementCSSValue(this.elementId, cssProperty);
86
- return (0, utils_1.parseCSS)(cssValue, cssProperty);
81
+ return parseCSS(cssValue, cssProperty);
87
82
  }
88
- const properties = css_shorthand_properties_1.default.expand(cssProperty);
83
+ const properties = cssShorthandProps.expand(cssProperty);
89
84
  let cssValues = await Promise.all(properties.map((prop) => this.getElementCSSValue(this.elementId, prop)));
90
85
  /**
91
86
  * merge equal symmetrical values
@@ -103,6 +98,5 @@ async function getCSSProperty(cssProperty) {
103
98
  }
104
99
  cssValues = cssValues.slice(0, cssValues.length / 2);
105
100
  }
106
- return (0, utils_1.parseCSS)(cssValues.join(' '), cssProperty);
101
+ return parseCSS(cssValues.join(' '), cssProperty);
107
102
  }
108
- exports.default = getCSSProperty;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Get the computed WAI-ARIA label of an element.
@@ -18,7 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
16
  * @type property
19
17
  *
20
18
  */
21
- function getComputedLabel() {
19
+ export default function getComputedLabel() {
22
20
  return this.getElementComputedLabel(this.elementId);
23
21
  }
24
- exports.default = getComputedLabel;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Get the computed WAI-ARIA label of an element.
@@ -18,7 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
16
  * @type property
19
17
  *
20
18
  */
21
- function getComputedRole() {
19
+ export default function getComputedRole() {
22
20
  return this.getElementComputedRole(this.elementId);
23
21
  }
24
- exports.default = getComputedRole;
@@ -1,11 +1,6 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const constants_1 = require("../../constants");
7
- const utils_1 = require("../../utils");
8
- const getHTML_1 = __importDefault(require("../../scripts/getHTML"));
1
+ import { ELEMENT_KEY } from '../../constants.js';
2
+ import { getBrowserObject } from '../../utils/index.js';
3
+ import getHTMLScript from '../../scripts/getHTML.js';
9
4
  /**
10
5
  *
11
6
  * Get source code of specified DOM element by selector.
@@ -36,11 +31,10 @@ const getHTML_1 = __importDefault(require("../../scripts/getHTML"));
36
31
  * @type property
37
32
  *
38
33
  */
39
- function getHTML(includeSelectorTag = true) {
40
- const browser = (0, utils_1.getBrowserObject)(this);
41
- return browser.execute(getHTML_1.default, {
42
- [constants_1.ELEMENT_KEY]: this.elementId,
34
+ export default function getHTML(includeSelectorTag = true) {
35
+ const browser = getBrowserObject(this);
36
+ return browser.execute(getHTMLScript, {
37
+ [ELEMENT_KEY]: this.elementId,
43
38
  ELEMENT: this.elementId // jsonwp compatible
44
39
  }, includeSelectorTag);
45
40
  }
46
- exports.default = getHTML;
@@ -1,6 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../../utils");
1
+ import { getElementRect } from '../../utils/index.js';
4
2
  /**
5
3
  *
6
4
  * Determine an element’s location on the page. The point (0, 0) refers to
@@ -31,7 +29,7 @@ const utils_1 = require("../../utils");
31
29
  async function getLocation(prop) {
32
30
  let location = {};
33
31
  if (this.isW3C) {
34
- location = await (0, utils_1.getElementRect)(this);
32
+ location = await getElementRect(this);
35
33
  delete location.width;
36
34
  delete location.height;
37
35
  }
@@ -43,4 +41,4 @@ async function getLocation(prop) {
43
41
  }
44
42
  return location;
45
43
  }
46
- exports.default = getLocation;
44
+ export default getLocation;
@@ -14,17 +14,17 @@
14
14
  * @param {String} property name of the element property
15
15
  * @return {Object|String|Boolean|Number|null} the value of the property of the selected element
16
16
  */
17
- export default function getProperty(this: WebdriverIO.Element, property: string): Promise<string | number | boolean | HTMLElement | Element | ChildNode | ParentNode | (() => DOMRect) | Document | ((event: Event) => boolean) | ((this: GlobalEventHandlers, ev: UIEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: FocusEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | OnErrorEventHandler | ((this: GlobalEventHandlers, ev: FocusEvent) => any) | ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: UIEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: WheelEvent) => any) | (() => ElementInternals) | (() => void) | {
17
+ export default function getProperty(this: WebdriverIO.Element, property: string): Promise<string | number | boolean | HTMLElement | Element | ChildNode | ParentNode | (() => ElementInternals) | (() => void) | {
18
18
  <K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
19
19
  (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
20
20
  } | {
21
21
  <K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
22
22
  (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
23
- } | NamedNodeMap | DOMTokenList | ((this: Element, ev: Event) => any) | ((this: Element, ev: Event) => any) | ShadowRoot | ((init: ShadowRootInit) => ShadowRoot) | {
23
+ } | NamedNodeMap | DOMTokenList | ((this: Element, ev: Event) => any) | ((this: Element, ev: Event) => any) | Document | ShadowRoot | ((init: ShadowRootInit) => ShadowRoot) | {
24
24
  <K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
25
25
  <K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
26
26
  <E extends Element = Element>(selectors: string): E | null;
27
- } | ((qualifiedName: string) => string | null) | ((namespace: string | null, localName: string) => string | null) | (() => string[]) | ((qualifiedName: string) => Attr | null) | ((namespace: string | null, localName: string) => Attr | null) | (() => DOMRectList) | ((classNames: string) => HTMLCollectionOf<Element>) | {
27
+ } | ((qualifiedName: string) => string | null) | ((namespace: string | null, localName: string) => string | null) | (() => string[]) | ((qualifiedName: string) => Attr | null) | ((namespace: string | null, localName: string) => Attr | null) | (() => DOMRect) | (() => DOMRectList) | ((classNames: string) => HTMLCollectionOf<Element>) | {
28
28
  <K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
29
29
  <K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
30
30
  (qualifiedName: string): HTMLCollectionOf<Element>;
@@ -41,7 +41,7 @@ export default function getProperty(this: WebdriverIO.Element, property: string)
41
41
  } | ((arg?: boolean | ScrollIntoViewOptions | undefined) => void) | {
42
42
  (options?: ScrollToOptions | undefined): void;
43
43
  (x: number, y: number): void;
44
- } | ((qualifiedName: string, value: string) => void) | ((namespace: string | null, qualifiedName: string, value: string) => void) | ((attr: Attr) => Attr | null) | ((attr: Attr) => Attr | null) | ((pointerId: number) => void) | ((qualifiedName: string, force?: boolean | undefined) => boolean) | ((selectors: string) => boolean) | NodeListOf<ChildNode> | (<T extends Node>(node: T) => T) | ((deep?: boolean | undefined) => Node) | ((other: Node) => number) | ((other: Node | null) => boolean) | ((options?: GetRootNodeOptions | undefined) => Node) | (() => boolean) | (<T_1 extends Node>(node: T_1, child: Node | null) => T_1) | ((namespace: string | null) => boolean) | ((otherNode: Node | null) => boolean) | ((otherNode: Node | null) => boolean) | ((prefix: string | null) => string | null) | ((namespace: string | null) => string | null) | (() => void) | (<T_2 extends Node>(child: T_2) => T_2) | (<T_3 extends Node>(node: Node, child: T_3) => T_3) | ((keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions | undefined) => Animation) | ((options?: GetAnimationsOptions | undefined) => Animation[]) | ((...nodes: (string | Node)[]) => void) | ((...nodes: (string | Node)[]) => void) | (() => void) | ((...nodes: (string | Node)[]) => void) | HTMLCollection | ((...nodes: (string | Node)[]) => void) | ((...nodes: (string | Node)[]) => void) | {
44
+ } | ((qualifiedName: string, value: string) => void) | ((namespace: string | null, qualifiedName: string, value: string) => void) | ((attr: Attr) => Attr | null) | ((attr: Attr) => Attr | null) | ((pointerId: number) => void) | ((qualifiedName: string, force?: boolean | undefined) => boolean) | ((selectors: string) => boolean) | NodeListOf<ChildNode> | (<T extends Node>(node: T) => T) | ((deep?: boolean | undefined) => Node) | ((other: Node) => number) | ((other: Node | null) => boolean) | ((options?: GetRootNodeOptions | undefined) => Node) | (() => boolean) | (<T_1 extends Node>(node: T_1, child: Node | null) => T_1) | ((namespace: string | null) => boolean) | ((otherNode: Node | null) => boolean) | ((otherNode: Node | null) => boolean) | ((prefix: string | null) => string | null) | ((namespace: string | null) => string | null) | (() => void) | (<T_2 extends Node>(child: T_2) => T_2) | (<T_3 extends Node>(node: Node, child: T_3) => T_3) | ((event: Event) => boolean) | ((keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions | undefined) => Animation) | ((options?: GetAnimationsOptions | undefined) => Animation[]) | ((...nodes: (string | Node)[]) => void) | ((...nodes: (string | Node)[]) => void) | (() => void) | ((...nodes: (string | Node)[]) => void) | HTMLCollection | ((...nodes: (string | Node)[]) => void) | ((...nodes: (string | Node)[]) => void) | {
45
45
  <K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
46
46
  <K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
47
47
  <E_1 extends Element = Element>(selectors: string): E_1 | null;
@@ -49,5 +49,5 @@ export default function getProperty(this: WebdriverIO.Element, property: string)
49
49
  <K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
50
50
  <K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
51
51
  <E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
52
- } | ((...nodes: (string | Node)[]) => void) | HTMLSlotElement | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | CSSStyleDeclaration | DOMStringMap | (() => void) | ((options?: FocusOptions | undefined) => void) | undefined>;
52
+ } | ((...nodes: (string | Node)[]) => void) | HTMLSlotElement | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | CSSStyleDeclaration | ((this: GlobalEventHandlers, ev: UIEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: FocusEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: DragEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | OnErrorEventHandler | ((this: GlobalEventHandlers, ev: FocusEvent) => any) | ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: MouseEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: PointerEvent) => any) | ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: UIEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TouchEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: Event) => any) | ((this: GlobalEventHandlers, ev: WheelEvent) => any) | DOMStringMap | (() => void) | ((options?: FocusOptions | undefined) => void) | undefined>;
53
53
  //# sourceMappingURL=getProperty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getProperty.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getProperty.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qYAYnB"}
1
+ {"version":3,"file":"getProperty.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getProperty.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yiKAYnB"}
@@ -1,10 +1,5 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const getProperty_1 = __importDefault(require("../../scripts/getProperty"));
1
+ import { getBrowserObject } from '../../utils/index.js';
2
+ import getPropertyScript from '../../scripts/getProperty.js';
8
3
  /**
9
4
  * The Get Element Property command will return the result of getting a property of an element.
10
5
  *
@@ -21,11 +16,10 @@ const getProperty_1 = __importDefault(require("../../scripts/getProperty"));
21
16
  * @param {String} property name of the element property
22
17
  * @return {Object|String|Boolean|Number|null} the value of the property of the selected element
23
18
  */
24
- function getProperty(property) {
19
+ export default function getProperty(property) {
25
20
  if (this.isW3C) {
26
21
  return this.getElementProperty(this.elementId, property);
27
22
  }
28
- const browser = (0, utils_1.getBrowserObject)(this);
29
- return browser.execute(getProperty_1.default, { ELEMENT: this.elementId }, property);
23
+ const browser = getBrowserObject(this);
24
+ return browser.execute(getPropertyScript, { ELEMENT: this.elementId }, property);
30
25
  }
31
- exports.default = getProperty;
@@ -1,6 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../../utils");
1
+ import { getElementRect } from '../../utils/index.js';
4
2
  /**
5
3
  *
6
4
  * Get the width and height for an DOM-element.
@@ -31,7 +29,7 @@ const utils_1 = require("../../utils");
31
29
  async function getSize(prop) {
32
30
  let rect = {};
33
31
  if (this.isW3C) {
34
- rect = await (0, utils_1.getElementRect)(this);
32
+ rect = await getElementRect(this);
35
33
  }
36
34
  else {
37
35
  rect = await this.getElementSize(this.elementId);
@@ -44,4 +42,4 @@ async function getSize(prop) {
44
42
  height: rect.height
45
43
  };
46
44
  }
47
- exports.default = getSize;
45
+ export default getSize;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Get tag name of a DOM-element.
@@ -23,7 +21,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
21
  * @type property
24
22
  *
25
23
  */
26
- function getTagName() {
24
+ export default function getTagName() {
27
25
  return this.getElementTagName(this.elementId);
28
26
  }
29
- exports.default = getTagName;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Get the text content from a DOM-element. Make sure the element
@@ -40,7 +38,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
40
38
  * @type property
41
39
  *
42
40
  */
43
- function getText() {
41
+ export default function getText() {
44
42
  return this.getElementText(this.elementId);
45
43
  }
46
- exports.default = getText;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Get the value of a `<textarea>`, `<select>` or text `<input>` found by given selector.
@@ -23,11 +21,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
21
  * @type property
24
22
  *
25
23
  */
26
- function getValue() {
24
+ export default function getValue() {
27
25
  // `!this.isMobile` added to workaround https://github.com/appium/appium/issues/12218
28
26
  if (this.isW3C && !this.isMobile) {
29
27
  return this.getElementProperty(this.elementId, 'value');
30
28
  }
31
29
  return this.getElementAttribute(this.elementId, 'value');
32
30
  }
33
- exports.default = getValue;
@@ -1 +1 @@
1
- {"version":3,"file":"isClickable.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isClickable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAA8B,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAUnE"}
1
+ {"version":3,"file":"isClickable.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isClickable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAA8B,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAcnE"}