UNPKG

appium-mac2-driver

Version:

XCTest-based Appium driver for macOS apps automation

33 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findElOrEls = findElOrEls; const support_1 = require("appium/support"); /** * This is needed to make lookup by image working * * @this {Mac2Driver} * @param {string} strategy * @param {string} selector * @param {boolean} mult * @param {string} [context] * @returns {Promise<any>} */ async function findElOrEls(strategy, selector, mult, context) { const contextId = context ? support_1.util.unwrapElement(context) : context; const endpoint = `/element${contextId ? `/${contextId}/element` : ''}${mult ? 's' : ''}`; if (strategy === '-ios predicate string') { strategy = 'predicate string'; } else if (strategy === '-ios class chain') { strategy = 'class chain'; } return await this.wda.proxy.command(endpoint, 'POST', { using: strategy, value: selector, }); } ; /** * @typedef {import('../driver').Mac2Driver} Mac2Driver */ //# sourceMappingURL=find.js.map