addAppiumPrefix function

Map<String, dynamic> addAppiumPrefix(
  1. Map<String, dynamic> desired
)

Returns desired capabilities with appium prefix

Implementation

Map<String, dynamic> addAppiumPrefix(Map<String, dynamic> desired) {
  var w3cCapabilities = [
    'browserName',
    'browserVersion',
    'platformName',
    'acceptInsecureCerts',
    'pageLoadStrategy',
    'proxy',
    'setWindowRect',
    'timeouts',
    'unhandledPromptBehavior',
    'strictFileInteractability'
  ];

  return desired.map((k, v) {
    if (w3cCapabilities.contains(k) || k.contains(':')) {
      return MapEntry(k, v);
    }
    return MapEntry('appium:$k', v);
  });
}