test(appium): e2e helpers now log executed child process commands
MODIFY
package.json
package.json
"serve-static": "1.15.0",
"sinon": "13.0.2",
"sinon-chai": "3.7.0",
+ "strip-ansi": "6.0.1",
"sync-monorepo-packages": "0.3.5",
"through2": "4.0.2",
"type-fest": "2.12.2",

MODIFY
packages/appium/test/e2e/e2e-helpers.js
packages/appium/test/e2e/e2e-helpers.js
@@ -8,7 +8,8 @@ import _ from 'lodash';
import path from 'path';
import {exec} from 'teen_process';
import {PACKAGE_ROOT, resolveFixture} from '../helpers';
-import { fs } from '@appium/support';
+import {fs, logger} from '@appium/support';
+import stripAnsi from 'strip-ansi';
/**
* Path to the (compiled) main script of the `appium` executable.
@@ -17,6 +18,8 @@ import { fs } from '@appium/support';
*/
export const EXECUTABLE = path.join(PACKAGE_ROOT, 'build', 'lib', 'main.js');
+const log = logger.getLogger('appium-e2e-helpers');
+
/**
* Runs the `appium` executable with the given args.
*
@@ -35,10 +38,11 @@ async function run (appiumHome, args, opts = {}) {
};
try {
args = [...process.execArgv, '--', EXECUTABLE, ...args];
+ log.debug(stripAnsi(`Running: ${process.execPath} ${args.join(' ')}`));
return await exec(process.execPath, args, {
cwd,
env,
- ...opts
+ ...opts,
});
} catch (err) {
const {stdout, stderr} = /** @type {TeenProcessExecError} */ (err);
@@ -215,7 +219,6 @@ export function formatAppiumArgErrorOutput (stderr) {
* @returns {Promise<Result>}
*/
-
/**
* @template [Result=unknown]
* @template {import('../../types/cli').CliExtensionSubcommand} [ExtSubcommand=never]

test(appium): e2e helpers now log executed child process commands