refactor: just a little more visibility into unprefixed caps
MODIFY
lib/basedriver/capabilities.js
lib/basedriver/capabilities.js
@@ -121,7 +121,8 @@ function parseCaps (caps, constraints = {}, shouldValidateCaps = true) {
throw new errors.InvalidArgumentError('The capabilities argument was not valid for the following reason(s): "capabilities" must be a JSON object.');
}
- // Let 'requiredCaps' be property named 'alwaysMatch' from capabilities request (#2) and 'allFirstMatchCaps' be property named 'firstMatch from capabilities request (#3)
+ // Let 'requiredCaps' be property named 'alwaysMatch' from capabilities request (#2)
+ // and 'allFirstMatchCaps' be property named 'firstMatch' from capabilities request (#3)
let {
alwaysMatch: requiredCaps = {}, // If 'requiredCaps' is undefined, set it to an empty JSON object (#2.1)
firstMatch: allFirstMatchCaps = [{}], // If 'firstMatch' is undefined set it to a singleton list with one empty object (#3.1)
@@ -140,7 +141,10 @@ function parseCaps (caps, constraints = {}, shouldValidateCaps = true) {
// Check for non-prefixed, non-standard capabilities and log warnings if they are found
let nonPrefixedCaps = findNonPrefixedCaps(caps);
if (!_.isEmpty(nonPrefixedCaps)) {
- log.warn(`The capabilities ${JSON.stringify(nonPrefixedCaps)} are not standard capabilities and should have an extension prefix`);
+ log.warn(`The following capabilities are not standard capabilities and should have an extension prefix:`);
+ for (const cap of nonPrefixedCaps) {
+ log.warn(` ${cap}`);
+ }
}
// Strip out the 'appium:' prefix from all

refactor: just a little more visibility into unprefixed caps (#381)