@wdio/appium-service 7.14.1 → 7.16.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/build/launcher.js CHANGED
@@ -9,7 +9,7 @@ const fs_extra_1 = require("fs-extra");
9
9
  const util_1 = require("util");
10
10
  const config_1 = require("@wdio/config");
11
11
  const utils_1 = require("./utils");
12
- const log = logger_1.default('@wdio/appium-service');
12
+ const log = (0, logger_1.default)('@wdio/appium-service');
13
13
  const DEFAULT_LOG_FILENAME = 'wdio-appium.log';
14
14
  const DEFAULT_CONNECTION = {
15
15
  protocol: 'http',
@@ -61,22 +61,22 @@ class AppiumLauncher {
61
61
  for (const [, capability] of Object.entries(this._capabilities)) {
62
62
  const cap = capability.capabilities || capability;
63
63
  const c = cap.alwaysMatch || cap;
64
- !config_1.isCloudCapability(c) && Object.assign(capability, DEFAULT_CONNECTION, 'port' in this._args ? { port: this._args.port } : {}, { path: this._args.basePath }, { ...capability });
64
+ !(0, config_1.isCloudCapability)(c) && Object.assign(capability, DEFAULT_CONNECTION, 'port' in this._args ? { port: this._args.port } : {}, { path: this._args.basePath }, { ...capability });
65
65
  }
66
66
  return;
67
67
  }
68
- this._capabilities.forEach((cap) => !config_1.isCloudCapability(cap.alwaysMatch || cap) && Object.assign(cap, DEFAULT_CONNECTION, 'port' in this._args ? { port: this._args.port } : {}, { path: this._args.basePath }, { ...cap }));
68
+ this._capabilities.forEach((cap) => !(0, config_1.isCloudCapability)(cap.alwaysMatch || cap) && Object.assign(cap, DEFAULT_CONNECTION, 'port' in this._args ? { port: this._args.port } : {}, { path: this._args.basePath }, { ...cap }));
69
69
  }
70
70
  async onPrepare() {
71
71
  /**
72
72
  * Append remaining arguments
73
73
  */
74
- this._appiumCliArgs.push(...utils_1.formatCliArgs(this._args));
74
+ this._appiumCliArgs.push(...(0, utils_1.formatCliArgs)(this._args));
75
75
  this._setCapabilities();
76
76
  /**
77
77
  * start Appium
78
78
  */
79
- this._process = await util_1.promisify(this._startAppium)(this._command, this._appiumCliArgs);
79
+ this._process = await (0, util_1.promisify)(this._startAppium)(this._command, this._appiumCliArgs);
80
80
  if (this._logPath) {
81
81
  this._redirectLogStream(this._logPath);
82
82
  }
@@ -89,7 +89,7 @@ class AppiumLauncher {
89
89
  }
90
90
  _startAppium(command, args, callback) {
91
91
  log.debug(`Will spawn Appium process: ${command} ${args.join(' ')}`);
92
- let process = child_process_1.spawn(command, args, { stdio: ['ignore', 'pipe', 'pipe'] });
92
+ let process = (0, child_process_1.spawn)(command, args, { stdio: ['ignore', 'pipe', 'pipe'] });
93
93
  let error;
94
94
  process.stdout.on('data', (data) => {
95
95
  if (data.includes('Appium REST http interface listener started')) {
@@ -114,11 +114,11 @@ class AppiumLauncher {
114
114
  if (!this._process) {
115
115
  throw Error('No Appium process to redirect log stream');
116
116
  }
117
- const logFile = utils_1.getFilePath(logPath, DEFAULT_LOG_FILENAME);
117
+ const logFile = (0, utils_1.getFilePath)(logPath, DEFAULT_LOG_FILENAME);
118
118
  // ensure file & directory exists
119
- fs_extra_1.ensureFileSync(logFile);
119
+ (0, fs_extra_1.ensureFileSync)(logFile);
120
120
  log.debug(`Appium logs written to: ${logFile}`);
121
- const logStream = fs_extra_1.createWriteStream(logFile, { flags: 'w' });
121
+ const logStream = (0, fs_extra_1.createWriteStream)(logFile, { flags: 'w' });
122
122
  this._process.stdout.pipe(logStream);
123
123
  this._process.stderr.pipe(logStream);
124
124
  }
package/build/utils.js CHANGED
@@ -11,11 +11,11 @@ const FILE_EXTENSION_REGEX = /\.[0-9a-z]+$/i;
11
11
  * @return {String} absolute file path
12
12
  */
13
13
  function getFilePath(filePath, defaultFilename) {
14
- let absolutePath = path_1.resolve(filePath);
14
+ let absolutePath = (0, path_1.resolve)(filePath);
15
15
  // test if we already have a file (e.g. selenium.txt, .log, log.txt, etc.)
16
16
  // NOTE: path.extname doesn't work to detect a file, cause dotfiles are reported by node to have no extension
17
- if (!FILE_EXTENSION_REGEX.test(path_1.basename(absolutePath))) {
18
- absolutePath = path_1.join(absolutePath, defaultFilename);
17
+ if (!FILE_EXTENSION_REGEX.test((0, path_1.basename)(absolutePath))) {
18
+ absolutePath = (0, path_1.join)(absolutePath, defaultFilename);
19
19
  }
20
20
  return absolutePath;
21
21
  }
@@ -31,7 +31,7 @@ function formatCliArgs(args) {
31
31
  if ((typeof value === 'boolean' && !value) || value === null) {
32
32
  continue;
33
33
  }
34
- cliArgs.push(`--${param_case_1.paramCase(key)}`);
34
+ cliArgs.push(`--${(0, param_case_1.paramCase)(key)}`);
35
35
  // Only non-boolean and non-null values are added as option values
36
36
  if (typeof value !== 'boolean') {
37
37
  cliArgs.push(sanitizeCliOptionValue(value));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/appium-service",
3
- "version": "7.14.1",
3
+ "version": "7.16.0",
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",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@types/fs-extra": "^9.0.4",
30
- "@wdio/config": "7.14.1",
31
- "@wdio/logger": "7.7.0",
32
- "@wdio/types": "7.14.1",
30
+ "@wdio/config": "7.16.0",
31
+ "@wdio/logger": "7.16.0",
32
+ "@wdio/types": "7.16.0",
33
33
  "fs-extra": "^10.0.0",
34
34
  "param-case": "^3.0.0"
35
35
  },
@@ -40,5 +40,5 @@
40
40
  "access": "public"
41
41
  },
42
42
  "types": "./build/index.d.ts",
43
- "gitHead": "0f6b6089f675b303741fcb3463779ca248058ae0"
43
+ "gitHead": "2b650b1def58bc7a6c22cb093548c19e63b75f80"
44
44
  }