-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #4017 – Add appium reset command
- Loading branch information
1 parent
40be23a
commit fb4b0f2
Showing
6 changed files
with
181 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const ProtocolAction = require('../_base-action.js'); | ||
|
||
/** | ||
* Reset the app during the test. | ||
* | ||
* More info here: https://appium.io/docs/en/2.3/commands/base-driver/#reset | ||
* | ||
* @example | ||
* module.exports = { | ||
* 'reset the app': function (app) { | ||
* app | ||
* .appium.resetApp(); | ||
* }, | ||
* }; | ||
* | ||
* @syntax .appium.resetApp([callback]) | ||
* @method resetApp | ||
* @param {function} [callback] Optional callback function to be called when the command finishes. | ||
* @api protocol.appium | ||
*/ | ||
module.exports = class Session extends ProtocolAction { | ||
static get isTraceable() { | ||
return true; | ||
} | ||
|
||
command(callback) { | ||
return this.transportActions.resetApp(callback); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const assert = require('assert'); | ||
const Globals = require('../../../lib/globals.js'); | ||
|
||
describe('App reset command', function () { | ||
before(function () { | ||
Globals.protocolBefore(); | ||
}); | ||
|
||
it('testResetApp', function () { | ||
return Globals.protocolTest({ | ||
assertion: function (opts) { | ||
assert.strictEqual(opts.path, '/session/1352110219202/appium/app/reset'); | ||
}, | ||
commandName: 'appium.resetApp', | ||
args: [] | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.