webdriverio 7.21.0 → 8.0.0-alpha.239

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 (211) 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/$$.js +6 -9
  6. package/build/commands/browser/$.js +8 -11
  7. package/build/commands/browser/action.d.ts +128 -0
  8. package/build/commands/browser/action.d.ts.map +1 -0
  9. package/build/commands/browser/action.js +13 -0
  10. package/build/commands/browser/actions.d.ts +29 -0
  11. package/build/commands/browser/actions.d.ts.map +1 -0
  12. package/build/commands/browser/actions.js +30 -0
  13. package/build/commands/browser/call.js +1 -4
  14. package/build/commands/browser/custom$$.js +7 -10
  15. package/build/commands/browser/custom$.js +5 -8
  16. package/build/commands/browser/debug.js +8 -14
  17. package/build/commands/browser/deleteCookies.js +1 -4
  18. package/build/commands/browser/execute.js +3 -6
  19. package/build/commands/browser/executeAsync.js +3 -6
  20. package/build/commands/browser/getCookies.js +1 -4
  21. package/build/commands/browser/getPuppeteer.d.ts +1 -1
  22. package/build/commands/browser/getPuppeteer.d.ts.map +1 -1
  23. package/build/commands/browser/getPuppeteer.js +14 -21
  24. package/build/commands/browser/getWindowSize.js +3 -6
  25. package/build/commands/browser/keys.d.ts +20 -10
  26. package/build/commands/browser/keys.d.ts.map +1 -1
  27. package/build/commands/browser/keys.js +29 -24
  28. package/build/commands/browser/mock.d.ts +1 -1
  29. package/build/commands/browser/mock.d.ts.map +1 -1
  30. package/build/commands/browser/mock.js +12 -19
  31. package/build/commands/browser/mockClearAll.js +5 -11
  32. package/build/commands/browser/mockRestoreAll.js +5 -11
  33. package/build/commands/browser/newWindow.js +5 -11
  34. package/build/commands/browser/pause.js +1 -4
  35. package/build/commands/browser/react$$.d.ts.map +1 -1
  36. package/build/commands/browser/react$$.js +12 -16
  37. package/build/commands/browser/react$.d.ts.map +1 -1
  38. package/build/commands/browser/react$.js +10 -14
  39. package/build/commands/browser/reloadSession.js +5 -12
  40. package/build/commands/browser/savePDF.js +7 -13
  41. package/build/commands/browser/saveRecordingScreen.js +6 -12
  42. package/build/commands/browser/saveScreenshot.js +6 -12
  43. package/build/commands/browser/scroll.d.ts +25 -0
  44. package/build/commands/browser/scroll.d.ts.map +1 -0
  45. package/build/commands/browser/scroll.js +41 -0
  46. package/build/commands/browser/setCookies.js +1 -4
  47. package/build/commands/browser/setTimeout.js +1 -4
  48. package/build/commands/browser/setWindowSize.js +3 -6
  49. package/build/commands/browser/switchWindow.js +1 -4
  50. package/build/commands/browser/throttle.js +3 -6
  51. package/build/commands/browser/touchAction.d.ts +1 -1
  52. package/build/commands/browser/touchAction.d.ts.map +1 -1
  53. package/build/commands/browser/touchAction.js +3 -6
  54. package/build/commands/browser/uploadFile.d.ts +1 -1
  55. package/build/commands/browser/uploadFile.d.ts.map +1 -1
  56. package/build/commands/browser/uploadFile.js +10 -15
  57. package/build/commands/browser/url.js +3 -6
  58. package/build/commands/browser/waitUntil.js +3 -9
  59. package/build/commands/browser.d.ts +39 -33
  60. package/build/commands/browser.d.ts.map +1 -1
  61. package/build/commands/browser.js +42 -43
  62. package/build/commands/constant.d.ts +1 -1
  63. package/build/commands/constant.d.ts.map +1 -1
  64. package/build/commands/constant.js +6 -12
  65. package/build/commands/element/$$.d.ts +1 -1
  66. package/build/commands/element/$$.d.ts.map +1 -1
  67. package/build/commands/element/$$.js +2 -7
  68. package/build/commands/element/$.d.ts +1 -1
  69. package/build/commands/element/$.d.ts.map +1 -1
  70. package/build/commands/element/$.js +2 -7
  71. package/build/commands/element/addValue.d.ts +10 -14
  72. package/build/commands/element/addValue.d.ts.map +1 -1
  73. package/build/commands/element/addValue.js +23 -27
  74. package/build/commands/element/clearValue.d.ts +1 -1
  75. package/build/commands/element/clearValue.js +2 -5
  76. package/build/commands/element/click.d.ts +1 -1
  77. package/build/commands/element/click.d.ts.map +1 -1
  78. package/build/commands/element/click.js +19 -34
  79. package/build/commands/element/custom$$.js +9 -11
  80. package/build/commands/element/custom$.js +8 -10
  81. package/build/commands/element/doubleClick.d.ts.map +1 -1
  82. package/build/commands/element/doubleClick.js +11 -17
  83. package/build/commands/element/dragAndDrop.d.ts.map +1 -1
  84. package/build/commands/element/dragAndDrop.js +13 -19
  85. package/build/commands/element/getAttribute.js +1 -4
  86. package/build/commands/element/getCSSProperty.d.ts +1 -1
  87. package/build/commands/element/getCSSProperty.d.ts.map +1 -1
  88. package/build/commands/element/getCSSProperty.js +7 -13
  89. package/build/commands/element/getComputedLabel.js +1 -4
  90. package/build/commands/element/getComputedRole.js +1 -4
  91. package/build/commands/element/getHTML.js +7 -13
  92. package/build/commands/element/getLocation.js +3 -5
  93. package/build/commands/element/getProperty.d.ts +8 -8
  94. package/build/commands/element/getProperty.d.ts.map +1 -1
  95. package/build/commands/element/getProperty.js +5 -11
  96. package/build/commands/element/getSize.js +3 -5
  97. package/build/commands/element/getTagName.js +1 -4
  98. package/build/commands/element/getText.js +1 -4
  99. package/build/commands/element/getValue.js +1 -4
  100. package/build/commands/element/isClickable.js +7 -13
  101. package/build/commands/element/isDisplayed.js +9 -16
  102. package/build/commands/element/isDisplayedInViewport.js +7 -13
  103. package/build/commands/element/isEnabled.js +1 -4
  104. package/build/commands/element/isEqual.d.ts.map +1 -1
  105. package/build/commands/element/isEqual.js +9 -9
  106. package/build/commands/element/isExisting.js +1 -4
  107. package/build/commands/element/isFocused.js +7 -13
  108. package/build/commands/element/isSelected.js +1 -4
  109. package/build/commands/element/moveTo.d.ts.map +1 -1
  110. package/build/commands/element/moveTo.js +8 -13
  111. package/build/commands/element/nextElement.js +2 -5
  112. package/build/commands/element/parentElement.js +2 -5
  113. package/build/commands/element/previousElement.js +2 -5
  114. package/build/commands/element/react$$.d.ts.map +1 -1
  115. package/build/commands/element/react$$.js +13 -16
  116. package/build/commands/element/react$.d.ts.map +1 -1
  117. package/build/commands/element/react$.js +12 -14
  118. package/build/commands/element/saveScreenshot.js +6 -12
  119. package/build/commands/element/scrollIntoView.d.ts +3 -2
  120. package/build/commands/element/scrollIntoView.d.ts.map +1 -1
  121. package/build/commands/element/scrollIntoView.js +32 -12
  122. package/build/commands/element/selectByAttribute.js +3 -6
  123. package/build/commands/element/selectByIndex.js +3 -6
  124. package/build/commands/element/selectByVisibleText.js +3 -6
  125. package/build/commands/element/setValue.d.ts +13 -14
  126. package/build/commands/element/setValue.d.ts.map +1 -1
  127. package/build/commands/element/setValue.js +14 -17
  128. package/build/commands/element/shadow$$.d.ts +1 -1
  129. package/build/commands/element/shadow$$.d.ts.map +1 -1
  130. package/build/commands/element/shadow$$.js +3 -6
  131. package/build/commands/element/shadow$.js +3 -6
  132. package/build/commands/element/touchAction.js +3 -6
  133. package/build/commands/element/waitForClickable.js +1 -4
  134. package/build/commands/element/waitForDisplayed.js +1 -4
  135. package/build/commands/element/waitForEnabled.js +1 -4
  136. package/build/commands/element/waitForExist.js +1 -4
  137. package/build/commands/element/waitUntil.d.ts +1 -1
  138. package/build/commands/element/waitUntil.d.ts.map +1 -1
  139. package/build/commands/element/waitUntil.js +2 -7
  140. package/build/commands/element.d.ts +48 -48
  141. package/build/commands/element.d.ts.map +1 -1
  142. package/build/commands/element.js +57 -62
  143. package/build/constants.d.ts +66 -0
  144. package/build/constants.d.ts.map +1 -1
  145. package/build/constants.js +91 -12
  146. package/build/index.d.ts +64 -5
  147. package/build/index.d.ts.map +1 -1
  148. package/build/index.js +47 -85
  149. package/build/middlewares.d.ts +1 -1
  150. package/build/middlewares.js +11 -19
  151. package/build/multiremote.js +12 -20
  152. package/build/protocol-stub.d.ts.map +1 -1
  153. package/build/protocol-stub.js +4 -6
  154. package/build/scripts/getHTML.js +1 -4
  155. package/build/scripts/getProperty.d.ts +8 -8
  156. package/build/scripts/getProperty.d.ts.map +1 -1
  157. package/build/scripts/getProperty.js +1 -4
  158. package/build/scripts/isElementClickable.js +1 -4
  159. package/build/scripts/isElementDisplayed.js +1 -4
  160. package/build/scripts/isElementInViewport.js +1 -4
  161. package/build/scripts/isFocused.js +1 -4
  162. package/build/scripts/newWindow.js +1 -4
  163. package/build/scripts/resq.js +3 -9
  164. package/build/scripts/shadowFnFactory.js +2 -6
  165. package/build/types.d.ts +1 -5
  166. package/build/types.d.ts.map +1 -1
  167. package/build/types.js +1 -2
  168. package/build/utils/SevereServiceError.js +1 -4
  169. package/build/utils/Timer.d.ts.map +1 -1
  170. package/build/utils/Timer.js +1 -25
  171. package/build/utils/actions/base.d.ts +32 -0
  172. package/build/utils/actions/base.d.ts.map +1 -0
  173. package/build/utils/actions/base.js +78 -0
  174. package/build/utils/actions/index.d.ts +6 -0
  175. package/build/utils/actions/index.d.ts.map +1 -0
  176. package/build/utils/actions/index.js +5 -0
  177. package/build/utils/actions/key.d.ts +15 -0
  178. package/build/utils/actions/key.d.ts.map +1 -0
  179. package/build/utils/actions/key.js +22 -0
  180. package/build/utils/actions/pointer.d.ts +62 -0
  181. package/build/utils/actions/pointer.d.ts.map +1 -0
  182. package/build/utils/actions/pointer.js +76 -0
  183. package/build/utils/actions/wheel.d.ts +36 -0
  184. package/build/utils/actions/wheel.d.ts.map +1 -0
  185. package/build/utils/actions/wheel.js +20 -0
  186. package/build/utils/detectBackend.d.ts +1 -1
  187. package/build/utils/detectBackend.d.ts.map +1 -1
  188. package/build/utils/detectBackend.js +3 -7
  189. package/build/utils/findStrategy.js +11 -19
  190. package/build/utils/getElementObject.d.ts.map +1 -1
  191. package/build/utils/getElementObject.js +42 -31
  192. package/build/utils/implicitWait.js +3 -9
  193. package/build/utils/index.d.ts +2 -6
  194. package/build/utils/index.d.ts.map +1 -1
  195. package/build/utils/index.js +92 -142
  196. package/build/utils/interception/devtools.d.ts +1 -1
  197. package/build/utils/interception/devtools.d.ts.map +1 -1
  198. package/build/utils/interception/devtools.js +17 -23
  199. package/build/utils/interception/index.d.ts +2 -2
  200. package/build/utils/interception/index.d.ts.map +1 -1
  201. package/build/utils/interception/index.js +5 -11
  202. package/build/utils/interception/types.d.ts +1 -1
  203. package/build/utils/interception/types.d.ts.map +1 -1
  204. package/build/utils/interception/types.js +1 -2
  205. package/build/utils/interception/webdriver.d.ts +1 -1
  206. package/build/utils/interception/webdriver.d.ts.map +1 -1
  207. package/build/utils/interception/webdriver.js +5 -11
  208. package/build/utils/refetchElement.js +3 -9
  209. package/package.json +22 -11
  210. package/async.d.ts +0 -24
  211. package/sync.d.ts +0 -24
@@ -14,17 +14,20 @@
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 | ((...nodes: (string | Node)[]) => void) | ((...nodes: (string | Node)[]) => void) | {
18
+ (options?: ScrollToOptions | undefined): void;
19
+ (x: number, y: number): void;
20
+ } | (() => void) | ((qualifiedName: string) => string | null) | ((arg?: boolean | ScrollIntoViewOptions | undefined) => void) | (() => void) | (() => ElementInternals) | {
18
21
  <K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
19
22
  (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
20
23
  } | {
21
24
  <K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
22
25
  (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) | {
26
+ } | NamedNodeMap | DOMTokenList | ((this: Element, ev: Event) => any) | ((this: Element, ev: Event) => any) | Document | ShadowRoot | ((init: ShadowRootInit) => ShadowRoot) | {
24
27
  <K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
25
28
  <K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
26
29
  <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>) | {
30
+ } | ((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
31
  <K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
29
32
  <K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
30
33
  (qualifiedName: string): HTMLCollectionOf<Element>;
@@ -38,10 +41,7 @@ export default function getProperty(this: WebdriverIO.Element, property: string)
38
41
  } | {
39
42
  (options?: ScrollToOptions | undefined): void;
40
43
  (x: number, y: number): void;
41
- } | ((arg?: boolean | ScrollIntoViewOptions | undefined) => void) | {
42
- (options?: ScrollToOptions | undefined): void;
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) | (<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[]) | (() => 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,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 isElementClickable_1 = __importDefault(require("../../scripts/isElementClickable"));
1
+ import { ELEMENT_KEY } from '../../constants.js';
2
+ import { getBrowserObject } from '../../utils/index.js';
3
+ import isElementClickableScript from '../../scripts/isElementClickable.js';
9
4
  /**
10
5
  *
11
6
  * Return true if the selected DOM-element:
@@ -44,14 +39,13 @@ const isElementClickable_1 = __importDefault(require("../../scripts/isElementCli
44
39
  * @type state
45
40
  *
46
41
  */
47
- async function isClickable() {
42
+ export default async function isClickable() {
48
43
  if (!await this.isDisplayed()) {
49
44
  return false;
50
45
  }
51
- const browser = (0, utils_1.getBrowserObject)(this);
52
- return browser.execute(isElementClickable_1.default, {
53
- [constants_1.ELEMENT_KEY]: this.elementId,
46
+ const browser = getBrowserObject(this);
47
+ return browser.execute(isElementClickableScript, {
48
+ [ELEMENT_KEY]: this.elementId,
54
49
  ELEMENT: this.elementId // jsonwp compatible
55
50
  });
56
51
  }
57
- exports.default = isClickable;
@@ -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 isElementDisplayed_1 = __importDefault(require("../../scripts/isElementDisplayed"));
1
+ import { ELEMENT_KEY } from '../../constants.js';
2
+ import { getBrowserObject, hasElementId } from '../../utils/index.js';
3
+ import isElementDisplayedScript from '../../scripts/isElementDisplayed.js';
9
4
  const noW3CEndpoint = ['microsoftedge', 'msedge', 'safari', 'chrome', 'safari technology preview'];
10
5
  /**
11
6
  *
@@ -55,10 +50,9 @@ const noW3CEndpoint = ['microsoftedge', 'msedge', 'safari', 'chrome', 'safari te
55
50
  * @type state
56
51
  *
57
52
  */
58
- async function isDisplayed() {
59
- var _a;
60
- const browser = (0, utils_1.getBrowserObject)(this);
61
- if (!await (0, utils_1.hasElementId)(this)) {
53
+ export default async function isDisplayed() {
54
+ const browser = getBrowserObject(this);
55
+ if (!await hasElementId(this)) {
62
56
  return false;
63
57
  }
64
58
  /*
@@ -74,12 +68,11 @@ async function isDisplayed() {
74
68
  const useAtom = (await browser.isDevTools ||
75
69
  (await browser.isW3C &&
76
70
  !browser.isMobile &&
77
- noW3CEndpoint.includes((_a = browser.capabilities.browserName) === null || _a === void 0 ? void 0 : _a.toLowerCase())));
71
+ noW3CEndpoint.includes(browser.capabilities.browserName?.toLowerCase())));
78
72
  return useAtom
79
- ? await browser.execute(isElementDisplayed_1.default, {
80
- [constants_1.ELEMENT_KEY]: this.elementId,
73
+ ? await browser.execute(isElementDisplayedScript, {
74
+ [ELEMENT_KEY]: this.elementId,
81
75
  ELEMENT: this.elementId // jsonwp compatible
82
76
  }) :
83
77
  await this.isElementDisplayed(this.elementId);
84
78
  }
85
- exports.default = isDisplayed;
@@ -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 isElementInViewport_1 = __importDefault(require("../../scripts/isElementInViewport"));
1
+ import { ELEMENT_KEY } from '../../constants.js';
2
+ import { getBrowserObject } from '../../utils/index.js';
3
+ import isElementInViewportScript from '../../scripts/isElementInViewport.js';
9
4
  /**
10
5
  *
11
6
  * Return true if the selected DOM-element found by given selector is partially visible and within the viewport.
@@ -42,14 +37,13 @@ const isElementInViewport_1 = __importDefault(require("../../scripts/isElementIn
42
37
  * @type state
43
38
  *
44
39
  */
45
- async function isDisplayedInViewport() {
40
+ export default async function isDisplayedInViewport() {
46
41
  if (!await this.isDisplayed()) {
47
42
  return false;
48
43
  }
49
- const browser = (0, utils_1.getBrowserObject)(this);
50
- return browser.execute(isElementInViewport_1.default, {
51
- [constants_1.ELEMENT_KEY]: this.elementId,
44
+ const browser = getBrowserObject(this);
45
+ return browser.execute(isElementInViewportScript, {
46
+ [ELEMENT_KEY]: this.elementId,
52
47
  ELEMENT: this.elementId // jsonwp compatible
53
48
  });
54
49
  }
55
- exports.default = isDisplayedInViewport;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Return true or false if the selected DOM-element is enabled.
@@ -32,7 +30,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
32
30
  * @type state
33
31
  *
34
32
  */
35
- function isEnabled() {
33
+ export default function isEnabled() {
36
34
  return this.isElementEnabled(this.elementId);
37
35
  }
38
- exports.default = isEnabled;
@@ -1 +1 @@
1
- {"version":3,"file":"isEqual.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isEqual.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EAAE,EAAE,WAAW,CAAC,OAAO,oBAwB1B"}
1
+ {"version":3,"file":"isEqual.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isEqual.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EAAE,EAAE,WAAW,CAAC,OAAO,oBA4B1B"}
@@ -1,9 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const constants_1 = require("../../constants");
4
- const utils_1 = require("../../utils");
1
+ import { ELEMENT_KEY } from '../../constants.js';
2
+ import { getBrowserObject } from '../../utils/index.js';
5
3
  const getWebElement = (el) => ({
6
- [constants_1.ELEMENT_KEY]: el.elementId,
4
+ [ELEMENT_KEY]: el.elementId,
7
5
  ELEMENT: el.elementId // jsonwp compatible
8
6
  });
9
7
  /**
@@ -28,12 +26,15 @@ const getWebElement = (el) => ({
28
26
  * @return {Boolean} true if elements are equal
29
27
  *
30
28
  */
31
- async function isEqual(el) {
32
- const browser = (0, utils_1.getBrowserObject)(this);
29
+ export default async function isEqual(el) {
30
+ const browser = getBrowserObject(this);
33
31
  // mobile native
34
32
  if (browser.isMobile) {
35
33
  const context = await browser.getContext();
36
- if (context === null || context === void 0 ? void 0 : context.toLowerCase().includes('native')) {
34
+ const contextId = typeof context === 'string'
35
+ ? context
36
+ : context?.id;
37
+ if (contextId && contextId.toLowerCase().includes('native')) {
37
38
  return this.elementId === el.elementId;
38
39
  }
39
40
  }
@@ -49,4 +50,3 @@ async function isEqual(el) {
49
50
  }
50
51
  return result;
51
52
  }
52
- exports.default = isEqual;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Returns true if element exists in the DOM.
@@ -47,7 +45,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
47
45
  * @type state
48
46
  *
49
47
  */
50
- async function isExisting() {
48
+ export default async function isExisting() {
51
49
  /**
52
50
  * if an element was composed via `const elem = $({ 'element-6066-11e4-a52e-4f735466cecf': <elementId> })`
53
51
  * we don't have any selector information. Therefore we can only check existance
@@ -62,4 +60,3 @@ async function isExisting() {
62
60
  const command = this.isReactElement ? this.parent.react$$.bind(this.parent) : this.parent.$$.bind(this.parent);
63
61
  return command(this.selector).then((res) => res.length > 0);
64
62
  }
65
- exports.default = isExisting;
@@ -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 isFocused_1 = __importDefault(require("../../scripts/isFocused"));
1
+ import { ELEMENT_KEY } from '../../constants.js';
2
+ import { getBrowserObject } from '../../utils/index.js';
3
+ import isFocusedScript from '../../scripts/isFocused.js';
9
4
  /**
10
5
  *
11
6
  * Return true or false if the selected DOM-element currently has focus. If the selector matches
@@ -32,11 +27,10 @@ const isFocused_1 = __importDefault(require("../../scripts/isFocused"));
32
27
  * @type state
33
28
  *
34
29
  */
35
- async function isFocused() {
36
- const browser = await (0, utils_1.getBrowserObject)(this);
37
- return browser.execute(isFocused_1.default, {
38
- [constants_1.ELEMENT_KEY]: this.elementId,
30
+ export default async function isFocused() {
31
+ const browser = await getBrowserObject(this);
32
+ return browser.execute(isFocusedScript, {
33
+ [ELEMENT_KEY]: this.elementId,
39
34
  ELEMENT: this.elementId // jsonwp compatible
40
35
  });
41
36
  }
42
- exports.default = isFocused;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Will return true or false whether or not an `<option>` or `<input>` element of type
@@ -29,7 +27,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
27
  * @type state
30
28
  *
31
29
  */
32
- function isSelected() {
30
+ export default function isSelected() {
33
31
  return this.isElementSelected(this.elementId);
34
32
  }
35
- exports.default = isSelected;
@@ -1 +1 @@
1
- {"version":3,"file":"moveTo.d.ts","sourceRoot":"","sources":["../../../src/commands/element/moveTo.ts"],"names":[],"mappings":"AAEA,aAAK,aAAa,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAA8B,MAAM,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EAAE,OAAO,EAAE,OAAO,EAAE,GAAE,aAAkB,iBAuB3C"}
1
+ {"version":3,"file":"moveTo.d.ts","sourceRoot":"","sources":["../../../src/commands/element/moveTo.ts"],"names":[],"mappings":"AAEA,aAAK,aAAa,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAA8B,MAAM,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EAAE,OAAO,EAAE,OAAO,EAAE,GAAE,aAAkB,iBAqB3C"}
@@ -1,6 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../../utils");
1
+ import { getElementRect, getScrollPosition, getBrowserObject } from '../../utils/index.js';
4
2
  /**
5
3
  *
6
4
  * Move the mouse by an offset of the specified element. If no element is specified,
@@ -15,25 +13,22 @@ const utils_1 = require("../../utils");
15
13
  * @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidmoveto
16
14
  * @type protocol
17
15
  */
18
- async function moveTo({ xOffset, yOffset } = {}) {
16
+ export default async function moveTo({ xOffset, yOffset } = {}) {
19
17
  if (!this.isW3C) {
20
18
  return this.moveToElement(this.elementId, xOffset, yOffset);
21
19
  }
22
20
  /**
23
21
  * get rect of element
24
22
  */
25
- const { x, y, width, height } = await (0, utils_1.getElementRect)(this);
26
- const { scrollX, scrollY } = await (0, utils_1.getScrollPosition)(this);
23
+ const { x, y, width, height } = await getElementRect(this);
24
+ const { scrollX, scrollY } = await getScrollPosition(this);
27
25
  const newXOffset = Math.floor(x - scrollX + (typeof xOffset === 'number' ? xOffset : (width / 2)));
28
26
  const newYOffset = Math.floor(y - scrollY + (typeof yOffset === 'number' ? yOffset : (height / 2)));
29
27
  /**
30
28
  * W3C way of handle the mouse move actions
31
29
  */
32
- return this.performActions([{
33
- type: 'pointer',
34
- id: 'finger1',
35
- parameters: { pointerType: 'mouse' },
36
- actions: [{ type: 'pointerMove', duration: 0, x: newXOffset, y: newYOffset }]
37
- }]).then(() => this.releaseActions());
30
+ const browser = getBrowserObject(this);
31
+ return browser.action('pointer', { parameters: { pointerType: 'mouse' } })
32
+ .move({ x: newXOffset, y: newYOffset })
33
+ .perform();
38
34
  }
39
- exports.default = moveTo;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  *
4
3
  * Returns the next sibling element of the selected DOM-element.
@@ -22,10 +21,8 @@
22
21
  * @return {Element}
23
22
  * @type utility
24
23
  */
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- function nextElement() {
27
- return this.$(/* istanbul ignore next */ function () {
24
+ export default function nextElement() {
25
+ return this.$(/* istanbul ignore next */ function nextElement() {
28
26
  return this.nextElementSibling;
29
27
  });
30
28
  }
31
- exports.default = nextElement;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Returns the parent element of the selected DOM-element.
@@ -23,9 +21,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
21
  * @return {Element}
24
22
  * @type utility
25
23
  */
26
- function parentElement() {
27
- return this.$(/* istanbul ignore next */ function () {
24
+ export default function parentElement() {
25
+ return this.$(/* istanbul ignore next */ function parentElement() {
28
26
  return this.parentElement;
29
27
  });
30
28
  }
31
- exports.default = parentElement;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  /**
4
2
  *
5
3
  * Returns the previous sibling element of the selected DOM-element.
@@ -23,9 +21,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
21
  * @return {Element}
24
22
  * @type utility
25
23
  */
26
- function previousElement() {
27
- return this.$(/* istanbul ignore next */ function () {
24
+ export default function previousElement() {
25
+ return this.$(/* istanbul ignore next */ function previousElement() {
28
26
  return this.previousElementSibling;
29
27
  });
30
28
  }
31
- exports.default = previousElement;
@@ -1 +1 @@
1
- {"version":3,"file":"react$$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/react$$.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,+CAUxD"}
1
+ {"version":3,"file":"react$$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/react$$.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,+CAWxD"}
@@ -1,13 +1,10 @@
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 fs_1 = __importDefault(require("fs"));
7
- const utils_1 = require("../../utils");
8
- const getElementObject_1 = require("../../utils/getElementObject");
9
- const resq_1 = require("../../scripts/resq");
10
- const resqScript = fs_1.default.readFileSync(require.resolve('resq'));
1
+ import fs from 'node:fs/promises';
2
+ import { createRequire } from 'node:module';
3
+ import { enhanceElementsArray, getBrowserObject } from '../../utils/index.js';
4
+ import { getElements } from '../../utils/getElementObject.js';
5
+ import { waitToLoadReact, react$$ as react$$Script } from '../../scripts/resq.js';
6
+ const require = createRequire(import.meta.url);
7
+ const resqScript = await fs.readFile(require.resolve('resq'));
11
8
  /**
12
9
  *
13
10
  * The `react$$` command is a useful command to query multiple React Components
@@ -41,11 +38,11 @@ const resqScript = fs_1.default.readFileSync(require.resolve('resq'));
41
38
  * @return {ElementArray}
42
39
  *
43
40
  */
44
- async function react$$(selector, { props = {}, state = {} } = {}) {
41
+ export default async function react$$(selector, { props = {}, state = {} } = {}) {
42
+ const browser = await getBrowserObject(this);
45
43
  await this.executeScript(resqScript.toString(), []);
46
- await this.execute(resq_1.waitToLoadReact);
47
- const res = await this.execute(resq_1.react$$, selector, props, state, this);
48
- const elements = await getElementObject_1.getElements.call(this, selector, res, true);
49
- return (0, utils_1.enhanceElementsArray)(elements, this, selector, 'react$$', [props, state]);
44
+ await browser.execute(waitToLoadReact);
45
+ const res = await browser.execute(react$$Script, selector, props, state, this);
46
+ const elements = await getElements.call(this, selector, res, true);
47
+ return enhanceElementsArray(elements, this, selector, 'react$$', [props, state]);
50
48
  }
51
- exports.default = react$$;
@@ -1 +1 @@
1
- {"version":3,"file":"react$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/react$.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAIvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAA8B,MAAM,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,gCASxD"}
1
+ {"version":3,"file":"react$.d.ts","sourceRoot":"","sources":["../../../src/commands/element/react$.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAKvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAA8B,MAAM,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,gCAUxD"}
@@ -1,12 +1,10 @@
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 fs_1 = __importDefault(require("fs"));
7
- const getElementObject_1 = require("../../utils/getElementObject");
8
- const resq_1 = require("../../scripts/resq");
9
- const resqScript = fs_1.default.readFileSync(require.resolve('resq'));
1
+ import fs from 'node:fs/promises';
2
+ import { createRequire } from 'node:module';
3
+ import { getBrowserObject } from '../../utils/index.js';
4
+ import { getElement } from '../../utils/getElementObject.js';
5
+ import { waitToLoadReact, react$ as react$Script } from '../../scripts/resq.js';
6
+ const require = createRequire(import.meta.url);
7
+ const resqScript = await fs.readFile(require.resolve('resq'));
10
8
  /**
11
9
  *
12
10
  * The `react$` command is a useful command to query React Components by their
@@ -50,10 +48,10 @@ const resqScript = fs_1.default.readFileSync(require.resolve('resq'));
50
48
  * @return {Element}
51
49
  *
52
50
  */
53
- async function react$(selector, { props = {}, state = {} } = {}) {
51
+ export default async function react$(selector, { props = {}, state = {} } = {}) {
52
+ const browser = await getBrowserObject(this);
54
53
  await this.executeScript(resqScript.toString(), []);
55
- await this.execute(resq_1.waitToLoadReact);
56
- const res = await this.execute(resq_1.react$, selector, props, state, this);
57
- return getElementObject_1.getElement.call(this, selector, res, true);
54
+ await browser.execute(waitToLoadReact);
55
+ const res = await browser.execute(react$Script, selector, props, state, this);
56
+ return getElement.call(this, selector, res, true);
58
57
  }
59
- exports.default = react$;