UNPKG

testplane

Version:

Tests framework based on mocha and wdio

53 lines 2.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CDPTarget = void 0; const emitter_1 = require("../emitter"); /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/ */ class CDPTarget extends emitter_1.CDPEventEmitter { constructor(connection) { super(); this._connection = connection; } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-getBrowserContexts */ async getBrowserContexts() { return this._connection.request("Target.getBrowserContexts"); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-createBrowserContext */ async createBrowserContext() { return this._connection.request("Target.createBrowserContext"); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-disposeBrowserContext */ async disposeBrowserContext(browserContextId) { return this._connection.request("Target.disposeBrowserContext", { params: { browserContextId } }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-createTarget */ async createTarget({ url = "about:blank", browserContextId, }) { return this._connection.request("Target.createTarget", { params: { url, browserContextId } }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-closeTarget */ async closeTarget(targetId) { return this._connection.request("Target.closeTarget", { params: { targetId } }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-activateTarget */ async activateTarget(targetId) { return this._connection.request("Target.activateTarget", { params: { targetId } }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-attachToTarget */ async attachToTarget(targetId) { return this._connection.request("Target.attachToTarget", { params: { targetId, flatten: true } }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-detachFromTarget */ async detachFromTarget(sessionId) { return this._connection.request("Target.detachFromTarget", { params: { sessionId } }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-getTargets */ async getTargets() { return this._connection.request("Target.getTargets"); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Target/#method-setAutoAttach */ async setAutoAttach(sessionId, params) { return this._connection.request("Target.setAutoAttach", { sessionId, params }); } } exports.CDPTarget = CDPTarget; //# sourceMappingURL=target.js.map