wdio-lambdatest-service-sdk 5.1.5 → 5.1.6
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/index.js +7 -7
- package/lib/cli/generate.js +8 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WDIO LambdaTest service entry point.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Export shape: object with default (worker service) and launcher (main process)
|
|
4
|
+
* so @wdio/utils initialisePlugin never sees null when reading .launcher or .default.
|
|
5
5
|
*/
|
|
6
6
|
const LambdaTestService = require('./src/service');
|
|
7
7
|
const LambdaTestLauncher = require('./src/launcher');
|
|
8
8
|
|
|
9
|
-
// Primary export: the worker service class (used by WDIO in worker process)
|
|
10
9
|
const Service = LambdaTestService;
|
|
11
|
-
|
|
12
|
-
// Attach launcher so WDIO can read plugin.launcher (main process)
|
|
13
10
|
Service.launcher = LambdaTestLauncher;
|
|
14
|
-
// ESM interop: some loaders expect plugin.default
|
|
15
11
|
Service.default = Service;
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
// Export object so require() never returns null and plugin.launcher / plugin.default always exist
|
|
14
|
+
module.exports = {
|
|
15
|
+
default: Service,
|
|
16
|
+
launcher: LambdaTestLauncher
|
|
17
|
+
};
|
package/lib/cli/generate.js
CHANGED
|
@@ -164,11 +164,12 @@ function buildCapabilitiesMulti(config) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
* Resolve LambdaTest service
|
|
168
|
-
*
|
|
167
|
+
* Resolve LambdaTest service: try wdio-lambdatest-service-sdk then wdio-lambdatest-service (npm), then sibling path.
|
|
168
|
+
* Package can be installed as wdio-lambdatest-service-sdk or wdio-lambdatest-service.
|
|
169
169
|
*/
|
|
170
170
|
function getServicePathSnippet() {
|
|
171
171
|
return `(function () {
|
|
172
|
+
try { return require.resolve('wdio-lambdatest-service-sdk'); } catch (e) {}
|
|
172
173
|
try { return require.resolve('wdio-lambdatest-service'); } catch (e) {}
|
|
173
174
|
return path.join(__dirname, '../wdio-lambdatest-service');
|
|
174
175
|
})()`;
|
|
@@ -180,7 +181,11 @@ function getServicePathSnippet() {
|
|
|
180
181
|
*/
|
|
181
182
|
function buildConfigTemplate(config, commonCaps, capabilities) {
|
|
182
183
|
const servicePathExpr = getServicePathSnippet();
|
|
183
|
-
|
|
184
|
+
// Normalize: relative path only; no absolute paths or quotes (WDIO resolves from config dir)
|
|
185
|
+
let safeSpecPath = (config.specPath || '../specs/android-test.js').replace(/\\/g, '/').trim();
|
|
186
|
+
if (path.isAbsolute(safeSpecPath) || !safeSpecPath || /['"]/.test(safeSpecPath)) {
|
|
187
|
+
safeSpecPath = '../specs/android-test.js';
|
|
188
|
+
}
|
|
184
189
|
const mergeSnippet = capabilities.length > 0
|
|
185
190
|
? `
|
|
186
191
|
// Merge commonCapabilities into each capability
|