@wdio/utils 6.5.0 → 6.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/build/envDetector.d.ts +39 -0
  2. package/build/envDetector.d.ts.map +1 -0
  3. package/build/envDetector.js +93 -96
  4. package/build/index.d.ts +9 -0
  5. package/build/index.d.ts.map +1 -0
  6. package/build/index.js +36 -164
  7. package/build/initialisePlugin.d.ts +3 -0
  8. package/build/initialisePlugin.d.ts.map +1 -0
  9. package/build/initialisePlugin.js +28 -31
  10. package/build/initialiseServices.d.ts +8 -0
  11. package/build/initialiseServices.d.ts.map +1 -0
  12. package/build/initialiseServices.js +73 -88
  13. package/build/monad.d.ts +22 -0
  14. package/build/monad.d.ts.map +1 -0
  15. package/build/monad.js +102 -140
  16. package/build/shim.d.ts +14 -0
  17. package/build/shim.d.ts.map +1 -0
  18. package/build/shim.js +101 -128
  19. package/build/test-framework/errorHandler.d.ts +2 -0
  20. package/build/test-framework/errorHandler.d.ts.map +1 -0
  21. package/build/test-framework/errorHandler.js +19 -29
  22. package/build/test-framework/index.d.ts +4 -0
  23. package/build/test-framework/index.d.ts.map +1 -0
  24. package/build/test-framework/index.js +6 -20
  25. package/build/test-framework/testFnWrapper.d.ts +4 -0
  26. package/build/test-framework/testFnWrapper.d.ts.map +1 -0
  27. package/build/test-framework/testFnWrapper.js +43 -81
  28. package/build/test-framework/testInterfaceWrapper.d.ts +7 -0
  29. package/build/test-framework/testInterfaceWrapper.d.ts.map +1 -0
  30. package/build/test-framework/testInterfaceWrapper.js +53 -71
  31. package/build/test-framework/types.d.ts +36 -0
  32. package/build/test-framework/types.d.ts.map +1 -0
  33. package/build/test-framework/types.js +2 -0
  34. package/build/utils.d.ts +22 -0
  35. package/build/utils.d.ts.map +1 -0
  36. package/build/utils.js +144 -170
  37. package/package.json +4 -12
  38. package/tsconfig.json +0 -11
@@ -0,0 +1,39 @@
1
+ /// <reference types="webdriver" />
2
+ export declare function isW3C(capabilities?: WebDriver.DesiredCapabilities): boolean;
3
+ export declare function capabilitiesEnvironmentDetector(capabilities: WebDriver.Capabilities, automationProtocol: string): {
4
+ isChrome: boolean;
5
+ isMobile: boolean;
6
+ isIOS: boolean;
7
+ isAndroid: boolean;
8
+ isSauce: boolean;
9
+ };
10
+ export declare function sessionEnvironmentDetector({ capabilities, requestedCapabilities }: {
11
+ capabilities?: WebDriver.DesiredCapabilities;
12
+ requestedCapabilities?: WebDriver.DesiredCapabilities | WebDriver.W3CCapabilities;
13
+ }): {
14
+ isW3C: boolean;
15
+ isChrome: boolean;
16
+ isMobile: boolean;
17
+ isIOS: boolean;
18
+ isAndroid: boolean;
19
+ isSauce: boolean;
20
+ isSeleniumStandalone: boolean;
21
+ };
22
+ export declare function devtoolsEnvironmentDetector({ browserName }: WebDriver.Capabilities): {
23
+ isDevTools: boolean;
24
+ isW3C: boolean;
25
+ isMobile: boolean;
26
+ isIOS: boolean;
27
+ isAndroid: boolean;
28
+ isChrome: boolean;
29
+ isSauce: boolean;
30
+ isSeleniumStandalone: boolean;
31
+ };
32
+ export declare function webdriverEnvironmentDetector(capabilities: WebDriver.Capabilities): {
33
+ isChrome: boolean;
34
+ isMobile: boolean;
35
+ isIOS: boolean;
36
+ isAndroid: boolean;
37
+ isSauce: boolean;
38
+ };
39
+ //# sourceMappingURL=envDetector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envDetector.d.ts","sourceRoot":"","sources":["../src/envDetector.ts"],"names":[],"mappings":";AAWA,wBAAgB,KAAK,CAAE,YAAY,CAAC,EAAE,SAAS,CAAC,mBAAmB,WA8BlE;AAuHD,wBAAgB,+BAA+B,CAAE,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,kBAAkB,EAAE,MAAM;;;;;;EAIhH;AAQD,wBAAgB,0BAA0B,CAAE,EAAE,YAAY,EAAE,qBAAqB,EAAE,EAAE;IAAE,YAAY,CAAC,EAAE,SAAS,CAAC,mBAAmB,CAAC;IAAC,qBAAqB,CAAC,EAAE,SAAS,CAAC,mBAAmB,GAAG,SAAS,CAAC,eAAe,CAAA;CAAE;;;;;;;;EAUvN;AAOD,wBAAgB,2BAA2B,CAAE,EAAE,WAAW,EAAE,EAAE,SAAS,CAAC,YAAY;;;;;;;;;EAWnF;AAQD,wBAAgB,4BAA4B,CAAE,YAAY,EAAE,SAAS,CAAC,YAAY;;;;;;EAQjF"}
@@ -1,111 +1,108 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isW3C = isW3C;
7
- exports.capabilitiesEnvironmentDetector = capabilitiesEnvironmentDetector;
8
- exports.sessionEnvironmentDetector = sessionEnvironmentDetector;
9
- exports.devtoolsEnvironmentDetector = devtoolsEnvironmentDetector;
10
- exports.webdriverEnvironmentDetector = webdriverEnvironmentDetector;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.webdriverEnvironmentDetector = exports.devtoolsEnvironmentDetector = exports.sessionEnvironmentDetector = exports.capabilitiesEnvironmentDetector = exports.isW3C = void 0;
11
4
  const MOBILE_BROWSER_NAMES = ['ipad', 'iphone', 'android'];
12
- const MOBILE_CAPABILITIES = ['appium-version', 'appiumVersion', 'device-type', 'deviceType', 'device-orientation', 'deviceOrientation', 'deviceName'];
13
-
5
+ const MOBILE_CAPABILITIES = [
6
+ 'appium-version', 'appiumVersion', 'device-type', 'deviceType',
7
+ 'device-orientation', 'deviceOrientation', 'deviceName'
8
+ ];
14
9
  function isW3C(capabilities) {
15
- if (!capabilities) {
16
- return false;
17
- }
18
-
19
- const isAppium = capabilities.automationName || capabilities.deviceName || capabilities.appiumVersion;
20
- const hasW3CCaps = capabilities.platformName && capabilities.browserVersion && (capabilities.platformVersion || Object.prototype.hasOwnProperty.call(capabilities, 'setWindowRect'));
21
- return Boolean(hasW3CCaps || isAppium);
10
+ if (!capabilities) {
11
+ return false;
12
+ }
13
+ const isAppium = Boolean(capabilities.automationName ||
14
+ capabilities.deviceName ||
15
+ capabilities.appiumVersion);
16
+ const hasW3CCaps = Boolean(capabilities.platformName &&
17
+ capabilities.browserVersion &&
18
+ (capabilities.platformVersion || Object.prototype.hasOwnProperty.call(capabilities, 'setWindowRect')));
19
+ return Boolean(hasW3CCaps || isAppium);
22
20
  }
23
-
24
- function isChrome(caps) {
25
- if (!caps) {
26
- return false;
27
- }
28
-
29
- return Boolean(caps.chrome) || Boolean(caps['goog:chromeOptions']);
21
+ exports.isW3C = isW3C;
22
+ function isChrome(capabilities) {
23
+ if (!capabilities) {
24
+ return false;
25
+ }
26
+ return Boolean(capabilities.chrome || capabilities['goog:chromeOptions']);
30
27
  }
31
-
32
- function isMobile(caps) {
33
- if (!caps) {
34
- return false;
35
- }
36
-
37
- const browserName = (caps.browserName || '').toLowerCase();
38
- return Boolean(Object.keys(caps).find(cap => MOBILE_CAPABILITIES.includes(cap)) || caps.browserName === '' || MOBILE_BROWSER_NAMES.includes(browserName));
28
+ function isMobile(capabilities) {
29
+ if (!capabilities) {
30
+ return false;
31
+ }
32
+ const browserName = (capabilities.browserName || '').toLowerCase();
33
+ return Boolean(Object.keys(capabilities).find((cap) => MOBILE_CAPABILITIES.includes(cap)) ||
34
+ capabilities.browserName === '' ||
35
+ MOBILE_BROWSER_NAMES.includes(browserName));
39
36
  }
40
-
41
- function isIOS(caps) {
42
- if (!caps) {
43
- return false;
44
- }
45
-
46
- return Boolean(caps.platformName && caps.platformName.match(/iOS/i) || caps.deviceName && caps.deviceName.match(/(iPad|iPhone)/i));
37
+ function isIOS(capabilities) {
38
+ if (!capabilities) {
39
+ return false;
40
+ }
41
+ return Boolean((capabilities.platformName && capabilities.platformName.match(/iOS/i)) ||
42
+ (capabilities.deviceName && capabilities.deviceName.match(/(iPad|iPhone)/i)));
47
43
  }
48
-
49
- function isAndroid(caps) {
50
- if (!caps) {
51
- return false;
52
- }
53
-
54
- return Boolean(caps.platformName && caps.platformName.match(/Android/i) || caps.browserName && caps.browserName.match(/Android/i));
44
+ function isAndroid(capabilities) {
45
+ if (!capabilities) {
46
+ return false;
47
+ }
48
+ return Boolean((capabilities.platformName && capabilities.platformName.match(/Android/i)) ||
49
+ (capabilities.browserName && capabilities.browserName.match(/Android/i)));
55
50
  }
56
-
57
- function isSauce(caps) {
58
- return Boolean(caps.extendedDebugging || caps['sauce:options'] && caps['sauce:options'].extendedDebugging);
51
+ function isSauce(capabilities) {
52
+ if (!capabilities) {
53
+ return false;
54
+ }
55
+ const caps = capabilities.alwaysMatch
56
+ ? capabilities.alwaysMatch
57
+ : capabilities;
58
+ return Boolean(caps.extendedDebugging ||
59
+ (caps['sauce:options'] &&
60
+ caps['sauce:options'].extendedDebugging));
59
61
  }
60
-
61
- function isSeleniumStandalone(caps) {
62
- if (!caps) {
63
- return false;
64
- }
65
-
66
- return Boolean(caps['webdriver.remote.sessionid']);
62
+ function isSeleniumStandalone(capabilities) {
63
+ if (!capabilities) {
64
+ return false;
65
+ }
66
+ return Boolean(capabilities['webdriver.remote.sessionid']);
67
67
  }
68
-
69
68
  function capabilitiesEnvironmentDetector(capabilities, automationProtocol) {
70
- return automationProtocol === 'devtools' ? devtoolsEnvironmentDetector(capabilities) : webdriverEnvironmentDetector(capabilities);
69
+ return automationProtocol === 'devtools'
70
+ ? devtoolsEnvironmentDetector(capabilities)
71
+ : webdriverEnvironmentDetector(capabilities);
71
72
  }
72
-
73
- function sessionEnvironmentDetector({
74
- capabilities,
75
- requestedCapabilities
76
- }) {
77
- return {
78
- isW3C: isW3C(capabilities),
79
- isChrome: isChrome(capabilities),
80
- isMobile: isMobile(capabilities),
81
- isIOS: isIOS(capabilities),
82
- isAndroid: isAndroid(capabilities),
83
- isSauce: isSauce(requestedCapabilities),
84
- isSeleniumStandalone: isSeleniumStandalone(capabilities)
85
- };
73
+ exports.capabilitiesEnvironmentDetector = capabilitiesEnvironmentDetector;
74
+ function sessionEnvironmentDetector({ capabilities, requestedCapabilities }) {
75
+ return {
76
+ isW3C: isW3C(capabilities),
77
+ isChrome: isChrome(capabilities),
78
+ isMobile: isMobile(capabilities),
79
+ isIOS: isIOS(capabilities),
80
+ isAndroid: isAndroid(capabilities),
81
+ isSauce: isSauce(requestedCapabilities),
82
+ isSeleniumStandalone: isSeleniumStandalone(capabilities)
83
+ };
86
84
  }
87
-
88
- function devtoolsEnvironmentDetector({
89
- browserName
90
- }) {
91
- return {
92
- isDevTools: true,
93
- isW3C: true,
94
- isMobile: false,
95
- isIOS: false,
96
- isAndroid: false,
97
- isChrome: browserName === 'chrome',
98
- isSauce: false,
99
- isSeleniumStandalone: false
100
- };
85
+ exports.sessionEnvironmentDetector = sessionEnvironmentDetector;
86
+ function devtoolsEnvironmentDetector({ browserName }) {
87
+ return {
88
+ isDevTools: true,
89
+ isW3C: true,
90
+ isMobile: false,
91
+ isIOS: false,
92
+ isAndroid: false,
93
+ isChrome: browserName === 'chrome',
94
+ isSauce: false,
95
+ isSeleniumStandalone: false,
96
+ };
101
97
  }
102
-
98
+ exports.devtoolsEnvironmentDetector = devtoolsEnvironmentDetector;
103
99
  function webdriverEnvironmentDetector(capabilities) {
104
- return {
105
- isChrome: isChrome(capabilities),
106
- isMobile: isMobile(capabilities),
107
- isIOS: isIOS(capabilities),
108
- isAndroid: isAndroid(capabilities),
109
- isSauce: isSauce(capabilities)
110
- };
111
- }
100
+ return {
101
+ isChrome: isChrome(capabilities),
102
+ isMobile: isMobile(capabilities),
103
+ isIOS: isIOS(capabilities),
104
+ isAndroid: isAndroid(capabilities),
105
+ isSauce: isSauce(capabilities)
106
+ };
107
+ }
108
+ exports.webdriverEnvironmentDetector = webdriverEnvironmentDetector;
@@ -0,0 +1,9 @@
1
+ import initialisePlugin from './initialisePlugin';
2
+ import { initialiseWorkerService, initialiseLauncherService } from './initialiseServices';
3
+ import webdriverMonad from './monad';
4
+ import { commandCallStructure, isValidParameter, getArgumentType, safeRequire, isFunctionAsync, transformCommandLogResult, canAccess, sleep } from './utils';
5
+ import { wrapCommand, runFnInFiberContext, executeHooksWithArgs, hasWdioSyncSupport, executeSync, executeAsync } from './shim';
6
+ import { testFnWrapper, runTestInFiberContext } from './test-framework';
7
+ import { isW3C, capabilitiesEnvironmentDetector, sessionEnvironmentDetector, devtoolsEnvironmentDetector } from './envDetector';
8
+ export { initialisePlugin, initialiseLauncherService, initialiseWorkerService, isFunctionAsync, transformCommandLogResult, webdriverMonad, commandCallStructure, isValidParameter, getArgumentType, safeRequire, canAccess, sleep, wrapCommand, executeSync, executeAsync, runFnInFiberContext, runTestInFiberContext, testFnWrapper, executeHooksWithArgs, hasWdioSyncSupport, isW3C, sessionEnvironmentDetector, capabilitiesEnvironmentDetector, devtoolsEnvironmentDetector };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACzF,OAAO,cAAc,MAAM,SAAS,CAAA;AACpC,OAAO,EACH,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EACpE,eAAe,EAAE,yBAAyB,EAAE,SAAS,EAAE,KAAK,EAC/D,MAAM,SAAS,CAAA;AAChB,OAAO,EACH,WAAW,EAAE,mBAAmB,EAAE,oBAAoB,EACtD,kBAAkB,EAAE,WAAW,EAAE,YAAY,EAChD,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EACH,KAAK,EAAE,+BAA+B,EACtC,0BAA0B,EAAE,2BAA2B,EAC1D,MAAM,eAAe,CAAA;AAEtB,OAAO,EACH,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,SAAS,EACT,KAAK,EAKL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAKlB,KAAK,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,2BAA2B,EAC9B,CAAA"}
package/build/index.js CHANGED
@@ -1,165 +1,37 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "initialisePlugin", {
7
- enumerable: true,
8
- get: function () {
9
- return _initialisePlugin.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "initialiseWorkerService", {
13
- enumerable: true,
14
- get: function () {
15
- return _initialiseServices.initialiseWorkerService;
16
- }
17
- });
18
- Object.defineProperty(exports, "initialiseLauncherService", {
19
- enumerable: true,
20
- get: function () {
21
- return _initialiseServices.initialiseLauncherService;
22
- }
23
- });
24
- Object.defineProperty(exports, "webdriverMonad", {
25
- enumerable: true,
26
- get: function () {
27
- return _monad.default;
28
- }
29
- });
30
- Object.defineProperty(exports, "commandCallStructure", {
31
- enumerable: true,
32
- get: function () {
33
- return _utils.commandCallStructure;
34
- }
35
- });
36
- Object.defineProperty(exports, "isValidParameter", {
37
- enumerable: true,
38
- get: function () {
39
- return _utils.isValidParameter;
40
- }
41
- });
42
- Object.defineProperty(exports, "getArgumentType", {
43
- enumerable: true,
44
- get: function () {
45
- return _utils.getArgumentType;
46
- }
47
- });
48
- Object.defineProperty(exports, "safeRequire", {
49
- enumerable: true,
50
- get: function () {
51
- return _utils.safeRequire;
52
- }
53
- });
54
- Object.defineProperty(exports, "isFunctionAsync", {
55
- enumerable: true,
56
- get: function () {
57
- return _utils.isFunctionAsync;
58
- }
59
- });
60
- Object.defineProperty(exports, "transformCommandLogResult", {
61
- enumerable: true,
62
- get: function () {
63
- return _utils.transformCommandLogResult;
64
- }
65
- });
66
- Object.defineProperty(exports, "canAccess", {
67
- enumerable: true,
68
- get: function () {
69
- return _utils.canAccess;
70
- }
71
- });
72
- Object.defineProperty(exports, "sleep", {
73
- enumerable: true,
74
- get: function () {
75
- return _utils.sleep;
76
- }
77
- });
78
- Object.defineProperty(exports, "wrapCommand", {
79
- enumerable: true,
80
- get: function () {
81
- return _shim.wrapCommand;
82
- }
83
- });
84
- Object.defineProperty(exports, "runFnInFiberContext", {
85
- enumerable: true,
86
- get: function () {
87
- return _shim.runFnInFiberContext;
88
- }
89
- });
90
- Object.defineProperty(exports, "executeHooksWithArgs", {
91
- enumerable: true,
92
- get: function () {
93
- return _shim.executeHooksWithArgs;
94
- }
95
- });
96
- Object.defineProperty(exports, "hasWdioSyncSupport", {
97
- enumerable: true,
98
- get: function () {
99
- return _shim.hasWdioSyncSupport;
100
- }
101
- });
102
- Object.defineProperty(exports, "executeSync", {
103
- enumerable: true,
104
- get: function () {
105
- return _shim.executeSync;
106
- }
107
- });
108
- Object.defineProperty(exports, "executeAsync", {
109
- enumerable: true,
110
- get: function () {
111
- return _shim.executeAsync;
112
- }
113
- });
114
- Object.defineProperty(exports, "testFnWrapper", {
115
- enumerable: true,
116
- get: function () {
117
- return _testFramework.testFnWrapper;
118
- }
119
- });
120
- Object.defineProperty(exports, "runTestInFiberContext", {
121
- enumerable: true,
122
- get: function () {
123
- return _testFramework.runTestInFiberContext;
124
- }
125
- });
126
- Object.defineProperty(exports, "isW3C", {
127
- enumerable: true,
128
- get: function () {
129
- return _envDetector.isW3C;
130
- }
131
- });
132
- Object.defineProperty(exports, "capabilitiesEnvironmentDetector", {
133
- enumerable: true,
134
- get: function () {
135
- return _envDetector.capabilitiesEnvironmentDetector;
136
- }
137
- });
138
- Object.defineProperty(exports, "sessionEnvironmentDetector", {
139
- enumerable: true,
140
- get: function () {
141
- return _envDetector.sessionEnvironmentDetector;
142
- }
143
- });
144
- Object.defineProperty(exports, "devtoolsEnvironmentDetector", {
145
- enumerable: true,
146
- get: function () {
147
- return _envDetector.devtoolsEnvironmentDetector;
148
- }
149
- });
150
-
151
- var _initialisePlugin = _interopRequireDefault(require("./initialisePlugin"));
152
-
153
- var _initialiseServices = require("./initialiseServices");
154
-
155
- var _monad = _interopRequireDefault(require("./monad"));
156
-
157
- var _utils = require("./utils");
158
-
159
- var _shim = require("./shim");
160
-
161
- var _testFramework = require("./test-framework");
162
-
163
- var _envDetector = require("./envDetector");
164
-
165
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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.devtoolsEnvironmentDetector = exports.capabilitiesEnvironmentDetector = exports.sessionEnvironmentDetector = exports.isW3C = exports.hasWdioSyncSupport = exports.executeHooksWithArgs = exports.testFnWrapper = exports.runTestInFiberContext = exports.runFnInFiberContext = exports.executeAsync = exports.executeSync = exports.wrapCommand = exports.sleep = exports.canAccess = exports.safeRequire = exports.getArgumentType = exports.isValidParameter = exports.commandCallStructure = exports.webdriverMonad = exports.transformCommandLogResult = exports.isFunctionAsync = exports.initialiseWorkerService = exports.initialiseLauncherService = exports.initialisePlugin = void 0;
7
+ const initialisePlugin_1 = __importDefault(require("./initialisePlugin"));
8
+ exports.initialisePlugin = initialisePlugin_1.default;
9
+ const initialiseServices_1 = require("./initialiseServices");
10
+ Object.defineProperty(exports, "initialiseWorkerService", { enumerable: true, get: function () { return initialiseServices_1.initialiseWorkerService; } });
11
+ Object.defineProperty(exports, "initialiseLauncherService", { enumerable: true, get: function () { return initialiseServices_1.initialiseLauncherService; } });
12
+ const monad_1 = __importDefault(require("./monad"));
13
+ exports.webdriverMonad = monad_1.default;
14
+ const utils_1 = require("./utils");
15
+ Object.defineProperty(exports, "commandCallStructure", { enumerable: true, get: function () { return utils_1.commandCallStructure; } });
16
+ Object.defineProperty(exports, "isValidParameter", { enumerable: true, get: function () { return utils_1.isValidParameter; } });
17
+ Object.defineProperty(exports, "getArgumentType", { enumerable: true, get: function () { return utils_1.getArgumentType; } });
18
+ Object.defineProperty(exports, "safeRequire", { enumerable: true, get: function () { return utils_1.safeRequire; } });
19
+ Object.defineProperty(exports, "isFunctionAsync", { enumerable: true, get: function () { return utils_1.isFunctionAsync; } });
20
+ Object.defineProperty(exports, "transformCommandLogResult", { enumerable: true, get: function () { return utils_1.transformCommandLogResult; } });
21
+ Object.defineProperty(exports, "canAccess", { enumerable: true, get: function () { return utils_1.canAccess; } });
22
+ Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return utils_1.sleep; } });
23
+ const shim_1 = require("./shim");
24
+ Object.defineProperty(exports, "wrapCommand", { enumerable: true, get: function () { return shim_1.wrapCommand; } });
25
+ Object.defineProperty(exports, "runFnInFiberContext", { enumerable: true, get: function () { return shim_1.runFnInFiberContext; } });
26
+ Object.defineProperty(exports, "executeHooksWithArgs", { enumerable: true, get: function () { return shim_1.executeHooksWithArgs; } });
27
+ Object.defineProperty(exports, "hasWdioSyncSupport", { enumerable: true, get: function () { return shim_1.hasWdioSyncSupport; } });
28
+ Object.defineProperty(exports, "executeSync", { enumerable: true, get: function () { return shim_1.executeSync; } });
29
+ Object.defineProperty(exports, "executeAsync", { enumerable: true, get: function () { return shim_1.executeAsync; } });
30
+ const test_framework_1 = require("./test-framework");
31
+ Object.defineProperty(exports, "testFnWrapper", { enumerable: true, get: function () { return test_framework_1.testFnWrapper; } });
32
+ Object.defineProperty(exports, "runTestInFiberContext", { enumerable: true, get: function () { return test_framework_1.runTestInFiberContext; } });
33
+ const envDetector_1 = require("./envDetector");
34
+ Object.defineProperty(exports, "isW3C", { enumerable: true, get: function () { return envDetector_1.isW3C; } });
35
+ Object.defineProperty(exports, "capabilitiesEnvironmentDetector", { enumerable: true, get: function () { return envDetector_1.capabilitiesEnvironmentDetector; } });
36
+ Object.defineProperty(exports, "sessionEnvironmentDetector", { enumerable: true, get: function () { return envDetector_1.sessionEnvironmentDetector; } });
37
+ Object.defineProperty(exports, "devtoolsEnvironmentDetector", { enumerable: true, get: function () { return envDetector_1.devtoolsEnvironmentDetector; } });
@@ -0,0 +1,3 @@
1
+ /// <reference types="webdriverio/webdriverio-core" />
2
+ export default function initialisePlugin(name: string, type?: string): WebdriverIO.ServiceClass;
3
+ //# sourceMappingURL=initialisePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initialisePlugin.d.ts","sourceRoot":"","sources":["../src/initialisePlugin.ts"],"names":[],"mappings":";AASA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,YAAY,CAqC/F"}
@@ -1,33 +1,30 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = initialisePlugin;
7
-
8
- var _path = _interopRequireDefault(require("path"));
9
-
10
- var _utils = require("./utils");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const utils_1 = require("./utils");
14
8
  function initialisePlugin(name, type) {
15
- if (name[0] === '@' || _path.default.isAbsolute(name)) {
16
- const service = (0, _utils.safeRequire)(name);
17
- return service;
18
- }
19
-
20
- const scopedPlugin = (0, _utils.safeRequire)(`@wdio/${name.toLowerCase()}-${type}`);
21
-
22
- if (scopedPlugin) {
23
- return scopedPlugin;
24
- }
25
-
26
- const plugin = (0, _utils.safeRequire)(`wdio-${name.toLowerCase()}-${type}`);
27
-
28
- if (plugin) {
29
- return plugin;
30
- }
31
-
32
- throw new Error(`Couldn't find plugin "${name}" ${type}, neither as wdio scoped package ` + `"@wdio/${name.toLowerCase()}-${type}" nor as community package ` + `"wdio-${name.toLowerCase()}-${type}". Please make sure you have it installed!`);
33
- }
9
+ if (name[0] === '@' || path_1.default.isAbsolute(name)) {
10
+ const service = utils_1.safeRequire(name);
11
+ if (service) {
12
+ return service;
13
+ }
14
+ }
15
+ if (typeof type !== 'string') {
16
+ throw new Error('No plugin type provided');
17
+ }
18
+ const scopedPlugin = utils_1.safeRequire(`@wdio/${name.toLowerCase()}-${type}`);
19
+ if (scopedPlugin) {
20
+ return scopedPlugin;
21
+ }
22
+ const plugin = utils_1.safeRequire(`wdio-${name.toLowerCase()}-${type}`);
23
+ if (plugin) {
24
+ return plugin;
25
+ }
26
+ throw new Error(`Couldn't find plugin "${name}" ${type}, neither as wdio scoped package ` +
27
+ `"@wdio/${name.toLowerCase()}-${type}" nor as community package ` +
28
+ `"wdio-${name.toLowerCase()}-${type}". Please make sure you have it installed!`);
29
+ }
30
+ exports.default = initialisePlugin;
@@ -0,0 +1,8 @@
1
+ /// <reference types="webdriverio/webdriverio-core" />
2
+ /// <reference types="webdriver" />
3
+ export declare function initialiseLauncherService(config: WebdriverIO.Config, caps: WebDriver.DesiredCapabilities): {
4
+ ignoredWorkerServices: string[];
5
+ launcherServices: WebdriverIO.ServiceInstance[];
6
+ };
7
+ export declare function initialiseWorkerService(config: WebdriverIO.Config, caps: WebDriver.DesiredCapabilities, ignoredWorkerServices?: string[]): WebdriverIO.ServiceInstance[];
8
+ //# sourceMappingURL=initialiseServices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initialiseServices.d.ts","sourceRoot":"","sources":["../src/initialiseServices.ts"],"names":[],"mappings":";;AA4FA,wBAAgB,yBAAyB,CAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,mBAAmB;;;EAiDzG;AAUD,wBAAgB,uBAAuB,CAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,mBAAmB,EAAE,qBAAqB,GAAE,MAAM,EAAO,GAAG,WAAW,CAAC,eAAe,EAAE,CA6B7K"}