appium-safari-driver
Version:
Appium driver for Safari browser
27 lines • 942 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatCapsForServer = formatCapsForServer;
const driver_1 = require("appium/driver");
const SAFARI_CAP_PREFIXES = ['safari:', 'webkit:'];
/**
* Formats the given capabilities for use with Safari Driver Server.
* @param caps - The capabilities to format.
* @returns The formatted capabilities.
*/
function formatCapsForServer(caps) {
const result = {
browserName: 'Safari',
browserVersion: caps.browserVersion,
platformName: caps.platformName || 'iOS',
};
for (const [name, value] of Object.entries(caps)) {
if (SAFARI_CAP_PREFIXES.some((prefix) => name.startsWith(prefix))) {
result[name] = value;
}
else if (!Object.hasOwn(result, name) && driver_1.STANDARD_CAPS.has(name)) {
result[name] = value;
}
}
return result;
}
//# sourceMappingURL=utils.js.map