From bece139378448d9a438b54e91f5a73045484625a Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Mon, 15 Jan 2024 23:14:52 +0100 Subject: [PATCH] fix: Add 'path' argument to app management methods (#272) --- lib/commands/app-management.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/commands/app-management.js b/lib/commands/app-management.js index 4d32a7b..6b3458a 100644 --- a/lib/commands/app-management.js +++ b/lib/commands/app-management.js @@ -21,11 +21,12 @@ const commands = {}; * @param {LaunchAppOptions} opts */ commands.macosLaunchApp = async function macosLaunchApp (opts) { - const { bundleId, environment } = opts ?? {}; + const { bundleId, environment, path } = opts ?? {}; return await this.wda.proxy.command('/wda/apps/launch', 'POST', { arguments: opts.arguments, environment, bundleId, + path, }); }; @@ -44,8 +45,8 @@ commands.macosLaunchApp = async function macosLaunchApp (opts) { * @param {ActivateAppOptions} opts */ commands.macosActivateApp = async function macosActivateApp (opts) { - const { bundleId } = opts ?? {}; - return await this.wda.proxy.command('/wda/apps/activate', 'POST', { bundleId }); + const { bundleId, path } = opts ?? {}; + return await this.wda.proxy.command('/wda/apps/activate', 'POST', { bundleId, path }); }; /** @@ -65,8 +66,8 @@ commands.macosActivateApp = async function macosActivateApp (opts) { * `false` if the app was not running before. */ commands.macosTerminateApp = async function macosTerminateApp (opts) { - const { bundleId } = opts ?? {}; - return await this.wda.proxy.command('/wda/apps/terminate', 'POST', { bundleId }); + const { bundleId, path } = opts ?? {}; + return await this.wda.proxy.command('/wda/apps/terminate', 'POST', { bundleId, path }); }; /** @@ -87,8 +88,8 @@ commands.macosTerminateApp = async function macosTerminateApp (opts) { * for more details */ commands.macosQueryAppState = async function macosQueryAppState (opts) { - const { bundleId } = opts ?? {}; - return await this.wda.proxy.command('/wda/apps/state', 'POST', { bundleId }); + const { bundleId, path } = opts ?? {}; + return await this.wda.proxy.command('/wda/apps/state', 'POST', { bundleId, path }); }; export default commands;