webdriverio 7.20.6 → 7.20.8-alpha.504
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/$$.d.ts +10 -1
- package/build/commands/browser/$$.d.ts.map +1 -1
- package/build/commands/browser/$$.js +16 -9
- package/build/commands/browser/$.js +8 -11
- package/build/commands/browser/action.d.ts +132 -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/addCommand.d.ts +1 -1
- package/build/commands/browser/addCommand.js +1 -1
- package/build/commands/browser/call.d.ts +7 -5
- package/build/commands/browser/call.d.ts.map +1 -1
- package/build/commands/browser/call.js +8 -9
- package/build/commands/browser/custom$$.js +7 -10
- package/build/commands/browser/custom$.d.ts +1 -1
- package/build/commands/browser/custom$.js +6 -9
- package/build/commands/browser/debug.js +8 -14
- package/build/commands/browser/deleteCookies.d.ts +3 -3
- package/build/commands/browser/deleteCookies.js +4 -7
- package/build/commands/browser/execute.d.ts +2 -2
- package/build/commands/browser/execute.js +5 -8
- package/build/commands/browser/executeAsync.js +3 -6
- package/build/commands/browser/getCookies.d.ts +2 -2
- package/build/commands/browser/getCookies.js +3 -6
- 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 +5 -4
- package/build/commands/browser/mock.d.ts.map +1 -1
- package/build/commands/browser/mock.js +16 -22
- 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 +16 -17
- package/build/commands/browser/react$.d.ts.map +1 -1
- package/build/commands/browser/react$.js +13 -14
- package/build/commands/browser/reloadSession.js +5 -12
- package/build/commands/browser/savePDF.d.ts +14 -14
- package/build/commands/browser/savePDF.js +21 -27
- 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.d.ts +1 -1
- package/build/commands/browser/setCookies.d.ts.map +1 -1
- package/build/commands/browser/setCookies.js +5 -7
- 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.d.ts +1 -2
- package/build/commands/browser/waitUntil.d.ts.map +1 -1
- package/build/commands/browser/waitUntil.js +4 -11
- package/build/commands/browser.d.ts +37 -69
- package/build/commands/browser.d.ts.map +1 -1
- package/build/commands/browser.js +37 -44
- 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 +5 -5
- 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.d.ts.map +1 -1
- package/build/commands/element/isClickable.js +10 -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 +16 -16
- package/build/commands/element/react$.d.ts.map +1 -1
- package/build/commands/element/react$.js +15 -14
- package/build/commands/element/saveScreenshot.js +6 -12
- package/build/commands/element/scrollIntoView.d.ts +4 -2
- package/build/commands/element/scrollIntoView.d.ts.map +1 -1
- package/build/commands/element/scrollIntoView.js +33 -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 +2 -3
- package/build/commands/element/waitUntil.d.ts.map +1 -1
- package/build/commands/element/waitUntil.js +3 -9
- package/build/commands/element.d.ts +49 -99
- package/build/commands/element.d.ts.map +1 -1
- package/build/commands/element.js +49 -63
- package/build/constants.d.ts +67 -0
- package/build/constants.d.ts.map +1 -1
- package/build/constants.js +105 -12
- package/build/index.d.ts +65 -6
- package/build/index.d.ts.map +1 -1
- package/build/index.js +48 -86
- package/build/middlewares.d.ts +1 -1
- package/build/middlewares.js +11 -19
- package/build/multiremote.js +18 -24
- 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 +5 -5
- 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 +2 -5
- 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 +5 -9
- 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 +13 -29
- 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 +66 -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.d.ts.map +1 -1
- package/build/utils/findStrategy.js +50 -19
- package/build/utils/getElementObject.d.ts +1 -1
- package/build/utils/getElementObject.d.ts.map +1 -1
- package/build/utils/getElementObject.js +51 -32
- package/build/utils/implicitWait.js +3 -9
- package/build/utils/index.d.ts +8 -7
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +125 -148
- 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 -36
- 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 +10 -13
- 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 +6 -11
- package/build/utils/refetchElement.js +3 -9
- package/package.json +27 -17
- package/async.d.ts +0 -24
- package/sync.d.ts +0 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cjs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAgB,MAAM,aAAa,CAAA;AAGxD,oBAAY,aAAa,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
exports.remote = async function (params, remoteModifier) {
|
|
2
|
+
const { remote } = await import('../index.js');
|
|
3
|
+
return remote(params, remoteModifier);
|
|
4
|
+
};
|
|
5
|
+
exports.attach = async function (attachOptions) {
|
|
6
|
+
const { attach } = await import('../index.js');
|
|
7
|
+
return attach(attachOptions);
|
|
8
|
+
};
|
|
9
|
+
exports.multiremote = async function (params, { automationProtocol } = {}) {
|
|
10
|
+
const { multiremote } = await import('../index.js');
|
|
11
|
+
return multiremote(params, { automationProtocol });
|
|
12
|
+
};
|
|
13
|
+
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ElementReference } from '@wdio/protocols';
|
|
1
2
|
import type { Selector, ElementArray } from '../../types';
|
|
2
3
|
/**
|
|
3
4
|
* The `$$` command is a short way to call the [`findElements`](/docs/api/webdriver#findelements) command in order
|
|
@@ -38,6 +39,14 @@ import type { Selector, ElementArray } from '../../types';
|
|
|
38
39
|
})[0];
|
|
39
40
|
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
40
41
|
});
|
|
42
|
+
|
|
43
|
+
it('can create element array out of single elements', async () => {
|
|
44
|
+
const red = await $('.red');
|
|
45
|
+
const green = await $('.green');
|
|
46
|
+
const elems = $$([red, green]);
|
|
47
|
+
console.log(await elems.map((e) => e.getAttribute('class')));
|
|
48
|
+
// returns "[ 'box red ui-droppable', 'box green' ]"
|
|
49
|
+
});
|
|
41
50
|
* </example>
|
|
42
51
|
*
|
|
43
52
|
* @alias $$
|
|
@@ -46,5 +55,5 @@ import type { Selector, ElementArray } from '../../types';
|
|
|
46
55
|
* @type utility
|
|
47
56
|
*
|
|
48
57
|
*/
|
|
49
|
-
export default function $$(this: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector): Promise<ElementArray>;
|
|
58
|
+
export default function $$(this: WebdriverIO.Browser | WebdriverIO.Element, selector: Selector | ElementReference[] | WebdriverIO.Element[]): Promise<ElementArray>;
|
|
50
59
|
//# sourceMappingURL=$$.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/$$.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/$$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAIvD,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAA8B,EAAE,CAC5B,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,yBAOlE"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const utils_1 = require("../../utils");
|
|
4
|
-
const getElementObject_1 = require("../../utils/getElementObject");
|
|
1
|
+
import { findElements, enhanceElementsArray } from '../../utils/index.js';
|
|
2
|
+
import { getElements } from '../../utils/getElementObject.js';
|
|
5
3
|
/**
|
|
6
4
|
* The `$$` command is a short way to call the [`findElements`](/docs/api/webdriver#findelements) command in order
|
|
7
5
|
* to fetch multiple elements on the page. It returns an array with element results that will have an
|
|
@@ -41,6 +39,14 @@ const getElementObject_1 = require("../../utils/getElementObject");
|
|
|
41
39
|
})[0];
|
|
42
40
|
console.log(await text.$$('li')[2].$('a').getText()); // outputs: "API"
|
|
43
41
|
});
|
|
42
|
+
|
|
43
|
+
it('can create element array out of single elements', async () => {
|
|
44
|
+
const red = await $('.red');
|
|
45
|
+
const green = await $('.green');
|
|
46
|
+
const elems = $$([red, green]);
|
|
47
|
+
console.log(await elems.map((e) => e.getAttribute('class')));
|
|
48
|
+
// returns "[ 'box red ui-droppable', 'box green' ]"
|
|
49
|
+
});
|
|
44
50
|
* </example>
|
|
45
51
|
*
|
|
46
52
|
* @alias $$
|
|
@@ -49,9 +55,10 @@ const getElementObject_1 = require("../../utils/getElementObject");
|
|
|
49
55
|
* @type utility
|
|
50
56
|
*
|
|
51
57
|
*/
|
|
52
|
-
async function $$(selector) {
|
|
53
|
-
const res =
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
export default async function $$(selector) {
|
|
59
|
+
const res = Array.isArray(selector)
|
|
60
|
+
? selector
|
|
61
|
+
: await findElements.call(this, selector);
|
|
62
|
+
const elements = await getElements.call(this, selector, res);
|
|
63
|
+
return enhanceElementsArray(elements, this, selector);
|
|
56
64
|
}
|
|
57
|
-
exports.default = $$;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const getElementObject_1 = require("../../utils/getElementObject");
|
|
5
|
-
const constants_1 = require("../../constants");
|
|
1
|
+
import { findElement } from '../../utils/index.js';
|
|
2
|
+
import { getElement } from '../../utils/getElementObject.js';
|
|
3
|
+
import { ELEMENT_KEY } from '../../constants.js';
|
|
6
4
|
/**
|
|
7
5
|
* The `$` command is a short way to call the [`findElement`](/docs/api/webdriver#findelement) command in order
|
|
8
6
|
* to fetch a single element on the page. It returns an object that with an extended prototype to call
|
|
@@ -77,18 +75,17 @@ const constants_1 = require("../../constants");
|
|
|
77
75
|
* @type utility
|
|
78
76
|
*
|
|
79
77
|
*/
|
|
80
|
-
async function $(selector) {
|
|
78
|
+
export default async function $(selector) {
|
|
81
79
|
/**
|
|
82
80
|
* convert protocol result into WebdriverIO element
|
|
83
81
|
* e.g. when element was fetched with `getActiveElement`
|
|
84
82
|
*/
|
|
85
83
|
if (typeof selector === 'object') {
|
|
86
84
|
const elementRef = selector;
|
|
87
|
-
if (typeof elementRef[
|
|
88
|
-
return
|
|
85
|
+
if (typeof elementRef[ELEMENT_KEY] === 'string') {
|
|
86
|
+
return getElement.call(this, undefined, elementRef);
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
const res = await
|
|
92
|
-
return
|
|
89
|
+
const res = await findElement.call(this, selector);
|
|
90
|
+
return getElement.call(this, selector, res);
|
|
93
91
|
}
|
|
94
|
-
exports.default = $;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { KeyAction, PointerAction, WheelAction, BaseActionParams } from '../../utils/actions/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The action command is a low-level interface for providing virtualized device input actions to the web browser.
|
|
4
|
+
*
|
|
5
|
+
* In addition to high level commands such like `scrollIntoView`, `doubleClick`, the Actions API provides granular
|
|
6
|
+
* control over exactly what designated input devices can do. WebdriverIO provides an interface for 3 kinds of input
|
|
7
|
+
* sources:
|
|
8
|
+
*
|
|
9
|
+
* - a key input for keyboard devices
|
|
10
|
+
* - a pointer input for a mouse, pen or touch devices
|
|
11
|
+
* - and wheel inputs for scroll wheel devices
|
|
12
|
+
*
|
|
13
|
+
* Every chain of action commands has to be completed calling `perform` in order to trigger the set of actions. This
|
|
14
|
+
* causes actions [to be released](https://w3c.github.io/webdriver/#release-actions) and events to be fired. You can
|
|
15
|
+
* skip this by passing in `true` (e.g. `browser.actions(...).perform(true)`).
|
|
16
|
+
*
|
|
17
|
+
* :::info
|
|
18
|
+
*
|
|
19
|
+
* Support for this command and specific actions can differ based on the environment. Progress on the development
|
|
20
|
+
* can be followed on [wpt.fyi](https://wpt.fyi/results/webdriver/tests/perform_actions?label=experimental&label=master&aligned).
|
|
21
|
+
* For mobile you might want to use Appium specific gesture commands on [iOS](https://github.com/appium/appium-xcuitest-driver#mobile-pinch)
|
|
22
|
+
* and [Android](https://github.com/appium/appium-uiautomator2-driver#mobile-gesture-commands).
|
|
23
|
+
*
|
|
24
|
+
* :::
|
|
25
|
+
*
|
|
26
|
+
* ### Key input source
|
|
27
|
+
*
|
|
28
|
+
* A key input source is an input source that is associated with a keyboard-type device. It can be triggered
|
|
29
|
+
* by using the `key` type parameters. e.g.:
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* browser.action('key')
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* It returns a `KeyAction` object that supports the following actions:
|
|
36
|
+
*
|
|
37
|
+
* - `down(value: string)`: generates a key down action
|
|
38
|
+
* - `up(value: string)`: generates a key up action
|
|
39
|
+
* - `pause(ms: number)`: indicate that an input source does nothing during a particular tick
|
|
40
|
+
*
|
|
41
|
+
* ### Pointer input source
|
|
42
|
+
*
|
|
43
|
+
* A pointer input source is an input source that is associated with a pointer-type input device. The type can be
|
|
44
|
+
* specified when invoking the `action` command, e.g.:
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* browser.action('pointer'. {
|
|
48
|
+
* parameters: { pointerType: 'mouse' } // "mouse" is default value, also possible: "pen" or "touch"
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* It returns a `PointerAction` object that supports the following actions:
|
|
53
|
+
*
|
|
54
|
+
* - `down (button: 'left' | 'middle' | 'right')`: creates an action to press a single key
|
|
55
|
+
* - `down (params: PointerActionParams)`: creates an action to press a single key with detailed parameters
|
|
56
|
+
* - `move (x: number, y: number)`: Creates an action for moving the pointer `x` and `y` pixels from the viewport
|
|
57
|
+
* - `move (params: PointerActionMoveParams)`: Creates an action for moving the pointer `x` and `y` pixels from the
|
|
58
|
+
* specified `origin`. The `origin` may be defined as the pointers current position (e.g. "pointer"), the viewport
|
|
59
|
+
* (e.g. "viewport") or the center of a specific element.
|
|
60
|
+
* - `up (button: 'left' | 'middle' | 'right')`: creates an action to release a single key
|
|
61
|
+
* - `up (params: PointerActionUpParams)`: creates an action to release a single key with detailed parameters
|
|
62
|
+
* - `cancel()`: An action that cancels this pointer's current input.
|
|
63
|
+
* - `pause(ms: number)`: indicate that an input source does nothing during a particular tick
|
|
64
|
+
*
|
|
65
|
+
* You can find detailed information on the [`PointerActionParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/pointer.ts#L20-L35), [`PointerActionMoveParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/pointer.ts#L20-L42) and [`PointerActionUpParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/pointer.ts#L13-L19)
|
|
66
|
+
* parameter types in the project type definition.
|
|
67
|
+
*
|
|
68
|
+
* ### Wheel input source
|
|
69
|
+
*
|
|
70
|
+
* A wheel input source is an input source that is associated with a wheel-type input device.
|
|
71
|
+
*
|
|
72
|
+
* ```ts
|
|
73
|
+
* browser.action('wheel')
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* It returns a `WheelAction` object that supports the following actions:
|
|
77
|
+
*
|
|
78
|
+
* - `scroll (params: ScrollParams)`: scrolls a page to given coordinates or origin
|
|
79
|
+
* - `pause(ms: number)`: indicate that an input source does nothing during a particular tick
|
|
80
|
+
*
|
|
81
|
+
* You can find detailed information on the [`ScrollParams`](https://github.com/webdriverio/webdriverio/blob/8ca026c75bf7c27ef9d574f0ec48d8bc13658602/packages/webdriverio/src/utils/actions/wheel.ts#L4-L29) parameter type in the project type definition.
|
|
82
|
+
*
|
|
83
|
+
* <example>
|
|
84
|
+
:pointer-action.js
|
|
85
|
+
it('drag and drop using pointer action command', async () => {
|
|
86
|
+
const origin = await $('#source')
|
|
87
|
+
const targetOrigin = await $('#target')
|
|
88
|
+
|
|
89
|
+
return browser.action('pointer')
|
|
90
|
+
.move({ duration: 0, origin, x: 0, y: 0 })
|
|
91
|
+
.down({ button: 0 }) // left button
|
|
92
|
+
.pause(10)
|
|
93
|
+
.move({ duration, origin: targetOrigin })
|
|
94
|
+
.up({ button: 0 })
|
|
95
|
+
.perform()
|
|
96
|
+
});
|
|
97
|
+
:key-action.js
|
|
98
|
+
it('should emit key events using key action commands', async () => {
|
|
99
|
+
const elem = await $('input')
|
|
100
|
+
await elem.click() // make element active
|
|
101
|
+
|
|
102
|
+
await browser.action('key)
|
|
103
|
+
.down('f')
|
|
104
|
+
.down('o')
|
|
105
|
+
.down('o')
|
|
106
|
+
.up('f')
|
|
107
|
+
.up('o')
|
|
108
|
+
.up('o')
|
|
109
|
+
.perform()
|
|
110
|
+
|
|
111
|
+
console.log(await elem.getValue()) // returns "foo"
|
|
112
|
+
})
|
|
113
|
+
:wheel-action.js
|
|
114
|
+
it('should scroll using wheel action commands', async () => {
|
|
115
|
+
console.log(await browser.execute(() => window.scrollY)) // returns 0
|
|
116
|
+
await browser.action('wheel').scroll({
|
|
117
|
+
deltaX: 0,
|
|
118
|
+
deltaY: 500,
|
|
119
|
+
duration: 200
|
|
120
|
+
}).perform()
|
|
121
|
+
console.log(await browser.execute(() => window.scrollY)) // returns 500
|
|
122
|
+
})
|
|
123
|
+
* </example>
|
|
124
|
+
*
|
|
125
|
+
* @alias browser.action
|
|
126
|
+
* @type utility
|
|
127
|
+
*
|
|
128
|
+
*/
|
|
129
|
+
export default function action(this: WebdriverIO.Browser, type: 'key', opts?: Pick<BaseActionParams, 'id'>): KeyAction;
|
|
130
|
+
export default function action(this: WebdriverIO.Browser, type: 'pointer', opts?: BaseActionParams): PointerAction;
|
|
131
|
+
export default function action(this: WebdriverIO.Browser, type: 'wheel', opts?: Pick<BaseActionParams, 'id'>): WheelAction;
|
|
132
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAc,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8HG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,KAAK,EACX,IAAI,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GACpC,SAAS,CAAA;AACZ,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,SAAS,EACf,IAAI,CAAC,EAAE,gBAAgB,GACxB,aAAa,CAAA;AAChB,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,OAAO,EACb,IAAI,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GACpC,WAAW,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { KeyAction, PointerAction, WheelAction } from '../../utils/actions/index.js';
|
|
2
|
+
export default function action(type, opts) {
|
|
3
|
+
if (type === 'key') {
|
|
4
|
+
return new KeyAction(this, opts);
|
|
5
|
+
}
|
|
6
|
+
if (type === 'pointer') {
|
|
7
|
+
return new PointerAction(this, opts);
|
|
8
|
+
}
|
|
9
|
+
if (type === 'wheel') {
|
|
10
|
+
return new WheelAction(this, opts);
|
|
11
|
+
}
|
|
12
|
+
throw new Error(`Unsupported action type "${type}", supported are "key", "pointer", "wheel"`);
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { KeyAction, PointerAction, WheelAction } from '../../utils/actions/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Allows to run multiple action interaction at once, e.g. to simulate a pinch zoom.
|
|
4
|
+
* For more information on the `action` command, check out the [docs](./action).
|
|
5
|
+
*
|
|
6
|
+
* <example>
|
|
7
|
+
:action.js
|
|
8
|
+
it('run multiple actions at once for a pinch zoom', async () => {
|
|
9
|
+
await browser.actions([
|
|
10
|
+
browser.action('pointer')
|
|
11
|
+
.move(500, 500)
|
|
12
|
+
.down()
|
|
13
|
+
.move(250, 250)
|
|
14
|
+
.up(),
|
|
15
|
+
browser.action('pointer')
|
|
16
|
+
.move(500, 500)
|
|
17
|
+
.down()
|
|
18
|
+
.move(750, 750)
|
|
19
|
+
.up()
|
|
20
|
+
])
|
|
21
|
+
});
|
|
22
|
+
* </example>
|
|
23
|
+
*
|
|
24
|
+
* @alias browser.action
|
|
25
|
+
* @type utility
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export default function actions(this: WebdriverIO.Browser, actions: (KeyAction | PointerAction | WheelAction)[]): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,CAAC,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,EAAE,GACrD,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allows to run multiple action interaction at once, e.g. to simulate a pinch zoom.
|
|
3
|
+
* For more information on the `action` command, check out the [docs](./action).
|
|
4
|
+
*
|
|
5
|
+
* <example>
|
|
6
|
+
:action.js
|
|
7
|
+
it('run multiple actions at once for a pinch zoom', async () => {
|
|
8
|
+
await browser.actions([
|
|
9
|
+
browser.action('pointer')
|
|
10
|
+
.move(500, 500)
|
|
11
|
+
.down()
|
|
12
|
+
.move(250, 250)
|
|
13
|
+
.up(),
|
|
14
|
+
browser.action('pointer')
|
|
15
|
+
.move(500, 500)
|
|
16
|
+
.down()
|
|
17
|
+
.move(750, 750)
|
|
18
|
+
.up()
|
|
19
|
+
])
|
|
20
|
+
});
|
|
21
|
+
* </example>
|
|
22
|
+
*
|
|
23
|
+
* @alias browser.action
|
|
24
|
+
* @type utility
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export default async function actions(actions) {
|
|
28
|
+
await this.performActions(actions.map((action) => action.toJSON()));
|
|
29
|
+
await this.releaseActions();
|
|
30
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* The browser method `addCommand` helps you to write your own set of commands.
|
|
3
|
+
* The browser method `addCommand` helps you to write your own set of commands.
|
|
4
4
|
*
|
|
5
5
|
* :::info
|
|
6
6
|
*
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* You can use `call` to execute any async action within your test spec.
|
|
3
|
-
*
|
|
4
|
-
* the promise has resolved.
|
|
2
|
+
* You can use `call` to execute any async action within your test spec.
|
|
3
|
+
* It accepts promises and stops the execution until the promise has been resolved.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* :::info
|
|
6
|
+
*
|
|
7
|
+
* With WebdriverIO deprecating synchronous usage (see [RFC](https://github.com/webdriverio/webdriverio/discussions/6702))
|
|
8
8
|
* this command is not very useful anymore.
|
|
9
9
|
*
|
|
10
|
+
* :::
|
|
11
|
+
*
|
|
10
12
|
* <example>
|
|
11
13
|
:call.js
|
|
12
14
|
it('some testing here', async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/call.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,CAAC,EAAG,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAM5D"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/**
|
|
4
|
-
* You can use `call` to execute any async action within your test spec.
|
|
5
|
-
*
|
|
6
|
-
* the promise has resolved.
|
|
2
|
+
* You can use `call` to execute any async action within your test spec.
|
|
3
|
+
* It accepts promises and stops the execution until the promise has been resolved.
|
|
7
4
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* :::info
|
|
6
|
+
*
|
|
7
|
+
* With WebdriverIO deprecating synchronous usage (see [RFC](https://github.com/webdriverio/webdriverio/discussions/6702))
|
|
10
8
|
* this command is not very useful anymore.
|
|
11
9
|
*
|
|
10
|
+
* :::
|
|
11
|
+
*
|
|
12
12
|
* <example>
|
|
13
13
|
:call.js
|
|
14
14
|
it('some testing here', async () => {
|
|
@@ -40,10 +40,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
* @type utility
|
|
41
41
|
*
|
|
42
42
|
*/
|
|
43
|
-
function call(fn) {
|
|
43
|
+
export default function call(fn) {
|
|
44
44
|
if (typeof fn === 'function') {
|
|
45
45
|
return fn();
|
|
46
46
|
}
|
|
47
47
|
throw new Error('Command argument for "call" needs to be a function');
|
|
48
48
|
}
|
|
49
|
-
exports.default = call;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const getElementObject_1 = require("../../utils/getElementObject");
|
|
5
|
-
const constants_1 = require("../../constants");
|
|
1
|
+
import { enhanceElementsArray } from '../../utils/index.js';
|
|
2
|
+
import { getElements } from '../../utils/getElementObject.js';
|
|
3
|
+
import { ELEMENT_KEY } from '../../constants.js';
|
|
6
4
|
/**
|
|
7
5
|
*
|
|
8
6
|
* The `customs$$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
|
|
@@ -26,7 +24,7 @@ const constants_1 = require("../../constants");
|
|
|
26
24
|
* @param {Any} strategyArguments
|
|
27
25
|
* @return {ElementArray}
|
|
28
26
|
*/
|
|
29
|
-
async function custom$$(strategyName, ...strategyArguments) {
|
|
27
|
+
export default async function custom$$(strategyName, ...strategyArguments) {
|
|
30
28
|
const strategy = this.strategies.get(strategyName);
|
|
31
29
|
if (!strategy) {
|
|
32
30
|
throw Error('No strategy found for ' + strategyName);
|
|
@@ -41,8 +39,7 @@ async function custom$$(strategyName, ...strategyArguments) {
|
|
|
41
39
|
if (!Array.isArray(res)) {
|
|
42
40
|
res = [res];
|
|
43
41
|
}
|
|
44
|
-
res = res.filter(el => !!el && typeof el[
|
|
45
|
-
const elements = res.length ? await
|
|
46
|
-
return
|
|
42
|
+
res = res.filter(el => !!el && typeof el[ELEMENT_KEY] === 'string');
|
|
43
|
+
const elements = res.length ? await getElements.call(this, strategyRef, res) : [];
|
|
44
|
+
return enhanceElementsArray(elements, this, strategyName, 'custom$$', strategyArguments);
|
|
47
45
|
}
|
|
48
|
-
exports.default = custom$$;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:example.js
|
|
7
7
|
it('should fetch the project title', async () => {
|
|
8
8
|
await browser.url('https://webdriver.io')
|
|
9
|
-
|
|
9
|
+
browser.addLocatorStrategy('myStrat', (selector) => {
|
|
10
10
|
return document.querySelectorAll(selector)
|
|
11
11
|
})
|
|
12
12
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const getElementObject_1 = require("../../utils/getElementObject");
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
1
|
+
import { getElement } from '../../utils/getElementObject.js';
|
|
2
|
+
import { ELEMENT_KEY } from '../../constants.js';
|
|
5
3
|
/**
|
|
6
4
|
*
|
|
7
5
|
* The `custom$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
|
|
@@ -10,7 +8,7 @@ const constants_1 = require("../../constants");
|
|
|
10
8
|
:example.js
|
|
11
9
|
it('should fetch the project title', async () => {
|
|
12
10
|
await browser.url('https://webdriver.io')
|
|
13
|
-
|
|
11
|
+
browser.addLocatorStrategy('myStrat', (selector) => {
|
|
14
12
|
return document.querySelectorAll(selector)
|
|
15
13
|
})
|
|
16
14
|
|
|
@@ -25,7 +23,7 @@ const constants_1 = require("../../constants");
|
|
|
25
23
|
* @param {Any} strategyArguments
|
|
26
24
|
* @return {Element}
|
|
27
25
|
*/
|
|
28
|
-
async function custom$(strategyName, ...strategyArguments) {
|
|
26
|
+
export default async function custom$(strategyName, ...strategyArguments) {
|
|
29
27
|
const strategy = this.strategies.get(strategyName);
|
|
30
28
|
if (!strategy) {
|
|
31
29
|
throw Error('No strategy found for ' + strategyName);
|
|
@@ -40,9 +38,8 @@ async function custom$(strategyName, ...strategyArguments) {
|
|
|
40
38
|
if (Array.isArray(res)) {
|
|
41
39
|
res = res[0];
|
|
42
40
|
}
|
|
43
|
-
if (res && typeof res[
|
|
44
|
-
return await
|
|
41
|
+
if (res && typeof res[ELEMENT_KEY] === 'string') {
|
|
42
|
+
return await getElement.call(this, strategyRef, res);
|
|
45
43
|
}
|
|
46
44
|
throw Error('Your locator strategy script must return an element');
|
|
47
45
|
}
|
|
48
|
-
exports.default = custom$;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const serialize_error_1 = require("serialize-error");
|
|
7
|
-
const repl_1 = __importDefault(require("@wdio/repl"));
|
|
1
|
+
import { serializeError } from 'serialize-error';
|
|
2
|
+
import WDIORepl from '@wdio/repl';
|
|
8
3
|
/**
|
|
9
4
|
*
|
|
10
5
|
* This command helps you to debug your integration tests. It stops the running browser and gives
|
|
@@ -35,15 +30,15 @@ const repl_1 = __importDefault(require("@wdio/repl"));
|
|
|
35
30
|
* @type utility
|
|
36
31
|
*
|
|
37
32
|
*/
|
|
38
|
-
function debug(commandTimeout = 5000) {
|
|
39
|
-
const repl = new
|
|
40
|
-
const { introMessage } =
|
|
33
|
+
export default function debug(commandTimeout = 5000) {
|
|
34
|
+
const repl = new WDIORepl();
|
|
35
|
+
const { introMessage } = WDIORepl;
|
|
41
36
|
/**
|
|
42
37
|
* run repl in standalone mode
|
|
43
38
|
*/
|
|
44
|
-
if (!process.env.
|
|
39
|
+
if (!process.env.WDIO_WORKER_ID || typeof process.send !== 'function') {
|
|
45
40
|
// eslint-disable-next-line
|
|
46
|
-
console.log(
|
|
41
|
+
console.log(WDIORepl.introMessage);
|
|
47
42
|
const context = {
|
|
48
43
|
browser: this,
|
|
49
44
|
driver: this,
|
|
@@ -85,7 +80,7 @@ function debug(commandTimeout = 5000) {
|
|
|
85
80
|
name: 'result',
|
|
86
81
|
params: {
|
|
87
82
|
error: true,
|
|
88
|
-
...
|
|
83
|
+
...serializeError(err)
|
|
89
84
|
}
|
|
90
85
|
});
|
|
91
86
|
}
|
|
@@ -105,4 +100,3 @@ function debug(commandTimeout = 5000) {
|
|
|
105
100
|
});
|
|
106
101
|
return new Promise((resolve) => (commandResolve = resolve));
|
|
107
102
|
}
|
|
108
|
-
exports.default = debug;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Delete cookies visible to the current page. By providing a cookie name it
|
|
3
|
+
* just removes the single cookie or more when multiple names are passed.
|
|
4
4
|
*
|
|
5
5
|
* <example>
|
|
6
6
|
:deleteCookie.js
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* </example>
|
|
37
37
|
*
|
|
38
38
|
* @alias browser.deleteCookies
|
|
39
|
-
* @param {String
|
|
39
|
+
* @param {String | String[]} names names of cookies to be deleted
|
|
40
40
|
* @uses webdriver/deleteAllCookies,webdriver/deleteCookie
|
|
41
41
|
* @type cookie
|
|
42
42
|
*
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Delete cookies visible to the current page. By providing a cookie name it
|
|
3
|
+
* just removes the single cookie or more when multiple names are passed.
|
|
6
4
|
*
|
|
7
5
|
* <example>
|
|
8
6
|
:deleteCookie.js
|
|
@@ -38,12 +36,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
36
|
* </example>
|
|
39
37
|
*
|
|
40
38
|
* @alias browser.deleteCookies
|
|
41
|
-
* @param {String
|
|
39
|
+
* @param {String | String[]} names names of cookies to be deleted
|
|
42
40
|
* @uses webdriver/deleteAllCookies,webdriver/deleteCookie
|
|
43
41
|
* @type cookie
|
|
44
42
|
*
|
|
45
43
|
*/
|
|
46
|
-
function deleteCookies(names) {
|
|
44
|
+
export default function deleteCookies(names) {
|
|
47
45
|
if (names === undefined) {
|
|
48
46
|
return this.deleteAllCookies();
|
|
49
47
|
}
|
|
@@ -53,4 +51,3 @@ function deleteCookies(names) {
|
|
|
53
51
|
}
|
|
54
52
|
return Promise.all(namesList.map(name => this.deleteCookie(name)));
|
|
55
53
|
}
|
|
56
|
-
exports.default = deleteCookies;
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
});
|
|
25
25
|
* </example>
|
|
26
26
|
*
|
|
27
|
-
* @param {String|Function} script
|
|
28
|
-
* @param {*=}
|
|
27
|
+
* @param {String|Function} script The script to execute.
|
|
28
|
+
* @param {*=} arguments script arguments
|
|
29
29
|
*
|
|
30
30
|
* @return {*} The script result.
|
|
31
31
|
*
|