UNPKG

testplane

Version:

Tests framework based on mocha and wdio

51 lines 2.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CDFetch = void 0; const emitter_1 = require("../emitter"); /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/ */ class CDFetch extends emitter_1.CDPEventEmitter { constructor(connection) { super(); this._connection = connection; } /** * @param sessionId result of "Target.attachToTarget" * @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-enable */ async enable(sessionId, params) { return this._connection.request("Fetch.enable", { sessionId, params }); } /** * @param sessionId result of "Target.attachToTarget" * @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-disable */ async disable(sessionId) { return this._connection.request("Fetch.disable", { sessionId }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-failRequest */ async failRequest(sessionId, params) { return this._connection.request("Fetch.failRequest", { sessionId, params }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-fulfillRequest */ async fulfillRequest(sessionId, params) { return this._connection.request("Fetch.fulfillRequest", { sessionId, params }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-continueRequest */ async continueRequest(sessionId, params) { return this._connection.request("Fetch.continueRequest", { sessionId, params }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-continueWithAuth */ async continueWithAuth(sessionId, params) { return this._connection.request("Fetch.continueWithAuth", { sessionId, params }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-getResponseBody */ async getResponseBody(sessionId, requestId) { return this._connection.request("Fetch.getResponseBody", { sessionId, params: { requestId } }); } /** @link https://chromedevtools.github.io/devtools-protocol/1-3/Fetch/#method-takeResponseBodyAsStream */ async takeResponseBodyAsStream(sessionId, requestId) { return this._connection.request("Fetch.takeResponseBodyAsStream", { sessionId, params: { requestId } }); } } exports.CDFetch = CDFetch; //# sourceMappingURL=fetch.js.map