UNPKG

webdriver

Version:

A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol

41 lines (40 loc) 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function command(method, encodeUri, commandInfo, doubleEncodeVariables = false) { return async function protocolCommand(...args) { const commandESM = await import('../command.js'); return commandESM.default(method, encodeUri, commandInfo, doubleEncodeVariables).apply(this, args); }; } class WebDriver { static async newSession(options, modifier, userPrototype = {}, customCommandWrapper) { const WebDriver = (await import('../index.js')).default; return WebDriver.newSession(options, modifier, userPrototype, customCommandWrapper); } /** * allows user to attach to existing sessions */ static async attachToSession(options, modifier, userPrototype = {}, commandWrapper) { const WebDriver = (await import('../index.js')).default; return WebDriver.attachToSession(options, modifier, userPrototype, commandWrapper); } /** * Changes The instance session id and browser capabilities for the new session * directly into the passed in browser object * * @param {object} instance the object we get from a new browser session. * @returns {string} the new session id of the browser */ static async reloadSession(instance) { const WebDriver = (await import('../index.js')).default; return WebDriver.reloadSession(instance); } static get WebDriver() { return WebDriver; } static get command() { return command; } } module.exports = WebDriver; exports.command = command;