webdriverio 9.5.3 → 9.5.4
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.
|
@@ -14,8 +14,8 @@ import type { ChainablePromiseElement, DragAndDropCoordinate, DragAndDropOptions
|
|
|
14
14
|
* <example>
|
|
15
15
|
:example.test.js
|
|
16
16
|
it('should demonstrate the dragAndDrop command', async () => {
|
|
17
|
-
const elem =
|
|
18
|
-
const target =
|
|
17
|
+
const elem = $('#someElem')
|
|
18
|
+
const target = $('#someTarget')
|
|
19
19
|
|
|
20
20
|
// drag and drop to other element
|
|
21
21
|
await elem.dragAndDrop(target)
|
|
@@ -16,8 +16,8 @@ export {};
|
|
|
16
16
|
* <example>
|
|
17
17
|
:example.test.js
|
|
18
18
|
it('should demonstrate the dragAndDrop command', async () => {
|
|
19
|
-
const elem =
|
|
20
|
-
const target =
|
|
19
|
+
const elem = $('#someElem')
|
|
20
|
+
const target = $('#someTarget')
|
|
21
21
|
|
|
22
22
|
// drag and drop to other element
|
|
23
23
|
await elem.dragAndDrop(target)
|
package/build/index.js
CHANGED
|
@@ -5872,15 +5872,15 @@ import { ELEMENT_KEY as ELEMENT_KEY11 } from "webdriver";
|
|
|
5872
5872
|
import { getBrowserObject as getBrowserObject16 } from "@wdio/utils";
|
|
5873
5873
|
async function dragAndDrop(target, options = {}) {
|
|
5874
5874
|
const moveToCoordinates = target;
|
|
5875
|
-
const moveToElement = target;
|
|
5875
|
+
const moveToElement = await target;
|
|
5876
5876
|
if (
|
|
5877
5877
|
/**
|
|
5878
5878
|
* no target was specified
|
|
5879
5879
|
*/
|
|
5880
|
-
!
|
|
5880
|
+
!moveToElement || /**
|
|
5881
5881
|
* target is not from type element
|
|
5882
5882
|
*/
|
|
5883
|
-
|
|
5883
|
+
moveToElement.constructor.name !== "Element" && /**
|
|
5884
5884
|
* and is also not an object with x and y number parameters
|
|
5885
5885
|
*/
|
|
5886
5886
|
(typeof moveToCoordinates.x !== "number" || typeof moveToCoordinates.y !== "number")
|
|
@@ -5891,7 +5891,7 @@ async function dragAndDrop(target, options = {}) {
|
|
|
5891
5891
|
const browser = getBrowserObject16(this);
|
|
5892
5892
|
const defaultOptions = { duration: browser.isMobile ? 250 : 10 };
|
|
5893
5893
|
const { duration } = { ...defaultOptions, ...options };
|
|
5894
|
-
const isMovingToElement =
|
|
5894
|
+
const isMovingToElement = moveToElement.constructor.name === "Element";
|
|
5895
5895
|
const sourceRef = { [ELEMENT_KEY11]: this[ELEMENT_KEY11] };
|
|
5896
5896
|
const targetRef = { [ELEMENT_KEY11]: moveToElement[ELEMENT_KEY11] };
|
|
5897
5897
|
const origin = sourceRef;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webdriverio",
|
|
3
3
|
"description": "Next-gen browser and mobile automation test framework for Node.js",
|
|
4
|
-
"version": "9.5.
|
|
4
|
+
"version": "9.5.4",
|
|
5
5
|
"homepage": "https://webdriver.io",
|
|
6
6
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"rgb2hex": "0.2.5",
|
|
101
101
|
"serialize-error": "^11.0.3",
|
|
102
102
|
"urlpattern-polyfill": "^10.0.0",
|
|
103
|
-
"webdriver": "9.5.
|
|
103
|
+
"webdriver": "9.5.4"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"puppeteer-core": "^22.3.0"
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"optional": true
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "b4e5733841d26e9b3e29cac5630f9bb67e33e00e"
|
|
114
114
|
}
|