mirror of
https://github.com/appium/appium.git
synced 2026-10-28 04:14:00 +08:00
Do not keep adding sessionId and id to optional parameters
This commit is contained in:
@@ -74,10 +74,14 @@ function checkParams (paramSets, jsonObj) {
|
||||
}
|
||||
|
||||
// some clients pass in the session id in the params
|
||||
optionalParams.push('sessionId');
|
||||
if (optionalParams.indexOf('sessionId') === -1) {
|
||||
optionalParams.push('sessionId');
|
||||
}
|
||||
|
||||
// some clients pass in an element id in the params
|
||||
optionalParams.push('id');
|
||||
if (optionalParams.indexOf('id') === -1) {
|
||||
optionalParams.push('id');
|
||||
}
|
||||
|
||||
// go through the required parameters and check against our arguments
|
||||
for (let params of requiredParams) {
|
||||
@@ -110,7 +114,6 @@ function makeArgs (reqParams, jsonObj, payloadParams) {
|
||||
}
|
||||
}
|
||||
let args = _.flatten(realRequiredParams).map((p) => jsonObj[p]);
|
||||
|
||||
if (payloadParams.optional) {
|
||||
args = args.concat(_.flatten(payloadParams.optional).map((p) => jsonObj[p]));
|
||||
}
|
||||
@@ -158,10 +161,8 @@ function routeConfiguringFunction (driver) {
|
||||
return function (app) {
|
||||
for (let [path, methods] of _.toPairs(METHOD_MAP)) {
|
||||
for (let [method, spec] of _.toPairs(methods)) {
|
||||
let isSessCmd = isSessionCommand(spec.command);
|
||||
|
||||
// set up the express route handler
|
||||
buildHandler(app, method, path, spec, driver, isSessCmd);
|
||||
buildHandler(app, method, path, spec, driver, isSessionCommand(spec.command));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('MJSONWP', () => {
|
||||
}
|
||||
var hash = shasum.digest('hex').substring(0, 8);
|
||||
// Modify the hash whenever the protocol has intentionally been modified.
|
||||
hash.should.equal('5b035b99');
|
||||
hash.should.equal('f5aec588');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user