@wdio/appium-service 8.0.0-alpha.563 → 8.0.0-alpha.577

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.
@@ -7,7 +7,7 @@ export default class AppiumLauncher implements Services.ServiceInstance {
7
7
  private readonly _logPath?;
8
8
  private readonly _appiumCliArgs;
9
9
  private readonly _args;
10
- private _command;
10
+ private _command?;
11
11
  private _process?;
12
12
  constructor(_options: AppiumServiceConfig, _capabilities: Capabilities.RemoteCapabilities, _config?: Options.Testrunner | undefined);
13
13
  private _getCommand;
@@ -1 +1 @@
1
- {"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAyB,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAYzE,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,QAAQ,CAAC,eAAe;IAQ/D,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,OAAO,CAAC;IATpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,QAAQ,CAAC,CAA+C;gBAGpD,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,YAAY,CAAC,kBAAkB,EAC9C,OAAO,CAAC,gCAAoB;IAUxC,OAAO,CAAC,WAAW;IAqBnB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA6BlB,SAAS;IAkBf,UAAU;IAOV,OAAO,CAAC,YAAY;YA2BN,kBAAkB;IAehC,OAAO,CAAC,MAAM,CAAC,iBAAiB;CAcnC"}
1
+ {"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGlE,OAAO,KAAK,EAAyB,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAYzE,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,QAAQ,CAAC,eAAe;IAQ/D,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,OAAO,CAAC;IATpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IAC7C,OAAO,CAAC,QAAQ,CAAC,CAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,CAA+C;gBAGpD,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,YAAY,CAAC,kBAAkB,EAC9C,OAAO,CAAC,gCAAoB;YAS1B,WAAW;IAqBzB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA6BlB,SAAS;IAkBf,UAAU;IAOV,OAAO,CAAC,YAAY;YA2BN,kBAAkB;mBAeX,iBAAiB;CAazC"}
package/build/launcher.js CHANGED
@@ -3,8 +3,8 @@ import fsp from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { spawn } from 'node:child_process';
5
5
  import { promisify } from 'node:util';
6
- import { createRequire } from 'node:module';
7
6
  import logger from '@wdio/logger';
7
+ import { resolve } from 'import-meta-resolve';
8
8
  import { isCloudCapability } from '@wdio/config';
9
9
  import { getFilePath, formatCliArgs } from './utils.js';
10
10
  const log = logger('@wdio/appium-service');
@@ -33,16 +33,15 @@ export default class AppiumLauncher {
33
33
  ...(this._options.args || {})
34
34
  };
35
35
  this._logPath = _options.logPath || this._config?.outputDir;
36
- this._command = this._getCommand(_options.command);
37
36
  }
38
- _getCommand(command) {
37
+ async _getCommand(command) {
39
38
  /**
40
39
  * Explicitly set node as command and appium
41
40
  * module path as it's first argument if it's not defined
42
41
  */
43
42
  if (!command) {
44
43
  command = 'node';
45
- this._appiumCliArgs.push(AppiumLauncher._getAppiumCommand());
44
+ this._appiumCliArgs.push(await AppiumLauncher._getAppiumCommand());
46
45
  }
47
46
  /**
48
47
  * Windows needs to be started through `cmd` and the command needs to be an arg
@@ -80,7 +79,8 @@ export default class AppiumLauncher {
80
79
  /**
81
80
  * start Appium
82
81
  */
83
- this._process = await promisify(this._startAppium)(this._command, this._appiumCliArgs);
82
+ const command = await this._getCommand(this._options.command);
83
+ this._process = await promisify(this._startAppium)(command, this._appiumCliArgs);
84
84
  if (this._logPath) {
85
85
  this._redirectLogStream(this._logPath);
86
86
  }
@@ -126,10 +126,9 @@ export default class AppiumLauncher {
126
126
  this._process.stdout.pipe(logStream);
127
127
  this._process.stderr.pipe(logStream);
128
128
  }
129
- static _getAppiumCommand(moduleName = 'appium') {
129
+ static async _getAppiumCommand(command = 'appium') {
130
130
  try {
131
- const require = createRequire(import.meta.url);
132
- return require.resolve(moduleName);
131
+ return await resolve(command, import.meta.url);
133
132
  }
134
133
  catch (err) {
135
134
  log.error('Appium is not installed locally.\n' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/appium-service",
3
- "version": "8.0.0-alpha.563+01b1cdcb3",
3
+ "version": "8.0.0-alpha.577+73cd77ef7",
4
4
  "description": "A WebdriverIO service to start & stop Appium Server",
5
5
  "author": "Morten Bjerg Gregersen <morten@mogee.dk>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-appium-service",
@@ -30,13 +30,14 @@
30
30
  "types": "./build/index.d.ts",
31
31
  "typeScriptVersion": "3.8.3",
32
32
  "dependencies": {
33
- "@wdio/config": "8.0.0-alpha.563+01b1cdcb3",
34
- "@wdio/logger": "8.0.0-alpha.563+01b1cdcb3",
35
- "@wdio/types": "8.0.0-alpha.563+01b1cdcb3",
33
+ "@wdio/config": "8.0.0-alpha.577+73cd77ef7",
34
+ "@wdio/logger": "8.0.0-alpha.577+73cd77ef7",
35
+ "@wdio/types": "8.0.0-alpha.577+73cd77ef7",
36
+ "import-meta-resolve": "^2.1.0",
36
37
  "param-case": "^3.0.4"
37
38
  },
38
39
  "publishConfig": {
39
40
  "access": "public"
40
41
  },
41
- "gitHead": "01b1cdcb32747d629c56fa2e7bb8b507f1ab16ec"
42
+ "gitHead": "73cd77ef7887819c56dc98932a0c34e8af10b64a"
42
43
  }