Skip to content

Commit

Permalink
Add mobile: command for performing editor actions (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykola Mokhnach authored and dpgraham committed Sep 24, 2018
1 parent 803444d commit 6e37a9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/commands/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ extensions.execute = async function (script, args) {
extensions.executeMobile = async function (mobileCommand, opts = {}) {
const mobileCommandsMapping = {
shell: 'mobileShell',

startLogsBroadcast: 'mobileStartLogsBroadcast',
stopLogsBroadcast: 'mobileStopLogsBroadcast',

performEditorAction: 'mobilePerformEditorAction',
};

if (!_.has(mobileCommandsMapping, mobileCommand)) {
Expand Down
9 changes: 9 additions & 0 deletions lib/commands/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ commands.getSystemBars = async function () {
return parseWindows(out);
};

commands.mobilePerformEditorAction = async function (opts = {}) {
const {action} = opts;
if (!util.hasValue(action)) {
log.errorAndThrow(`'action' argument is required`);
}

await this.adb.performEditorAction(action);
};

Object.assign(extensions, commands, helpers);
export { commands, helpers };
export default extensions;
Expand Down

0 comments on commit 6e37a9f

Please sign in to comment.