Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add 'path' argument to app management methods #272

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;