UNPKG

appium-lg-webos-driver

Version:
34 lines 1.01 kB
"use strict"; /** * These are scripts which are sent to the browser via an `/execute/<async|sync>` command. * @module */ Object.defineProperty(exports, "__esModule", { value: true }); exports.SyncScripts = exports.AsyncScripts = void 0; exports.AsyncScripts = Object.freeze({ /** * @param {number|string} code * @param {string} key * @param {number} duration * @param {import('./types').AsyncCallback<null>} done * @returns {void} */ pressKey: (code, key, duration, done) => { document.dispatchEvent(new KeyboardEvent('keydown', { code: String(code), key })); setTimeout(() => { document.dispatchEvent(new KeyboardEvent('keyup', { code: String(code), key })); done(null); }, duration); }, }); /** * These are all synchronous */ exports.SyncScripts = Object.freeze({ reset: () => { window.localStorage.clear(); window.location.reload(); return 0; }, }); //# sourceMappingURL=scripts.js.map