Skip to content

Commit

Permalink
fix: Add 'path' argument to app management methods (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jan 15, 2024
1 parent 857f20b commit bece139
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/commands/app-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
};

Expand All @@ -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 });
};

/**
Expand All @@ -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 });
};

/**
Expand All @@ -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;

0 comments on commit bece139

Please sign in to comment.