appium-safari-driver
Version:
Appium driver for Safari browser
22 lines • 866 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.findElOrEls = findElOrEls;
const support_1 = require("appium/support");
/**
* Find element(s) using the specified strategy and selector.
* This is needed to make lookup by image working.
*
* @param strategy - The locator strategy to use
* @param selector - The selector value
* @param mult - Whether to find multiple elements
* @param context - Optional context element ID
* @returns Promise that resolves to the found element(s)
*/
async function findElOrEls(strategy, selector, mult, context) {
const endpoint = `/element${context ? `/${support_1.util.unwrapElement(context)}/element` : ''}${mult ? 's' : ''}`;
return await this.safari.proxy.command(endpoint, 'POST', {
using: strategy,
value: selector,
});
}
//# sourceMappingURL=find.js.map