Skip to content

Commit

Permalink
feat: Add newMethodMap (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jan 12, 2023
1 parent df4c0e9 commit 5ec5df0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import SafariDriverServer from './safari';
import { desiredCapConstraints } from './desired-caps';
import commands from './commands/index';
import { formatCapsForServer } from './utils';
import { newMethodMap } from './method-map';

const NO_PROXY = [
['GET', new RegExp('^/session/[^/]+/appium')],
Expand All @@ -15,6 +16,9 @@ const NO_PROXY = [
];

class SafariDriver extends BaseDriver {

static newMethodMap = newMethodMap;

constructor (opts = {}) {
super(opts);
this.desiredCapConstraints = desiredCapConstraints;
Expand Down
14 changes: 14 additions & 0 deletions lib/method-map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const newMethodMap = /** @type {const} */ ({
'/session/:sessionId/appium/start_recording_screen': {
POST: {
command: 'startRecordingScreen',
payloadParams: { optional: ['options'] }
}
},
'/session/:sessionId/appium/stop_recording_screen': {
POST: {
command: 'stopRecordingScreen',
payloadParams: { optional: ['options'] }
}
},
});

0 comments on commit 5ec5df0

Please sign in to comment.