webdriverio 7.16.16 → 7.17.0
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/package.json +7 -7
- package/build/commands/browser/$$.d.ts +0 -50
- package/build/commands/browser/$$.d.ts.map +0 -1
- package/build/commands/browser/$$.js +0 -57
- package/build/commands/browser/$.d.ts +0 -77
- package/build/commands/browser/$.d.ts.map +0 -1
- package/build/commands/browser/$.js +0 -91
- package/build/commands/browser/addCommand.d.ts +0 -37
- package/build/commands/browser/addCommand.d.ts.map +0 -1
- package/build/commands/browser/addCommand.js +0 -37
- package/build/commands/browser/call.d.ts +0 -42
- package/build/commands/browser/call.d.ts.map +0 -1
- package/build/commands/browser/call.js +0 -49
- package/build/commands/browser/custom$$.d.ts +0 -26
- package/build/commands/browser/custom$$.d.ts.map +0 -1
- package/build/commands/browser/custom$$.js +0 -47
- package/build/commands/browser/custom$.d.ts +0 -25
- package/build/commands/browser/custom$.d.ts.map +0 -1
- package/build/commands/browser/custom$.js +0 -47
- package/build/commands/browser/debug.d.ts +0 -32
- package/build/commands/browser/debug.d.ts.map +0 -1
- package/build/commands/browser/debug.js +0 -108
- package/build/commands/browser/deleteCookies.d.ts +0 -45
- package/build/commands/browser/deleteCookies.d.ts.map +0 -1
- package/build/commands/browser/deleteCookies.js +0 -56
- package/build/commands/browser/execute.d.ts +0 -37
- package/build/commands/browser/execute.d.ts.map +0 -1
- package/build/commands/browser/execute.js +0 -55
- package/build/commands/browser/executeAsync.d.ts +0 -45
- package/build/commands/browser/executeAsync.d.ts.map +0 -1
- package/build/commands/browser/executeAsync.js +0 -63
- package/build/commands/browser/getCookies.d.ts +0 -34
- package/build/commands/browser/getCookies.d.ts.map +0 -1
- package/build/commands/browser/getCookies.js +0 -46
- package/build/commands/browser/getPuppeteer.d.ts +0 -38
- package/build/commands/browser/getPuppeteer.d.ts.map +0 -1
- package/build/commands/browser/getPuppeteer.js +0 -119
- package/build/commands/browser/getWindowSize.d.ts +0 -25
- package/build/commands/browser/getWindowSize.d.ts.map +0 -1
- package/build/commands/browser/getWindowSize.js +0 -30
- package/build/commands/browser/keys.d.ts +0 -28
- package/build/commands/browser/keys.d.ts.map +0 -1
- package/build/commands/browser/keys.js +0 -64
- package/build/commands/browser/mock.d.ts +0 -111
- package/build/commands/browser/mock.d.ts.map +0 -1
- package/build/commands/browser/mock.js +0 -164
- package/build/commands/browser/mockClearAll.d.ts +0 -28
- package/build/commands/browser/mockClearAll.d.ts.map +0 -1
- package/build/commands/browser/mockClearAll.js +0 -43
- package/build/commands/browser/mockRestoreAll.d.ts +0 -26
- package/build/commands/browser/mockRestoreAll.d.ts.map +0 -1
- package/build/commands/browser/mockRestoreAll.js +0 -41
- package/build/commands/browser/newWindow.d.ts +0 -41
- package/build/commands/browser/newWindow.d.ts.map +0 -1
- package/build/commands/browser/newWindow.js +0 -83
- package/build/commands/browser/overwriteCommand.d.ts +0 -32
- package/build/commands/browser/overwriteCommand.d.ts.map +0 -1
- package/build/commands/browser/overwriteCommand.js +0 -32
- package/build/commands/browser/pause.d.ts +0 -23
- package/build/commands/browser/pause.d.ts.map +0 -1
- package/build/commands/browser/pause.js +0 -27
- package/build/commands/browser/react$$.d.ts +0 -36
- package/build/commands/browser/react$$.d.ts.map +0 -1
- package/build/commands/browser/react$$.js +0 -51
- package/build/commands/browser/react$.d.ts +0 -46
- package/build/commands/browser/react$.d.ts.map +0 -1
- package/build/commands/browser/react$.js +0 -59
- package/build/commands/browser/reloadSession.d.ts +0 -23
- package/build/commands/browser/reloadSession.d.ts.map +0 -1
- package/build/commands/browser/reloadSession.js +0 -58
- package/build/commands/browser/savePDF.d.ts +0 -46
- package/build/commands/browser/savePDF.d.ts.map +0 -1
- package/build/commands/browser/savePDF.js +0 -51
- package/build/commands/browser/saveRecordingScreen.d.ts +0 -28
- package/build/commands/browser/saveRecordingScreen.d.ts.map +0 -1
- package/build/commands/browser/saveRecordingScreen.js +0 -47
- package/build/commands/browser/saveScreenshot.d.ts +0 -22
- package/build/commands/browser/saveScreenshot.d.ts.map +0 -1
- package/build/commands/browser/saveScreenshot.js +0 -41
- package/build/commands/browser/setCookies.d.ts +0 -57
- package/build/commands/browser/setCookies.d.ts.map +0 -1
- package/build/commands/browser/setCookies.js +0 -66
- package/build/commands/browser/setTimeout.d.ts +0 -31
- package/build/commands/browser/setTimeout.d.ts.map +0 -1
- package/build/commands/browser/setTimeout.js +0 -61
- package/build/commands/browser/setWindowSize.d.ts +0 -20
- package/build/commands/browser/setWindowSize.d.ts.map +0 -1
- package/build/commands/browser/setWindowSize.js +0 -43
- package/build/commands/browser/switchWindow.d.ts +0 -30
- package/build/commands/browser/switchWindow.d.ts.map +0 -1
- package/build/commands/browser/switchWindow.js +0 -73
- package/build/commands/browser/throttle.d.ts +0 -3
- package/build/commands/browser/throttle.d.ts.map +0 -1
- package/build/commands/browser/throttle.js +0 -144
- package/build/commands/browser/touchAction.d.ts +0 -61
- package/build/commands/browser/touchAction.d.ts.map +0 -1
- package/build/commands/browser/touchAction.js +0 -65
- package/build/commands/browser/uploadFile.d.ts +0 -32
- package/build/commands/browser/uploadFile.d.ts.map +0 -1
- package/build/commands/browser/uploadFile.js +0 -63
- package/build/commands/browser/url.d.ts +0 -38
- package/build/commands/browser/url.d.ts.map +0 -1
- package/build/commands/browser/url.js +0 -49
- package/build/commands/browser/waitUntil.d.ts +0 -44
- package/build/commands/browser/waitUntil.d.ts.map +0 -1
- package/build/commands/browser/waitUntil.js +0 -73
- package/build/commands/browser.d.ts +0 -70
- package/build/commands/browser.d.ts.map +0 -1
- package/build/commands/browser.js +0 -44
- package/build/commands/constant.d.ts +0 -19
- package/build/commands/constant.d.ts.map +0 -1
- package/build/commands/constant.js +0 -91
- package/build/commands/element/$$.d.ts +0 -46
- package/build/commands/element/$$.d.ts.map +0 -1
- package/build/commands/element/$$.js +0 -50
- package/build/commands/element/$.d.ts +0 -72
- package/build/commands/element/$.d.ts.map +0 -1
- package/build/commands/element/$.js +0 -76
- package/build/commands/element/addValue.d.ts +0 -33
- package/build/commands/element/addValue.d.ts.map +0 -1
- package/build/commands/element/addValue.js +0 -48
- package/build/commands/element/clearValue.d.ts +0 -28
- package/build/commands/element/clearValue.d.ts.map +0 -1
- package/build/commands/element/clearValue.js +0 -32
- package/build/commands/element/click.d.ts +0 -73
- package/build/commands/element/click.d.ts.map +0 -1
- package/build/commands/element/click.js +0 -134
- package/build/commands/element/custom$$.d.ts +0 -28
- package/build/commands/element/custom$$.d.ts.map +0 -1
- package/build/commands/element/custom$$.js +0 -57
- package/build/commands/element/custom$.d.ts +0 -27
- package/build/commands/element/custom$.d.ts.map +0 -1
- package/build/commands/element/custom$.js +0 -57
- package/build/commands/element/doubleClick.d.ts +0 -25
- package/build/commands/element/doubleClick.d.ts.map +0 -1
- package/build/commands/element/doubleClick.js +0 -51
- package/build/commands/element/dragAndDrop.d.ts +0 -41
- package/build/commands/element/dragAndDrop.d.ts.map +0 -1
- package/build/commands/element/dragAndDrop.js +0 -98
- package/build/commands/element/getAttribute.d.ts +0 -28
- package/build/commands/element/getAttribute.d.ts.map +0 -1
- package/build/commands/element/getAttribute.js +0 -32
- package/build/commands/element/getCSSProperty.d.ts +0 -71
- package/build/commands/element/getCSSProperty.d.ts.map +0 -1
- package/build/commands/element/getCSSProperty.js +0 -108
- package/build/commands/element/getComputedLabel.d.ts +0 -20
- package/build/commands/element/getComputedLabel.d.ts.map +0 -1
- package/build/commands/element/getComputedLabel.js +0 -24
- package/build/commands/element/getComputedRole.d.ts +0 -20
- package/build/commands/element/getComputedRole.d.ts.map +0 -1
- package/build/commands/element/getComputedRole.js +0 -24
- package/build/commands/element/getHTML.d.ts +0 -32
- package/build/commands/element/getHTML.d.ts.map +0 -1
- package/build/commands/element/getHTML.js +0 -46
- package/build/commands/element/getLocation.d.ts +0 -6
- package/build/commands/element/getLocation.d.ts.map +0 -1
- package/build/commands/element/getLocation.js +0 -46
- package/build/commands/element/getProperty.d.ts +0 -53
- package/build/commands/element/getProperty.d.ts.map +0 -1
- package/build/commands/element/getProperty.js +0 -31
- package/build/commands/element/getSize.d.ts +0 -6
- package/build/commands/element/getSize.d.ts.map +0 -1
- package/build/commands/element/getSize.js +0 -47
- package/build/commands/element/getTagName.d.ts +0 -25
- package/build/commands/element/getTagName.d.ts.map +0 -1
- package/build/commands/element/getTagName.js +0 -29
- package/build/commands/element/getText.d.ts +0 -42
- package/build/commands/element/getText.d.ts.map +0 -1
- package/build/commands/element/getText.js +0 -46
- package/build/commands/element/getValue.d.ts +0 -25
- package/build/commands/element/getValue.d.ts.map +0 -1
- package/build/commands/element/getValue.js +0 -33
- package/build/commands/element/isClickable.d.ts +0 -40
- package/build/commands/element/isClickable.d.ts.map +0 -1
- package/build/commands/element/isClickable.js +0 -57
- package/build/commands/element/isDisplayed.d.ts +0 -50
- package/build/commands/element/isDisplayed.d.ts.map +0 -1
- package/build/commands/element/isDisplayed.js +0 -85
- package/build/commands/element/isDisplayedInViewport.d.ts +0 -38
- package/build/commands/element/isDisplayedInViewport.d.ts.map +0 -1
- package/build/commands/element/isDisplayedInViewport.js +0 -55
- package/build/commands/element/isEnabled.d.ts +0 -34
- package/build/commands/element/isEnabled.d.ts.map +0 -1
- package/build/commands/element/isEnabled.js +0 -38
- package/build/commands/element/isEqual.d.ts +0 -24
- package/build/commands/element/isEqual.d.ts.map +0 -1
- package/build/commands/element/isEqual.js +0 -52
- package/build/commands/element/isExisting.d.ts +0 -49
- package/build/commands/element/isExisting.d.ts.map +0 -1
- package/build/commands/element/isExisting.js +0 -65
- package/build/commands/element/isFocused.d.ts +0 -28
- package/build/commands/element/isFocused.d.ts.map +0 -1
- package/build/commands/element/isFocused.js +0 -42
- package/build/commands/element/isSelected.d.ts +0 -31
- package/build/commands/element/isSelected.d.ts.map +0 -1
- package/build/commands/element/isSelected.js +0 -35
- package/build/commands/element/moveTo.d.ts +0 -21
- package/build/commands/element/moveTo.d.ts.map +0 -1
- package/build/commands/element/moveTo.js +0 -39
- package/build/commands/element/nextElement.d.ts +0 -25
- package/build/commands/element/nextElement.d.ts.map +0 -1
- package/build/commands/element/nextElement.js +0 -31
- package/build/commands/element/parentElement.d.ts +0 -25
- package/build/commands/element/parentElement.d.ts.map +0 -1
- package/build/commands/element/parentElement.js +0 -31
- package/build/commands/element/previousElement.d.ts +0 -25
- package/build/commands/element/previousElement.d.ts.map +0 -1
- package/build/commands/element/previousElement.js +0 -31
- package/build/commands/element/react$$.d.ts +0 -36
- package/build/commands/element/react$$.d.ts.map +0 -1
- package/build/commands/element/react$$.js +0 -51
- package/build/commands/element/react$.d.ts +0 -46
- package/build/commands/element/react$.d.ts.map +0 -1
- package/build/commands/element/react$.js +0 -59
- package/build/commands/element/saveScreenshot.d.ts +0 -21
- package/build/commands/element/saveScreenshot.d.ts.map +0 -1
- package/build/commands/element/saveScreenshot.js +0 -40
- package/build/commands/element/scrollIntoView.d.ts +0 -21
- package/build/commands/element/scrollIntoView.d.ts.map +0 -1
- package/build/commands/element/scrollIntoView.js +0 -31
- package/build/commands/element/selectByAttribute.d.ts +0 -37
- package/build/commands/element/selectByAttribute.d.ts.map +0 -1
- package/build/commands/element/selectByAttribute.js +0 -59
- package/build/commands/element/selectByIndex.d.ts +0 -31
- package/build/commands/element/selectByIndex.d.ts.map +0 -1
- package/build/commands/element/selectByIndex.js +0 -55
- package/build/commands/element/selectByVisibleText.d.ts +0 -31
- package/build/commands/element/selectByVisibleText.d.ts.map +0 -1
- package/build/commands/element/selectByVisibleText.js +0 -66
- package/build/commands/element/setValue.d.ts +0 -29
- package/build/commands/element/setValue.d.ts.map +0 -1
- package/build/commands/element/setValue.js +0 -33
- package/build/commands/element/shadow$$.d.ts +0 -22
- package/build/commands/element/shadow$$.d.ts.map +0 -1
- package/build/commands/element/shadow$$.js +0 -27
- package/build/commands/element/shadow$.d.ts +0 -22
- package/build/commands/element/shadow$.d.ts.map +0 -1
- package/build/commands/element/shadow$.js +0 -27
- package/build/commands/element/touchAction.d.ts +0 -54
- package/build/commands/element/touchAction.d.ts.map +0 -1
- package/build/commands/element/touchAction.js +0 -58
- package/build/commands/element/waitForClickable.d.ts +0 -34
- package/build/commands/element/waitForClickable.d.ts.map +0 -1
- package/build/commands/element/waitForClickable.js +0 -37
- package/build/commands/element/waitForDisplayed.d.ts +0 -44
- package/build/commands/element/waitForDisplayed.d.ts.map +0 -1
- package/build/commands/element/waitForDisplayed.js +0 -47
- package/build/commands/element/waitForEnabled.d.ts +0 -46
- package/build/commands/element/waitForEnabled.d.ts.map +0 -1
- package/build/commands/element/waitForEnabled.js +0 -55
- package/build/commands/element/waitForExist.d.ts +0 -46
- package/build/commands/element/waitForExist.d.ts.map +0 -1
- package/build/commands/element/waitForExist.js +0 -49
- package/build/commands/element/waitUntil.d.ts +0 -49
- package/build/commands/element/waitUntil.d.ts.map +0 -1
- package/build/commands/element/waitUntil.js +0 -53
- package/build/commands/element.d.ts +0 -100
- package/build/commands/element.d.ts.map +0 -1
- package/build/commands/element.js +0 -63
- package/build/commands/mock/abort.d.ts +0 -19
- package/build/commands/mock/abort.d.ts.map +0 -1
- package/build/commands/mock/abort.js +0 -20
- package/build/commands/mock/abortOnce.d.ts +0 -27
- package/build/commands/mock/abortOnce.d.ts.map +0 -1
- package/build/commands/mock/abortOnce.js +0 -28
- package/build/commands/mock/clear.d.ts +0 -18
- package/build/commands/mock/clear.d.ts.map +0 -1
- package/build/commands/mock/clear.js +0 -19
- package/build/commands/mock/respond.d.ts +0 -54
- package/build/commands/mock/respond.d.ts.map +0 -1
- package/build/commands/mock/respond.js +0 -55
- package/build/commands/mock/respondOnce.d.ts +0 -55
- package/build/commands/mock/respondOnce.d.ts.map +0 -1
- package/build/commands/mock/respondOnce.js +0 -56
- package/build/commands/mock/restore.d.ts +0 -18
- package/build/commands/mock/restore.d.ts.map +0 -1
- package/build/commands/mock/restore.js +0 -19
- package/build/constants.d.ts +0 -14
- package/build/constants.d.ts.map +0 -1
- package/build/constants.js +0 -286
- package/build/index.d.ts +0 -45
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -171
- package/build/middlewares.d.ts +0 -12
- package/build/middlewares.d.ts.map +0 -1
- package/build/middlewares.js +0 -65
- package/build/multiremote.d.ts +0 -71
- package/build/multiremote.d.ts.map +0 -1
- package/build/multiremote.js +0 -160
- package/build/protocol-stub.d.ts +0 -16
- package/build/protocol-stub.d.ts.map +0 -1
- package/build/protocol-stub.js +0 -77
- package/build/scripts/getHTML.d.ts +0 -9
- package/build/scripts/getHTML.d.ts.map +0 -1
- package/build/scripts/getHTML.js +0 -13
- package/build/scripts/getProperty.d.ts +0 -43
- package/build/scripts/getProperty.d.ts.map +0 -1
- package/build/scripts/getProperty.js +0 -12
- package/build/scripts/isElementClickable.d.ts +0 -7
- package/build/scripts/isElementClickable.d.ts.map +0 -1
- package/build/scripts/isElementClickable.js +0 -121
- package/build/scripts/isElementDisplayed.d.ts +0 -7
- package/build/scripts/isElementDisplayed.d.ts.map +0 -1
- package/build/scripts/isElementDisplayed.js +0 -216
- package/build/scripts/isElementInViewport.d.ts +0 -10
- package/build/scripts/isElementInViewport.d.ts.map +0 -1
- package/build/scripts/isElementInViewport.js +0 -22
- package/build/scripts/isFocused.d.ts +0 -7
- package/build/scripts/isFocused.d.ts.map +0 -1
- package/build/scripts/isFocused.js +0 -11
- package/build/scripts/newWindow.d.ts +0 -10
- package/build/scripts/newWindow.d.ts.map +0 -1
- package/build/scripts/newWindow.js +0 -14
- package/build/scripts/resq.d.ts +0 -6
- package/build/scripts/resq.d.ts.map +0 -1
- package/build/scripts/resq.js +0 -58
- package/build/scripts/shadowFnFactory.d.ts +0 -2
- package/build/scripts/shadowFnFactory.d.ts.map +0 -1
- package/build/scripts/shadowFnFactory.js +0 -17
- package/build/types.d.ts +0 -402
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -2
- package/build/utils/SevereServiceError.d.ts +0 -7
- package/build/utils/SevereServiceError.d.ts.map +0 -1
- package/build/utils/SevereServiceError.js +0 -12
- package/build/utils/Timer.d.ts +0 -33
- package/build/utils/Timer.d.ts.map +0 -1
- package/build/utils/Timer.js +0 -126
- package/build/utils/detectBackend.d.ts +0 -23
- package/build/utils/detectBackend.d.ts.map +0 -1
- package/build/utils/detectBackend.js +0 -119
- package/build/utils/findStrategy.d.ts +0 -10
- package/build/utils/findStrategy.d.ts.map +0 -1
- package/build/utils/findStrategy.js +0 -267
- package/build/utils/getElementObject.d.ts +0 -17
- package/build/utils/getElementObject.d.ts.map +0 -1
- package/build/utils/getElementObject.js +0 -107
- package/build/utils/implicitWait.d.ts +0 -7
- package/build/utils/implicitWait.d.ts.map +0 -1
- package/build/utils/implicitWait.js +0 -39
- package/build/utils/index.d.ts +0 -102
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/index.js +0 -543
- package/build/utils/interception/devtools.d.ts +0 -61
- package/build/utils/interception/devtools.d.ts.map +0 -1
- package/build/utils/interception/devtools.js +0 -247
- package/build/utils/interception/index.d.ts +0 -26
- package/build/utils/interception/index.d.ts.map +0 -1
- package/build/utils/interception/index.js +0 -49
- package/build/utils/interception/types.d.ts +0 -94
- package/build/utils/interception/types.d.ts.map +0 -1
- package/build/utils/interception/types.js +0 -2
- package/build/utils/interception/webdriver.d.ts +0 -48
- package/build/utils/interception/webdriver.d.ts.map +0 -1
- package/build/utils/interception/webdriver.js +0 -75
- package/build/utils/refetchElement.d.ts +0 -6
- package/build/utils/refetchElement.d.ts.map +0 -1
- package/build/utils/refetchElement.js +0 -32
package/build/constants.js
DELETED
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ERROR_REASON = exports.DEEP_SELECTOR = exports.FF_REMOTE_DEBUG_ARG = exports.DRIVER_DEFAULT_ENDPOINT = exports.W3C_SELECTOR_STRATEGIES = exports.WDIO_DEFAULTS = exports.ELEMENT_KEY = void 0;
|
|
4
|
-
/* istanbul ignore next */
|
|
5
|
-
const HOOK_DEFINITION = {
|
|
6
|
-
type: 'object',
|
|
7
|
-
validate: (param) => {
|
|
8
|
-
/**
|
|
9
|
-
* option must be an array
|
|
10
|
-
*/
|
|
11
|
-
if (!Array.isArray(param)) {
|
|
12
|
-
throw new Error('a hook option needs to be a list of functions');
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* array elements must be functions
|
|
16
|
-
*/
|
|
17
|
-
for (const option of param) {
|
|
18
|
-
/**
|
|
19
|
-
* either a string
|
|
20
|
-
*/
|
|
21
|
-
if (typeof option === 'function') {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
throw new Error('expected hook to be type of function');
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
exports.ELEMENT_KEY = 'element-6066-11e4-a52e-4f735466cecf';
|
|
29
|
-
exports.WDIO_DEFAULTS = {
|
|
30
|
-
/**
|
|
31
|
-
* allows to specify automation protocol
|
|
32
|
-
*/
|
|
33
|
-
automationProtocol: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
validate: (param) => {
|
|
36
|
-
if (!['webdriver', 'devtools', './protocol-stub'].includes(param.toLowerCase())) {
|
|
37
|
-
throw new Error(`Currently only "webdriver" and "devtools" is supproted as automationProtocol, you set "${param}"`);
|
|
38
|
-
}
|
|
39
|
-
try {
|
|
40
|
-
require.resolve(param);
|
|
41
|
-
}
|
|
42
|
-
catch (err) {
|
|
43
|
-
/* istanbul ignore next */
|
|
44
|
-
throw new Error('Automation protocol package is not installed!\n' +
|
|
45
|
-
`Please install it via \`npm install ${param}\``);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* Define specs for test execution. You can either specify a glob
|
|
51
|
-
* pattern to match multiple files at once or wrap a glob or set of
|
|
52
|
-
* paths into an array to run them within a single worker process.
|
|
53
|
-
*/
|
|
54
|
-
specs: {
|
|
55
|
-
type: 'object',
|
|
56
|
-
validate: (param) => {
|
|
57
|
-
if (!Array.isArray(param)) {
|
|
58
|
-
throw new Error('the "specs" option needs to be a list of strings');
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
/**
|
|
63
|
-
* exclude specs from test execution
|
|
64
|
-
*/
|
|
65
|
-
exclude: {
|
|
66
|
-
type: 'object',
|
|
67
|
-
validate: (param) => {
|
|
68
|
-
if (!Array.isArray(param)) {
|
|
69
|
-
throw new Error('the "exclude" option needs to be a list of strings');
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* key/value definition of suites (named by key) and a list of specs as value
|
|
75
|
-
* to specify a specific set of tests to execute
|
|
76
|
-
*/
|
|
77
|
-
suites: {
|
|
78
|
-
type: 'object'
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* capabilities of WebDriver sessions
|
|
82
|
-
*/
|
|
83
|
-
capabilities: {
|
|
84
|
-
type: 'object',
|
|
85
|
-
validate: (param) => {
|
|
86
|
-
/**
|
|
87
|
-
* should be an object
|
|
88
|
-
*/
|
|
89
|
-
if (!Array.isArray(param)) {
|
|
90
|
-
if (typeof param === 'object') {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
throw new Error('the "capabilities" options needs to be an object or a list of objects');
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* or an array of objects
|
|
97
|
-
*/
|
|
98
|
-
for (const option of param) {
|
|
99
|
-
if (typeof option === 'object') { // Check does not work recursively
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
throw new Error('expected every item of a list of capabilities to be of type object');
|
|
103
|
-
}
|
|
104
|
-
return true;
|
|
105
|
-
},
|
|
106
|
-
required: true
|
|
107
|
-
},
|
|
108
|
-
/**
|
|
109
|
-
* Shorten navigateTo command calls by setting a base url
|
|
110
|
-
*/
|
|
111
|
-
baseUrl: {
|
|
112
|
-
type: 'string'
|
|
113
|
-
},
|
|
114
|
-
/**
|
|
115
|
-
* If you only want to run your tests until a specific amount of tests have failed use
|
|
116
|
-
* bail (default is 0 - don't bail, run all tests).
|
|
117
|
-
*/
|
|
118
|
-
bail: {
|
|
119
|
-
type: 'number',
|
|
120
|
-
default: 0
|
|
121
|
-
},
|
|
122
|
-
/**
|
|
123
|
-
* Default interval for all waitFor* commands
|
|
124
|
-
*/
|
|
125
|
-
waitforInterval: {
|
|
126
|
-
type: 'number',
|
|
127
|
-
default: 500
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* Default timeout for all waitFor* commands
|
|
131
|
-
*/
|
|
132
|
-
waitforTimeout: {
|
|
133
|
-
type: 'number',
|
|
134
|
-
default: 3000
|
|
135
|
-
},
|
|
136
|
-
/**
|
|
137
|
-
* supported test framework by wdio testrunner
|
|
138
|
-
*/
|
|
139
|
-
framework: {
|
|
140
|
-
type: 'string'
|
|
141
|
-
},
|
|
142
|
-
/**
|
|
143
|
-
* list of reporters to use, a reporter can be either a string or an object with
|
|
144
|
-
* reporter options, e.g.:
|
|
145
|
-
* [
|
|
146
|
-
* 'dot',
|
|
147
|
-
* {
|
|
148
|
-
* name: 'spec',
|
|
149
|
-
* outputDir: __dirname + '/reports'
|
|
150
|
-
* }
|
|
151
|
-
* ]
|
|
152
|
-
*/
|
|
153
|
-
reporters: {
|
|
154
|
-
type: 'object',
|
|
155
|
-
validate: (param) => {
|
|
156
|
-
/**
|
|
157
|
-
* option must be an array
|
|
158
|
-
*/
|
|
159
|
-
if (!Array.isArray(param)) {
|
|
160
|
-
throw new Error('the "reporters" options needs to be a list of strings');
|
|
161
|
-
}
|
|
162
|
-
const isValidReporter = (option) => ((typeof option === 'string') ||
|
|
163
|
-
(typeof option === 'function'));
|
|
164
|
-
/**
|
|
165
|
-
* array elements must be:
|
|
166
|
-
*/
|
|
167
|
-
for (const option of param) {
|
|
168
|
-
/**
|
|
169
|
-
* either a string or a function (custom reporter)
|
|
170
|
-
*/
|
|
171
|
-
if (isValidReporter(option)) {
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* or an array with the name of the reporter as first element and the options
|
|
176
|
-
* as second element
|
|
177
|
-
*/
|
|
178
|
-
if (Array.isArray(option) &&
|
|
179
|
-
typeof option[1] === 'object' &&
|
|
180
|
-
isValidReporter(option[0])) {
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
throw new Error('a reporter should be either a string in the format "wdio-<reportername>-reporter" ' +
|
|
184
|
-
'or a function/class. Please see the docs for more information on custom reporters ' +
|
|
185
|
-
'(https://webdriver.io/docs/customreporter)');
|
|
186
|
-
}
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
/**
|
|
191
|
-
* set of WDIO services to use
|
|
192
|
-
*/
|
|
193
|
-
services: {
|
|
194
|
-
type: 'object',
|
|
195
|
-
validate: (param) => {
|
|
196
|
-
/**
|
|
197
|
-
* should be an array
|
|
198
|
-
*/
|
|
199
|
-
if (!Array.isArray(param)) {
|
|
200
|
-
throw new Error('the "services" options needs to be a list of strings and/or arrays');
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* with arrays and/or strings
|
|
204
|
-
*/
|
|
205
|
-
for (const option of param) {
|
|
206
|
-
if (!Array.isArray(option)) {
|
|
207
|
-
if (typeof option === 'string') {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
throw new Error('the "services" options needs to be a list of strings and/or arrays');
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return true;
|
|
214
|
-
},
|
|
215
|
-
default: []
|
|
216
|
-
},
|
|
217
|
-
/**
|
|
218
|
-
* Node arguments to specify when launching child processes
|
|
219
|
-
*/
|
|
220
|
-
execArgv: {
|
|
221
|
-
type: 'object',
|
|
222
|
-
validate: (param) => {
|
|
223
|
-
if (!Array.isArray(param)) {
|
|
224
|
-
throw new Error('the "execArgv" options needs to be a list of strings');
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
default: []
|
|
228
|
-
},
|
|
229
|
-
/**
|
|
230
|
-
* amount of instances to be allowed to run in total
|
|
231
|
-
*/
|
|
232
|
-
maxInstances: {
|
|
233
|
-
type: 'number'
|
|
234
|
-
},
|
|
235
|
-
/**
|
|
236
|
-
* amount of instances to be allowed to run per capability
|
|
237
|
-
*/
|
|
238
|
-
maxInstancesPerCapability: {
|
|
239
|
-
type: 'number'
|
|
240
|
-
},
|
|
241
|
-
/**
|
|
242
|
-
* list of strings to watch of `wdio` command is called with `--watch` flag
|
|
243
|
-
*/
|
|
244
|
-
filesToWatch: {
|
|
245
|
-
type: 'object',
|
|
246
|
-
validate: (param) => {
|
|
247
|
-
if (!Array.isArray(param)) {
|
|
248
|
-
throw new Error('the "filesToWatch" options needs to be a list of strings');
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
/**
|
|
253
|
-
* hooks
|
|
254
|
-
*/
|
|
255
|
-
onPrepare: HOOK_DEFINITION,
|
|
256
|
-
onWorkerStart: HOOK_DEFINITION,
|
|
257
|
-
before: HOOK_DEFINITION,
|
|
258
|
-
beforeSession: HOOK_DEFINITION,
|
|
259
|
-
beforeSuite: HOOK_DEFINITION,
|
|
260
|
-
beforeHook: HOOK_DEFINITION,
|
|
261
|
-
beforeTest: HOOK_DEFINITION,
|
|
262
|
-
beforeCommand: HOOK_DEFINITION,
|
|
263
|
-
afterCommand: HOOK_DEFINITION,
|
|
264
|
-
afterTest: HOOK_DEFINITION,
|
|
265
|
-
afterHook: HOOK_DEFINITION,
|
|
266
|
-
afterSuite: HOOK_DEFINITION,
|
|
267
|
-
afterSession: HOOK_DEFINITION,
|
|
268
|
-
after: HOOK_DEFINITION,
|
|
269
|
-
onComplete: HOOK_DEFINITION,
|
|
270
|
-
onReload: HOOK_DEFINITION
|
|
271
|
-
};
|
|
272
|
-
exports.W3C_SELECTOR_STRATEGIES = ['css selector', 'link text', 'partial link text', 'tag name', 'xpath'];
|
|
273
|
-
exports.DRIVER_DEFAULT_ENDPOINT = {
|
|
274
|
-
method: 'GET',
|
|
275
|
-
host: 'localhost',
|
|
276
|
-
port: 4444,
|
|
277
|
-
path: '/status'
|
|
278
|
-
};
|
|
279
|
-
exports.FF_REMOTE_DEBUG_ARG = '-remote-debugging-port';
|
|
280
|
-
exports.DEEP_SELECTOR = '>>>';
|
|
281
|
-
exports.ERROR_REASON = [
|
|
282
|
-
'Failed', 'Aborted', 'TimedOut', 'AccessDenied', 'ConnectionClosed',
|
|
283
|
-
'ConnectionReset', 'ConnectionRefused', 'ConnectionAborted',
|
|
284
|
-
'ConnectionFailed', 'NameNotResolved', 'InternetDisconnected',
|
|
285
|
-
'AddressUnreachable', 'BlockedByClient', 'BlockedByResponse'
|
|
286
|
-
];
|
package/build/index.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Options, Capabilities } from '@wdio/types';
|
|
2
|
-
import SevereServiceErrorImport from './utils/SevereServiceError';
|
|
3
|
-
import type { AttachOptions } from './types';
|
|
4
|
-
export declare type RemoteOptions = Options.WebdriverIO & Omit<Options.Testrunner, 'capabilities'>;
|
|
5
|
-
/**
|
|
6
|
-
* A method to create a new session with WebdriverIO.
|
|
7
|
-
*
|
|
8
|
-
* <b>
|
|
9
|
-
* NOTE: If you hit "error TS2694: Namespace 'global.WebdriverIO' has no exported member 'Browser'" when using typescript,
|
|
10
|
-
* add "webdriverio/async" into tsconfig.json's "types" array will solve it: <code> { "compilerOptions": { "types": ["webdriverio/async"] } } </code>
|
|
11
|
-
* </b>
|
|
12
|
-
*
|
|
13
|
-
* @param {Object} [params={}] Options to create the session with
|
|
14
|
-
* @param {function} remoteModifier Modifier function to change the monad object
|
|
15
|
-
* @return {object} browser object with sessionId
|
|
16
|
-
* @see <a href="https://webdriver.io/docs/typescript">Typescript setup</a>
|
|
17
|
-
*/
|
|
18
|
-
export declare const remote: (params: RemoteOptions, remoteModifier?: Function | undefined) => Promise<WebdriverIO.Browser>;
|
|
19
|
-
export declare const attach: (attachOptions: AttachOptions) => Promise<WebdriverIO.Browser>;
|
|
20
|
-
/**
|
|
21
|
-
* WebdriverIO allows you to run multiple automated sessions in a single test.
|
|
22
|
-
* This is handy when you’re testing features that require multiple users (for example, chat or WebRTC applications).
|
|
23
|
-
*
|
|
24
|
-
* Instead of creating a couple of remote instances where you need to execute common commands like newSession() or url() on each instance,
|
|
25
|
-
* you can simply create a multiremote instance and control all browsers at the same time.
|
|
26
|
-
*
|
|
27
|
-
* <b>
|
|
28
|
-
* NOTE: Multiremote is not meant to execute all your tests in parallel.
|
|
29
|
-
* It is intended to help coordinate multiple browsers and/or mobile devices for special integration tests (e.g. chat applications).
|
|
30
|
-
* </b>
|
|
31
|
-
*
|
|
32
|
-
* @param params capabilities to choose desired devices.
|
|
33
|
-
* @param automationProtocol
|
|
34
|
-
* @return All remote instances, the first result represents the capability defined first in the capability object,
|
|
35
|
-
* the second result the second capability and so on.
|
|
36
|
-
*
|
|
37
|
-
* @see <a href="https://webdriver.io/docs/multiremote">External document and example usage</a>.
|
|
38
|
-
*/
|
|
39
|
-
export declare const multiremote: (params: Capabilities.MultiRemoteCapabilities, { automationProtocol }?: {
|
|
40
|
-
automationProtocol?: string | undefined;
|
|
41
|
-
}) => Promise<WebdriverIO.MultiRemoteBrowser>;
|
|
42
|
-
export declare const SevereServiceError: typeof SevereServiceErrorImport;
|
|
43
|
-
export * from './types';
|
|
44
|
-
export * from './utils/interception/types';
|
|
45
|
-
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAKnD,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AAOjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,oBAAY,aAAa,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA;AAE1F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,WAA2B,aAAa,4CAA8B,QAAQ,YAAY,OAAO,CA+CnH,CAAA;AAED,eAAO,MAAM,MAAM,kBAAkC,aAAa,KAAG,QAAQ,YAAY,OAAO,CAmB/F,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,WACZ,aAAa,uBAAuB;;MAE7C,QAAQ,YAAY,kBAAkB,CAgExC,CAAA;AAED,eAAO,MAAM,kBAAkB,iCAA2B,CAAA;AAC1D,cAAc,SAAS,CAAA;AACvB,cAAc,4BAA4B,CAAA"}
|
package/build/index.js
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.SevereServiceError = exports.multiremote = exports.attach = exports.remote = void 0;
|
|
29
|
-
const logger_1 = __importDefault(require("@wdio/logger"));
|
|
30
|
-
const webdriver_1 = __importDefault(require("webdriver"));
|
|
31
|
-
const webdriver_2 = require("webdriver");
|
|
32
|
-
const config_1 = require("@wdio/config");
|
|
33
|
-
const utils_1 = require("@wdio/utils");
|
|
34
|
-
const multiremote_1 = __importDefault(require("./multiremote"));
|
|
35
|
-
const SevereServiceError_1 = __importDefault(require("./utils/SevereServiceError"));
|
|
36
|
-
const detectBackend_1 = __importDefault(require("./utils/detectBackend"));
|
|
37
|
-
const constants_1 = require("./constants");
|
|
38
|
-
const utils_2 = require("./utils");
|
|
39
|
-
/**
|
|
40
|
-
* A method to create a new session with WebdriverIO.
|
|
41
|
-
*
|
|
42
|
-
* <b>
|
|
43
|
-
* NOTE: If you hit "error TS2694: Namespace 'global.WebdriverIO' has no exported member 'Browser'" when using typescript,
|
|
44
|
-
* add "webdriverio/async" into tsconfig.json's "types" array will solve it: <code> { "compilerOptions": { "types": ["webdriverio/async"] } } </code>
|
|
45
|
-
* </b>
|
|
46
|
-
*
|
|
47
|
-
* @param {Object} [params={}] Options to create the session with
|
|
48
|
-
* @param {function} remoteModifier Modifier function to change the monad object
|
|
49
|
-
* @return {object} browser object with sessionId
|
|
50
|
-
* @see <a href="https://webdriver.io/docs/typescript">Typescript setup</a>
|
|
51
|
-
*/
|
|
52
|
-
const remote = async function (params, remoteModifier) {
|
|
53
|
-
logger_1.default.setLogLevelsConfig(params.logLevels, params.logLevel);
|
|
54
|
-
const config = (0, config_1.validateConfig)(constants_1.WDIO_DEFAULTS, params, Object.keys(webdriver_2.DEFAULTS));
|
|
55
|
-
const automationProtocol = await (0, utils_2.getAutomationProtocol)(config);
|
|
56
|
-
const modifier = (client, options) => {
|
|
57
|
-
/**
|
|
58
|
-
* overwrite instance options with default values of the protocol
|
|
59
|
-
* package (without undefined properties)
|
|
60
|
-
*/
|
|
61
|
-
Object.assign(options, Object.entries(config)
|
|
62
|
-
.reduce((a, [k, v]) => (v == null ? a : { ...a, [k]: v }), {}));
|
|
63
|
-
if (typeof remoteModifier === 'function') {
|
|
64
|
-
client = remoteModifier(client, options);
|
|
65
|
-
}
|
|
66
|
-
options.automationProtocol = automationProtocol;
|
|
67
|
-
return client;
|
|
68
|
-
};
|
|
69
|
-
const prototype = (0, utils_2.getPrototype)('browser');
|
|
70
|
-
const ProtocolDriver = (await Promise.resolve().then(() => __importStar(require(automationProtocol)))).default;
|
|
71
|
-
params = Object.assign({}, (0, detectBackend_1.default)(params), params);
|
|
72
|
-
await (0, utils_2.updateCapabilities)(params, automationProtocol);
|
|
73
|
-
const instance = await ProtocolDriver.newSession(params, modifier, prototype, utils_1.wrapCommand);
|
|
74
|
-
/**
|
|
75
|
-
* we need to overwrite the original addCommand and overwriteCommand
|
|
76
|
-
* in order to wrap the function within Fibers (only if webdriverio
|
|
77
|
-
* is used with @wdio/cli)
|
|
78
|
-
*/
|
|
79
|
-
if (params.framework && !(0, utils_2.isStub)(automationProtocol)) {
|
|
80
|
-
const origAddCommand = instance.addCommand.bind(instance);
|
|
81
|
-
instance.addCommand = (name, fn, attachToElement) => (origAddCommand(name, (0, utils_1.runFnInFiberContext)(fn), attachToElement));
|
|
82
|
-
const origOverwriteCommand = instance.overwriteCommand.bind(instance);
|
|
83
|
-
instance.overwriteCommand = (name, fn, attachToElement) => (origOverwriteCommand(name, (0, utils_1.runFnInFiberContext)(fn), attachToElement));
|
|
84
|
-
}
|
|
85
|
-
instance.addLocatorStrategy = (0, utils_2.addLocatorStrategyHandler)(instance);
|
|
86
|
-
return instance;
|
|
87
|
-
};
|
|
88
|
-
exports.remote = remote;
|
|
89
|
-
const attach = async function (attachOptions) {
|
|
90
|
-
var _a, _b;
|
|
91
|
-
/**
|
|
92
|
-
* copy instances properties into new object
|
|
93
|
-
*/
|
|
94
|
-
const params = {
|
|
95
|
-
...attachOptions,
|
|
96
|
-
options: { ...attachOptions.options },
|
|
97
|
-
...(0, detectBackend_1.default)(attachOptions),
|
|
98
|
-
requestedCapabilities: attachOptions.requestedCapabilities
|
|
99
|
-
};
|
|
100
|
-
const prototype = (0, utils_2.getPrototype)('browser');
|
|
101
|
-
let automationProtocol = 'webdriver';
|
|
102
|
-
if ((_a = params.options) === null || _a === void 0 ? void 0 : _a.automationProtocol) {
|
|
103
|
-
automationProtocol = (_b = params.options) === null || _b === void 0 ? void 0 : _b.automationProtocol;
|
|
104
|
-
}
|
|
105
|
-
const ProtocolDriver = (await Promise.resolve().then(() => __importStar(require(automationProtocol)))).default;
|
|
106
|
-
return ProtocolDriver.attachToSession(params, undefined, prototype, utils_1.wrapCommand);
|
|
107
|
-
};
|
|
108
|
-
exports.attach = attach;
|
|
109
|
-
/**
|
|
110
|
-
* WebdriverIO allows you to run multiple automated sessions in a single test.
|
|
111
|
-
* This is handy when you’re testing features that require multiple users (for example, chat or WebRTC applications).
|
|
112
|
-
*
|
|
113
|
-
* Instead of creating a couple of remote instances where you need to execute common commands like newSession() or url() on each instance,
|
|
114
|
-
* you can simply create a multiremote instance and control all browsers at the same time.
|
|
115
|
-
*
|
|
116
|
-
* <b>
|
|
117
|
-
* NOTE: Multiremote is not meant to execute all your tests in parallel.
|
|
118
|
-
* It is intended to help coordinate multiple browsers and/or mobile devices for special integration tests (e.g. chat applications).
|
|
119
|
-
* </b>
|
|
120
|
-
*
|
|
121
|
-
* @param params capabilities to choose desired devices.
|
|
122
|
-
* @param automationProtocol
|
|
123
|
-
* @return All remote instances, the first result represents the capability defined first in the capability object,
|
|
124
|
-
* the second result the second capability and so on.
|
|
125
|
-
*
|
|
126
|
-
* @see <a href="https://webdriver.io/docs/multiremote">External document and example usage</a>.
|
|
127
|
-
*/
|
|
128
|
-
const multiremote = async function (params, { automationProtocol } = {}) {
|
|
129
|
-
const multibrowser = new multiremote_1.default();
|
|
130
|
-
const browserNames = Object.keys(params);
|
|
131
|
-
/**
|
|
132
|
-
* create all instance sessions
|
|
133
|
-
*/
|
|
134
|
-
await Promise.all(browserNames.map(async (browserName) => {
|
|
135
|
-
const instance = await (0, exports.remote)(params[browserName]);
|
|
136
|
-
return multibrowser.addInstance(browserName, instance);
|
|
137
|
-
}));
|
|
138
|
-
/**
|
|
139
|
-
* use attachToSession capability to wrap instances around blank pod
|
|
140
|
-
*/
|
|
141
|
-
const prototype = (0, utils_2.getPrototype)('browser');
|
|
142
|
-
const sessionParams = (0, utils_2.isStub)(automationProtocol) ? undefined : {
|
|
143
|
-
sessionId: '',
|
|
144
|
-
isW3C: multibrowser.instances[browserNames[0]].isW3C,
|
|
145
|
-
logLevel: multibrowser.instances[browserNames[0]].options.logLevel
|
|
146
|
-
};
|
|
147
|
-
const ProtocolDriver = automationProtocol && (0, utils_2.isStub)(automationProtocol)
|
|
148
|
-
? require(automationProtocol).default
|
|
149
|
-
: webdriver_1.default;
|
|
150
|
-
const driver = ProtocolDriver.attachToSession(sessionParams, multibrowser.modifier.bind(multibrowser), prototype, utils_1.wrapCommand);
|
|
151
|
-
/**
|
|
152
|
-
* in order to get custom command overwritten or added to multiremote instance
|
|
153
|
-
* we need to pass in the prototype of the multibrowser
|
|
154
|
-
*/
|
|
155
|
-
if (!(0, utils_2.isStub)(automationProtocol)) {
|
|
156
|
-
const origAddCommand = driver.addCommand.bind(driver);
|
|
157
|
-
driver.addCommand = (name, fn, attachToElement) => {
|
|
158
|
-
return origAddCommand(name, (0, utils_1.runFnInFiberContext)(fn), attachToElement, Object.getPrototypeOf(multibrowser.baseInstance), multibrowser.instances);
|
|
159
|
-
};
|
|
160
|
-
const origOverwriteCommand = driver.overwriteCommand.bind(driver);
|
|
161
|
-
driver.overwriteCommand = (name, fn, attachToElement) => {
|
|
162
|
-
return origOverwriteCommand(name, (0, utils_1.runFnInFiberContext)(fn), attachToElement, Object.getPrototypeOf(multibrowser.baseInstance), multibrowser.instances);
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
driver.addLocatorStrategy = (0, utils_2.addLocatorStrategyHandler)(driver);
|
|
166
|
-
return driver;
|
|
167
|
-
};
|
|
168
|
-
exports.multiremote = multiremote;
|
|
169
|
-
exports.SevereServiceError = SevereServiceError_1.default;
|
|
170
|
-
__exportStar(require("./types"), exports);
|
|
171
|
-
__exportStar(require("./utils/interception/types"), exports);
|
package/build/middlewares.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This method is an command wrapper for elements that checks if a command is called
|
|
3
|
-
* that wasn't found on the page and automatically waits for it
|
|
4
|
-
*
|
|
5
|
-
* @param {Function} fn commandWrap from wdio-sync package (or shim if not running in sync)
|
|
6
|
-
*/
|
|
7
|
-
export declare const elementErrorHandler: (fn: Function) => (commandName: string, commandFn: Function) => (this: WebdriverIO.Element, ...args: any[]) => any;
|
|
8
|
-
/**
|
|
9
|
-
* handle single command calls from multiremote instances
|
|
10
|
-
*/
|
|
11
|
-
export declare const multiremoteHandler: (wrapCommand: Function) => (commandName: keyof WebdriverIO.Browser) => any;
|
|
12
|
-
//# sourceMappingURL=middlewares.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"middlewares.d.ts","sourceRoot":"","sources":["../src/middlewares.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,OAAQ,QAAQ,mBAAmB,MAAM,aAAa,QAAQ,YACvC,mBAAmB,WAAW,GAAG,EAAE,QAsCzF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,gBACd,QAAQ,mBACN,MAAM,YAAY,OAAO,QAU3C,CAAA"}
|
package/build/middlewares.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
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
|
-
exports.multiremoteHandler = exports.elementErrorHandler = void 0;
|
|
7
|
-
const refetchElement_1 = __importDefault(require("./utils/refetchElement"));
|
|
8
|
-
const implicitWait_1 = __importDefault(require("./utils/implicitWait"));
|
|
9
|
-
const utils_1 = require("./utils");
|
|
10
|
-
const constants_1 = require("./constants");
|
|
11
|
-
/**
|
|
12
|
-
* This method is an command wrapper for elements that checks if a command is called
|
|
13
|
-
* that wasn't found on the page and automatically waits for it
|
|
14
|
-
*
|
|
15
|
-
* @param {Function} fn commandWrap from wdio-sync package (or shim if not running in sync)
|
|
16
|
-
*/
|
|
17
|
-
const elementErrorHandler = (fn) => (commandName, commandFn) => {
|
|
18
|
-
return function elementErrorHandlerCallback(...args) {
|
|
19
|
-
return fn(commandName, async function elementErrorHandlerCallbackFn() {
|
|
20
|
-
const element = await (0, implicitWait_1.default)(this, commandName);
|
|
21
|
-
this.elementId = element.elementId;
|
|
22
|
-
this[constants_1.ELEMENT_KEY] = element.elementId;
|
|
23
|
-
try {
|
|
24
|
-
const result = await fn(commandName, commandFn).apply(this, args);
|
|
25
|
-
/**
|
|
26
|
-
* assume Safari responses like { error: 'no such element', message: '', stacktrace: '' }
|
|
27
|
-
* as `stale element reference`
|
|
28
|
-
*/
|
|
29
|
-
const caps = (0, utils_1.getBrowserObject)(this).capabilities;
|
|
30
|
-
if (caps && caps.browserName === 'safari' &&
|
|
31
|
-
result && result.error === 'no such element') {
|
|
32
|
-
const errorName = 'stale element reference';
|
|
33
|
-
const err = new Error(errorName);
|
|
34
|
-
err.name = errorName;
|
|
35
|
-
throw err;
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
if (err.name === 'stale element reference') {
|
|
41
|
-
const element = await (0, refetchElement_1.default)(this, commandName);
|
|
42
|
-
this.elementId = element.elementId;
|
|
43
|
-
this.parent = element.parent;
|
|
44
|
-
return await fn(commandName, commandFn).apply(this, args);
|
|
45
|
-
}
|
|
46
|
-
throw err;
|
|
47
|
-
}
|
|
48
|
-
}).apply(this);
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
exports.elementErrorHandler = elementErrorHandler;
|
|
52
|
-
/**
|
|
53
|
-
* handle single command calls from multiremote instances
|
|
54
|
-
*/
|
|
55
|
-
const multiremoteHandler = (wrapCommand) => (commandName) => {
|
|
56
|
-
return wrapCommand(commandName, function (...args) {
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
const commandResults = this.instances.map((instanceName) => {
|
|
59
|
-
// @ts-ignore ToDo(Christian)
|
|
60
|
-
return this[instanceName][commandName](...args);
|
|
61
|
-
});
|
|
62
|
-
return Promise.all(commandResults);
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
exports.multiremoteHandler = multiremoteHandler;
|
package/build/multiremote.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { Options } from '@wdio/types';
|
|
2
|
-
import type { ProtocolCommands } from '@wdio/protocols';
|
|
3
|
-
import type { BrowserCommandsType } from './types';
|
|
4
|
-
declare type EventEmitter = (args: any) => void;
|
|
5
|
-
declare type MultiRemoteElement = {
|
|
6
|
-
selector: string;
|
|
7
|
-
instances: string[];
|
|
8
|
-
isMultiremote: boolean;
|
|
9
|
-
__propertiesObject__: Record<string, PropertyDescriptor>;
|
|
10
|
-
} & {
|
|
11
|
-
[instanceName: string]: WebdriverIO.Element;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Multiremote class
|
|
15
|
-
*/
|
|
16
|
-
export default class MultiRemote {
|
|
17
|
-
instances: Record<string, WebdriverIO.Browser>;
|
|
18
|
-
baseInstance?: MultiRemoteDriver;
|
|
19
|
-
sessionId?: string;
|
|
20
|
-
/**
|
|
21
|
-
* add instance to multibrowser instance
|
|
22
|
-
*/
|
|
23
|
-
addInstance(browserName: string, client: any): Promise<WebdriverIO.Browser>;
|
|
24
|
-
/**
|
|
25
|
-
* modifier for multibrowser instance
|
|
26
|
-
*/
|
|
27
|
-
modifier(wrapperClient: {
|
|
28
|
-
options: Options.WebdriverIO;
|
|
29
|
-
commandList: (keyof (ProtocolCommands & BrowserCommandsType))[];
|
|
30
|
-
}): any;
|
|
31
|
-
/**
|
|
32
|
-
* helper method to generate element objects from results, so that we can call, e.g.
|
|
33
|
-
*
|
|
34
|
-
* ```
|
|
35
|
-
* const elem = $('#elem')
|
|
36
|
-
* elem.getHTML()
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* or in case multiremote is used
|
|
40
|
-
*
|
|
41
|
-
* ```
|
|
42
|
-
* const elems = $$('div')
|
|
43
|
-
* elems[0].getHTML()
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
static elementWrapper(instances: Record<string, WebdriverIO.Browser>, result: any, propertiesObject: Record<string, PropertyDescriptor>, scope: MultiRemote): MultiRemoteElement;
|
|
47
|
-
/**
|
|
48
|
-
* handle commands for multiremote instances
|
|
49
|
-
*/
|
|
50
|
-
commandWrapper(commandName: keyof (ProtocolCommands & BrowserCommandsType)): (...args: any) => Promise<unknown>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* event listener class that propagates events to sub drivers
|
|
54
|
-
*/
|
|
55
|
-
export declare class MultiRemoteDriver {
|
|
56
|
-
instances: string[];
|
|
57
|
-
isMultiremote: true;
|
|
58
|
-
__propertiesObject__: Record<string, PropertyDescriptor>;
|
|
59
|
-
constructor(instances: Record<string, WebdriverIO.Browser>, propertiesObject: Record<string, PropertyDescriptor>);
|
|
60
|
-
on(this: WebdriverIO.MultiRemoteBrowser, eventName: string, emitter: EventEmitter): any;
|
|
61
|
-
once(this: WebdriverIO.MultiRemoteBrowser, eventName: string, emitter: EventEmitter): any;
|
|
62
|
-
emit(this: WebdriverIO.MultiRemoteBrowser, eventName: string, emitter: EventEmitter): boolean;
|
|
63
|
-
eventNames(this: WebdriverIO.MultiRemoteBrowser): any;
|
|
64
|
-
getMaxListeners(this: WebdriverIO.MultiRemoteBrowser): number;
|
|
65
|
-
listenerCount(this: WebdriverIO.MultiRemoteBrowser, eventName: string): number;
|
|
66
|
-
listeners(this: WebdriverIO.MultiRemoteBrowser, eventName: string): Function[];
|
|
67
|
-
removeListener(this: WebdriverIO.MultiRemoteBrowser, eventName: string, emitter: EventEmitter): any;
|
|
68
|
-
removeAllListeners(this: WebdriverIO.MultiRemoteBrowser, eventName: string): any;
|
|
69
|
-
}
|
|
70
|
-
export {};
|
|
71
|
-
//# sourceMappingURL=multiremote.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multiremote.d.ts","sourceRoot":"","sources":["../src/multiremote.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAIvD,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,SAAS,CAAA;AAEtE,aAAK,YAAY,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAA;AAEvC,aAAK,kBAAkB,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;CAC3D,GAAG;IACA,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAA;CAC9C,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAK;IACnD,YAAY,CAAC,EAAE,iBAAiB,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACG,WAAW,CAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;IAKnD;;OAEG;IACH,QAAQ,CAAE,aAAa,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;QAAC,WAAW,EAAE,CAAC,MAAM,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC,EAAE,CAAA;KAAE;IA6B1H;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,cAAc,CACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAC9C,MAAM,EAAE,GAAG,EACX,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACpD,KAAK,EAAE,WAAW,GACnB,kBAAkB;IAsBrB;;OAEG;IACH,cAAc,CAAE,WAAW,EAAE,MAAM,CAAC,gBAAgB,GAAG,mBAAmB,CAAC;CAgC9E;AAED;;GAEG;AAEH,qBAAa,iBAAiB;IAC1B,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,aAAa,OAAe;IAC5B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;gBAGpD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAC9C,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAMxD,EAAE,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAKlF,IAAI,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAKpF,IAAI,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAMpF,UAAU,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB;IAMhD,eAAe,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB;IAMrD,aAAa,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM;IAMtE,SAAS,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM;IASlE,cAAc,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAK9F,kBAAkB,CAAE,IAAI,EAAE,WAAW,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM;CAI9E"}
|