Innovenergy_trunk/frontend/node_modules/testcafe/lib/proxyless/api-base.js

25 lines
2.9 KiB
JavaScript

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const connection_1 = __importDefault(require("../browser/connection"));
class ProxylessApiBase {
constructor(browserId, client) {
this._client = client;
this._browserConnection = connection_1.default.getById(browserId);
}
async init() {
throw new Error('Not implemented');
}
get _testRun() {
return this._browserConnection.getCurrentTestRun();
}
async _getCurrentUrl() {
const { frameTree } = await this._client.Page.getFrameTree();
return new URL(frameTree.frame.url);
}
}
exports.default = ProxylessApiBase;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLWJhc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJveHlsZXNzL2FwaS1iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQ0EsdUVBQXNEO0FBR3RELE1BQXFCLGdCQUFnQjtJQUlqQyxZQUFhLFNBQWlCLEVBQUUsTUFBbUI7UUFDL0MsSUFBSSxDQUFDLE9BQU8sR0FBRyxNQUFNLENBQUM7UUFDdEIsSUFBSSxDQUFDLGtCQUFrQixHQUFHLG9CQUFpQixDQUFDLE9BQU8sQ0FBQyxTQUFTLENBQXNCLENBQUM7SUFDeEYsQ0FBQztJQUVNLEtBQUssQ0FBQyxJQUFJO1FBQ2IsTUFBTSxJQUFJLEtBQUssQ0FBQyxpQkFBaUIsQ0FBQyxDQUFDO0lBQ3ZDLENBQUM7SUFFRCxJQUFjLFFBQVE7UUFDbEIsT0FBTyxJQUFJLENBQUMsa0JBQWtCLENBQUMsaUJBQWlCLEVBQWEsQ0FBQztJQUNsRSxDQUFDO0lBRVMsS0FBSyxDQUFDLGNBQWM7UUFDMUIsTUFBTSxFQUFFLFNBQVMsRUFBRSxHQ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