UNPKG

appium-xcuitest-driver

Version:

Appium driver for iOS using XCUITest for backend

39 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MOCHA_TIMEOUT = exports.PORT = exports.HOST = void 0; exports.initSession = initSession; exports.deleteSession = deleteSession; const HOST = process.env.APPIUM_TEST_SERVER_HOST || '127.0.0.1'; exports.HOST = HOST; const PORT = parseInt(String(process.env.APPIUM_TEST_SERVER_PORT), 10) || 4567; exports.PORT = PORT; const MOCHA_TIMEOUT = 60 * 1000 * 4; exports.MOCHA_TIMEOUT = MOCHA_TIMEOUT; let driver; async function initSession(caps, remoteOpts = {}) { const { remote } = await import('webdriverio'); driver = await remote({ hostname: HOST, port: PORT, capabilities: caps, connectionRetryTimeout: MOCHA_TIMEOUT, connectionRetryCount: 1, ...remoteOpts, }); // @ts-ignore private API, apparently driver.name = undefined; // @ts-ignore private API, apparently driver.errored = false; return driver; } async function deleteSession() { try { await driver.deleteSession(); } catch { } finally { driver = undefined; } } //# sourceMappingURL=session.js.map