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.
- package/build/cjs/index.d.ts +3 -0
- package/build/cjs/index.d.ts.map +1 -0
- package/build/cjs/index.js +13 -0
- package/build/cjs/package.json +3 -0
- package/build/commands/browser/$$.js +6 -9
- package/build/commands/browser/$.js +8 -11
- package/build/commands/browser/action.d.ts +128 -0
- package/build/commands/browser/action.d.ts.map +1 -0
- package/build/commands/browser/action.js +13 -0
- package/build/commands/browser/actions.d.ts +29 -0
- package/build/commands/browser/actions.d.ts.map +1 -0
- package/build/commands/browser/actions.js +30 -0
- package/build/commands/browser/call.js +1 -4
- package/build/commands/browser/custom$$.js +7 -10
- package/build/commands/browser/custom$.js +5 -8
- package/build/commands/browser/debug.js +8 -14
- package/build/commands/browser/deleteCookies.js +1 -4
- package/build/commands/browser/execute.js +3 -6
- package/build/commands/browser/executeAsync.js +3 -6
- package/build/commands/browser/getCookies.js +1 -4
- package/build/commands/browser/getPuppeteer.d.ts +1 -1
- package/build/commands/browser/getPuppeteer.d.ts.map +1 -1
- package/build/commands/browser/getPuppeteer.js +14 -21
- package/build/commands/browser/getWindowSize.js +3 -6
- package/build/commands/browser/keys.d.ts +20 -10
- package/build/commands/browser/keys.d.ts.map +1 -1
- package/build/commands/browser/keys.js +29 -24
- package/build/commands/browser/mock.d.ts +1 -1
- package/build/commands/browser/mock.d.ts.map +1 -1
- package/build/commands/browser/mock.js +12 -19
- package/build/commands/browser/mockClearAll.js +5 -11
- package/build/commands/browser/mockRestoreAll.js +5 -11
- package/build/commands/browser/newWindow.js +5 -11
- package/build/commands/browser/pause.js +1 -4
- package/build/commands/browser/react$$.d.ts.map +1 -1
- package/build/commands/browser/react$$.js +12 -16
- package/build/commands/browser/react$.d.ts.map +1 -1
- package/build/commands/browser/react$.js +10 -14
- package/build/commands/browser/reloadSession.js +5 -12
- package/build/commands/browser/savePDF.js +7 -13
- package/build/commands/browser/saveRecordingScreen.js +6 -12
- package/build/commands/browser/saveScreenshot.js +6 -12
- package/build/commands/browser/scroll.d.ts +25 -0
- package/build/commands/browser/scroll.d.ts.map +1 -0
- package/build/commands/browser/scroll.js +41 -0
- package/build/commands/browser/setCookies.js +1 -4
- package/build/commands/browser/setTimeout.js +1 -4
- package/build/commands/browser/setWindowSize.js +3 -6
- package/build/commands/browser/switchWindow.js +1 -4
- package/build/commands/browser/throttle.js +3 -6
- package/build/commands/browser/touchAction.d.ts +1 -1
- package/build/commands/browser/touchAction.d.ts.map +1 -1
- package/build/commands/browser/touchAction.js +3 -6
- package/build/commands/browser/uploadFile.d.ts +1 -1
- package/build/commands/browser/uploadFile.d.ts.map +1 -1
- package/build/commands/browser/uploadFile.js +10 -15
- package/build/commands/browser/url.js +3 -6
- package/build/commands/browser/waitUntil.js +3 -9
- package/build/commands/browser.d.ts +39 -33
- package/build/commands/browser.d.ts.map +1 -1
- package/build/commands/browser.js +42 -43
- package/build/commands/constant.d.ts +1 -1
- package/build/commands/constant.d.ts.map +1 -1
- package/build/commands/constant.js +6 -12
- package/build/commands/element/$$.d.ts +1 -1
- package/build/commands/element/$$.d.ts.map +1 -1
- package/build/commands/element/$$.js +2 -7
- package/build/commands/element/$.d.ts +1 -1
- package/build/commands/element/$.d.ts.map +1 -1
- package/build/commands/element/$.js +2 -7
- package/build/commands/element/addValue.d.ts +10 -14
- package/build/commands/element/addValue.d.ts.map +1 -1
- package/build/commands/element/addValue.js +23 -27
- package/build/commands/element/clearValue.d.ts +1 -1
- package/build/commands/element/clearValue.js +2 -5
- package/build/commands/element/click.d.ts +1 -1
- package/build/commands/element/click.d.ts.map +1 -1
- package/build/commands/element/click.js +19 -34
- package/build/commands/element/custom$$.js +9 -11
- package/build/commands/element/custom$.js +8 -10
- package/build/commands/element/doubleClick.d.ts.map +1 -1
- package/build/commands/element/doubleClick.js +11 -17
- package/build/commands/element/dragAndDrop.d.ts.map +1 -1
- package/build/commands/element/dragAndDrop.js +13 -19
- package/build/commands/element/getAttribute.js +1 -4
- package/build/commands/element/getCSSProperty.d.ts +1 -1
- package/build/commands/element/getCSSProperty.d.ts.map +1 -1
- package/build/commands/element/getCSSProperty.js +7 -13
- package/build/commands/element/getComputedLabel.js +1 -4
- package/build/commands/element/getComputedRole.js +1 -4
- package/build/commands/element/getHTML.js +7 -13
- package/build/commands/element/getLocation.js +3 -5
- package/build/commands/element/getProperty.d.ts +8 -8
- package/build/commands/element/getProperty.d.ts.map +1 -1
- package/build/commands/element/getProperty.js +5 -11
- package/build/commands/element/getSize.js +3 -5
- package/build/commands/element/getTagName.js +1 -4
- package/build/commands/element/getText.js +1 -4
- package/build/commands/element/getValue.js +1 -4
- package/build/commands/element/isClickable.js +7 -13
- package/build/commands/element/isDisplayed.js +9 -16
- package/build/commands/element/isDisplayedInViewport.js +7 -13
- package/build/commands/element/isEnabled.js +1 -4
- package/build/commands/element/isEqual.d.ts.map +1 -1
- package/build/commands/element/isEqual.js +9 -9
- package/build/commands/element/isExisting.js +1 -4
- package/build/commands/element/isFocused.js +7 -13
- package/build/commands/element/isSelected.js +1 -4
- package/build/commands/element/moveTo.d.ts.map +1 -1
- package/build/commands/element/moveTo.js +8 -13
- package/build/commands/element/nextElement.js +2 -5
- package/build/commands/element/parentElement.js +2 -5
- package/build/commands/element/previousElement.js +2 -5
- package/build/commands/element/react$$.d.ts.map +1 -1
- package/build/commands/element/react$$.js +13 -16
- package/build/commands/element/react$.d.ts.map +1 -1
- package/build/commands/element/react$.js +12 -14
- package/build/commands/element/saveScreenshot.js +6 -12
- package/build/commands/element/scrollIntoView.d.ts +3 -2
- package/build/commands/element/scrollIntoView.d.ts.map +1 -1
- package/build/commands/element/scrollIntoView.js +32 -12
- package/build/commands/element/selectByAttribute.js +3 -6
- package/build/commands/element/selectByIndex.js +3 -6
- package/build/commands/element/selectByVisibleText.js +3 -6
- package/build/commands/element/setValue.d.ts +13 -14
- package/build/commands/element/setValue.d.ts.map +1 -1
- package/build/commands/element/setValue.js +14 -17
- package/build/commands/element/shadow$$.d.ts +1 -1
- package/build/commands/element/shadow$$.d.ts.map +1 -1
- package/build/commands/element/shadow$$.js +3 -6
- package/build/commands/element/shadow$.js +3 -6
- package/build/commands/element/touchAction.js +3 -6
- package/build/commands/element/waitForClickable.js +1 -4
- package/build/commands/element/waitForDisplayed.js +1 -4
- package/build/commands/element/waitForEnabled.js +1 -4
- package/build/commands/element/waitForExist.js +1 -4
- package/build/commands/element/waitUntil.d.ts +1 -1
- package/build/commands/element/waitUntil.d.ts.map +1 -1
- package/build/commands/element/waitUntil.js +2 -7
- package/build/commands/element.d.ts +48 -48
- package/build/commands/element.d.ts.map +1 -1
- package/build/commands/element.js +57 -62
- package/build/constants.d.ts +66 -0
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +91 -12
- package/build/index.d.ts +64 -5
- package/build/index.d.ts.map +1 -1
- package/build/index.js +47 -85
- package/build/middlewares.d.ts +1 -1
- package/build/middlewares.js +11 -19
- package/build/multiremote.js +12 -20
- package/build/protocol-stub.d.ts.map +1 -1
- package/build/protocol-stub.js +4 -6
- package/build/scripts/getHTML.js +1 -4
- package/build/scripts/getProperty.d.ts +8 -8
- package/build/scripts/getProperty.d.ts.map +1 -1
- package/build/scripts/getProperty.js +1 -4
- package/build/scripts/isElementClickable.js +1 -4
- package/build/scripts/isElementDisplayed.js +1 -4
- package/build/scripts/isElementInViewport.js +1 -4
- package/build/scripts/isFocused.js +1 -4
- package/build/scripts/newWindow.js +1 -4
- package/build/scripts/resq.js +3 -9
- package/build/scripts/shadowFnFactory.js +2 -6
- package/build/types.d.ts +1 -5
- package/build/types.d.ts.map +1 -1
- package/build/types.js +1 -2
- package/build/utils/SevereServiceError.js +1 -4
- package/build/utils/Timer.d.ts.map +1 -1
- package/build/utils/Timer.js +1 -25
- package/build/utils/actions/base.d.ts +32 -0
- package/build/utils/actions/base.d.ts.map +1 -0
- package/build/utils/actions/base.js +78 -0
- package/build/utils/actions/index.d.ts +6 -0
- package/build/utils/actions/index.d.ts.map +1 -0
- package/build/utils/actions/index.js +5 -0
- package/build/utils/actions/key.d.ts +15 -0
- package/build/utils/actions/key.d.ts.map +1 -0
- package/build/utils/actions/key.js +22 -0
- package/build/utils/actions/pointer.d.ts +62 -0
- package/build/utils/actions/pointer.d.ts.map +1 -0
- package/build/utils/actions/pointer.js +76 -0
- package/build/utils/actions/wheel.d.ts +36 -0
- package/build/utils/actions/wheel.d.ts.map +1 -0
- package/build/utils/actions/wheel.js +20 -0
- package/build/utils/detectBackend.d.ts +1 -1
- package/build/utils/detectBackend.d.ts.map +1 -1
- package/build/utils/detectBackend.js +3 -7
- package/build/utils/findStrategy.js +11 -19
- package/build/utils/getElementObject.d.ts.map +1 -1
- package/build/utils/getElementObject.js +42 -31
- package/build/utils/implicitWait.js +3 -9
- package/build/utils/index.d.ts +2 -6
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +92 -142
- package/build/utils/interception/devtools.d.ts +1 -1
- package/build/utils/interception/devtools.d.ts.map +1 -1
- package/build/utils/interception/devtools.js +17 -23
- package/build/utils/interception/index.d.ts +2 -2
- package/build/utils/interception/index.d.ts.map +1 -1
- package/build/utils/interception/index.js +5 -11
- package/build/utils/interception/types.d.ts +1 -1
- package/build/utils/interception/types.d.ts.map +1 -1
- package/build/utils/interception/types.js +1 -2
- package/build/utils/interception/webdriver.d.ts +1 -1
- package/build/utils/interception/webdriver.d.ts.map +1 -1
- package/build/utils/interception/webdriver.js +5 -11
- package/build/utils/refetchElement.js +3 -9
- package/package.json +22 -11
- package/async.d.ts +0 -24
- 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 | ((
|
|
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
|
-
} | ((
|
|
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
|
-
} | ((
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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
|
-
|
|
2
|
-
|
|
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 =
|
|
29
|
-
return browser.execute(
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 =
|
|
52
|
-
return browser.execute(
|
|
53
|
-
[
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
60
|
-
|
|
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(
|
|
71
|
+
noW3CEndpoint.includes(browser.capabilities.browserName?.toLowerCase())));
|
|
78
72
|
return useAtom
|
|
79
|
-
? await browser.execute(
|
|
80
|
-
[
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 =
|
|
50
|
-
return browser.execute(
|
|
51
|
-
[
|
|
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,
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
[
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
37
|
-
return browser.execute(
|
|
38
|
-
[
|
|
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,
|
|
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
|
-
|
|
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
|
|
26
|
-
const { scrollX, scrollY } = await
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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":"
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
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
|
|
47
|
-
const res = await
|
|
48
|
-
const elements = await
|
|
49
|
-
return
|
|
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":"
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
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
|
|
56
|
-
const res = await
|
|
57
|
-
return
|
|
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$;
|