added all files to project

This commit is contained in:
2022-03-10 10:36:59 +01:00
parent 09dd957b33
commit 46a936d7de
25351 changed files with 3883356 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function acceptAlert(this: DevToolsDriver): Promise<null>;
//# sourceMappingURL=acceptAlert.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"acceptAlert.d.ts","sourceRoot":"","sources":["../../src/commands/acceptAlert.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,WAAW,CAAC,IAAI,EAAE,cAAc,iBAQ7D"}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function acceptAlert() {
if (!this.activeDialog) {
throw new Error('no such alert');
}
await this.activeDialog.accept();
delete this.activeDialog;
return null;
}
exports.default = acceptAlert;
+6
View File
@@ -0,0 +1,6 @@
/// <reference types="webdriver" />
import type DevToolsDriver from '../devtoolsdriver';
export default function addCookie(this: DevToolsDriver, { cookie }: {
cookie: WebDriver.Cookie;
}): Promise<null>;
//# sourceMappingURL=addCookie.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"addCookie.d.ts","sourceRoot":"","sources":["../../src/commands/addCookie.ts"],"names":[],"mappings":";AAQA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,SAAS,CACnC,IAAI,EAAE,cAAc,EACpB,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAA;CAAE,iBAiB3C"}
+15
View File
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function addCookie({ cookie }) {
const page = this.getPageHandle();
const cookieProps = Object.keys(cookie);
if (!cookieProps.includes('name') || !cookieProps.includes('value')) {
throw new Error('Provided cookie object is missing either "name" or "value" property');
}
if (typeof cookie.value !== 'string') {
cookie.value = cookie.value.toString();
}
await page.setCookie(cookie);
return null;
}
exports.default = addCookie;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function back(this: DevToolsDriver): Promise<null>;
//# sourceMappingURL=back.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"back.d.ts","sourceRoot":"","sources":["../../src/commands/back.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,IAAI,CAAE,IAAI,EAAE,cAAc,iBAMvD"}
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function back() {
delete this.currentFrame;
const page = this.getPageHandle();
await page.goBack();
return null;
}
exports.default = back;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function closeWindow(this: DevToolsDriver): Promise<string>;
//# sourceMappingURL=closeWindow.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"closeWindow.d.ts","sourceRoot":"","sources":["../../src/commands/closeWindow.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,WAAW,CAAE,IAAI,EAAE,cAAc,mBAoB9D"}
+21
View File
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const uuid_1 = require("uuid");
async function closeWindow() {
delete this.currentFrame;
const page = this.getPageHandle();
await page.close();
this.windows.delete(this.currentWindowHandle || '');
const handles = this.windows.keys();
this.currentWindowHandle = handles.next().value;
if (!this.currentWindowHandle) {
const page = await this.browser.newPage();
const newWindowHandle = uuid_1.v4();
this.windows.set(newWindowHandle, page);
this.currentWindowHandle = newWindowHandle;
}
const newPage = this.getPageHandle();
await newPage.bringToFront();
return this.currentWindowHandle;
}
exports.default = closeWindow;
+8
View File
@@ -0,0 +1,8 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function createWindow(this: DevToolsDriver, { type }: {
type: 'window' | 'tab';
}): Promise<{
handle: string;
type: "tab" | "window";
}>;
//# sourceMappingURL=createWindow.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"createWindow.d.ts","sourceRoot":"","sources":["../../src/commands/createWindow.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAQnD,wBAA8B,YAAY,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAA;CAAE;;;GA6BvC"}
+35
View File
@@ -0,0 +1,35 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const uuid_1 = require("uuid");
const createWindow_1 = __importDefault(require("../scripts/createWindow"));
const WINDOW_FEATURES = 'menubar=1,toolbar=1,location=1,resizable=1,scrollbars=1';
const NEW_PAGE_URL = 'about:blank';
const DEFAULT_WINDOW_TYPE = 'tab';
async function createWindow({ type }) {
type = type || DEFAULT_WINDOW_TYPE;
let newPage;
if (type === 'window') {
const page = this.getPageHandle();
await page.evaluate(createWindow_1.default, NEW_PAGE_URL, WINDOW_FEATURES);
const newWindowTarget = await this.browser.waitForTarget((target) => target.url() === NEW_PAGE_URL);
newPage = await newWindowTarget.page();
if (!newPage) {
throw new Error('Couldn\'t find page to switch to');
}
}
else {
newPage = await this.browser.newPage();
}
const handle = uuid_1.v4();
await newPage.bringToFront();
this.currentWindowHandle = handle;
this.windows.set(handle, newPage);
return {
handle: this.currentWindowHandle,
type
};
}
exports.default = createWindow;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function deleteAllCookies(this: DevToolsDriver): Promise<null>;
//# sourceMappingURL=deleteAllCookies.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"deleteAllCookies.d.ts","sourceRoot":"","sources":["../../src/commands/deleteAllCookies.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,gBAAgB,CAAE,IAAI,EAAE,cAAc,iBASnE"}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function deleteAllCookies() {
const page = this.getPageHandle();
const cookies = await page.cookies();
for (const cookie of cookies) {
await page.deleteCookie(cookie);
}
return null;
}
exports.default = deleteAllCookies;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function deleteCookie(this: DevToolsDriver, { name }: {
name: string;
}): Promise<null>;
//# sourceMappingURL=deleteCookie.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"deleteCookie.d.ts","sourceRoot":"","sources":["../../src/commands/deleteCookie.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,YAAY,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,iBAW7B"}
+12
View File
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function deleteCookie({ name }) {
const page = this.getPageHandle();
const cookies = await page.cookies();
const cookieToDelete = cookies.find((cookie) => cookie.name === name);
if (cookieToDelete) {
await page.deleteCookie(cookieToDelete);
}
return null;
}
exports.default = deleteCookie;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function deleteSession(this: DevToolsDriver): Promise<null>;
//# sourceMappingURL=deleteSession.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"deleteSession.d.ts","sourceRoot":"","sources":["../../src/commands/deleteSession.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,aAAa,CAAE,IAAI,EAAE,cAAc,iBAIhE"}
+8
View File
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function deleteSession() {
await this.browser.close();
this.windows.clear();
return null;
}
exports.default = deleteSession;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function dismissAlert(this: DevToolsDriver): Promise<null>;
//# sourceMappingURL=dismissAlert.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"dismissAlert.d.ts","sourceRoot":"","sources":["../../src/commands/dismissAlert.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,YAAY,CAAE,IAAI,EAAE,cAAc,iBAQ/D"}
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function dismissAlert() {
if (!this.activeDialog) {
throw new Error('no such alert');
}
await this.activeDialog.dismiss();
delete this.activeDialog;
return null;
}
exports.default = dismissAlert;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function elementClear(this: DevToolsDriver, { elementId }: {
elementId: string;
}): Promise<null>;
//# sourceMappingURL=elementClear.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"elementClear.d.ts","sourceRoot":"","sources":["../../src/commands/elementClear.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,YAAY,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,iBAUvC"}
+17
View File
@@ -0,0 +1,17 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const elementClear_1 = __importDefault(require("../scripts/elementClear"));
const utils_1 = require("../utils");
async function elementClear({ elementId }) {
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const page = this.getPageHandle(true);
await page.$eval('html', elementClear_1.default, elementHandle);
return null;
}
exports.default = elementClear;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function elementClick(this: DevToolsDriver, { elementId }: {
elementId: string;
}): Promise<unknown>;
//# sourceMappingURL=elementClick.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"elementClick.d.ts","sourceRoot":"","sources":["../../src/commands/elementClick.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,YAAY,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,oBAqCvC"}
+28
View File
@@ -0,0 +1,28 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getElementTagName_1 = __importDefault(require("./getElementTagName"));
const selectOption_1 = __importDefault(require("../scripts/selectOption"));
const utils_1 = require("../utils");
async function elementClick({ elementId }) {
const page = this.getPageHandle();
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const tagName = await getElementTagName_1.default.call(this, { elementId });
if (tagName === 'option') {
return page.$eval('html', selectOption_1.default, elementHandle);
}
return new Promise((resolve, reject) => {
const dialogHandler = () => resolve(null);
page.once('dialog', dialogHandler);
return elementHandle.click().then(() => {
page.removeListener('dialog', dialogHandler);
resolve(null);
}).catch(reject);
});
}
exports.default = elementClick;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function elementSendKeys(this: DevToolsDriver, { elementId, text }: {
elementId: string;
text: string;
}): Promise<null>;
//# sourceMappingURL=elementSendKeys.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"elementSendKeys.d.ts","sourceRoot":"","sources":["../../src/commands/elementSendKeys.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,eAAe,CACzC,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,iBAyB3D"}
+31
View File
@@ -0,0 +1,31 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const utils_1 = require("../utils");
async function elementSendKeys({ elementId, text }) {
var _a, _b;
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
await elementHandle.focus();
const page = this.getPageHandle();
const propertyHandles = {
tagName: await elementHandle.getProperty('tagName'),
type: await elementHandle.getProperty('type')
};
const tagName = await ((_a = propertyHandles.tagName) === null || _a === void 0 ? void 0 : _a.jsonValue());
const type = await ((_b = propertyHandles.type) === null || _b === void 0 ? void 0 : _b.jsonValue());
if (tagName === 'INPUT' && type === 'file') {
const paths = (text || '').split('\n').map(p => path_1.default.resolve(p));
await elementHandle.uploadFile(...paths);
}
else {
await page.keyboard.type(text);
}
return null;
}
exports.default = elementSendKeys;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function executeAsyncScript(this: DevToolsDriver, { script, args }: {
script: string;
args: any[];
}): Promise<any>;
//# sourceMappingURL=executeAsyncScript.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"executeAsyncScript.d.ts","sourceRoot":"","sources":["../../src/commands/executeAsyncScript.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,kBAAkB,CAC5C,IAAI,EAAE,cAAc,EACpB,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,gBAyBpD"}
+22
View File
@@ -0,0 +1,22 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const executeAsyncScript_1 = __importDefault(require("../scripts/executeAsyncScript"));
const utils_1 = require("../utils");
const constants_1 = require("../constants");
async function executeAsyncScript({ script, args }) {
const page = this.getPageHandle(true);
const scriptTimeout = this.timeouts.get('script') || 0;
script = script.trim();
if (script.startsWith('return (')) {
script = script.slice(7);
}
if (script.startsWith('return')) {
script = `(function () { ${script} }).apply(null, arguments)`;
}
const result = await page.$eval('html', executeAsyncScript_1.default, script, scriptTimeout, constants_1.SERIALIZE_PROPERTY, constants_1.SERIALIZE_FLAG, ...(await utils_1.transformExecuteArgs.call(this, args)));
return utils_1.transformExecuteResult.call(this, page, result);
}
exports.default = executeAsyncScript;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function executeScript(this: DevToolsDriver, { script, args }: {
script: string;
args: any[];
}): Promise<any>;
//# sourceMappingURL=executeScript.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"executeScript.d.ts","sourceRoot":"","sources":["../../src/commands/executeScript.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,aAAa,CACvC,IAAI,EAAE,cAAc,EACpB,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,gBAuCpD"}
+33
View File
@@ -0,0 +1,33 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const executeScript_1 = __importDefault(require("../scripts/executeScript"));
const utils_1 = require("../utils");
const constants_1 = require("../constants");
async function executeScript({ script, args }) {
const page = this.getPageHandle(true);
const scriptTimeout = this.timeouts.get('script');
script = script.trim();
if (script.startsWith('return (')) {
script = script.slice(7);
}
if (script.startsWith('return')) {
script = `(function () { ${script} }).apply(null, arguments)`;
}
const executePromise = page.$eval('html', executeScript_1.default, script, constants_1.SERIALIZE_PROPERTY, constants_1.SERIALIZE_FLAG, ...(await utils_1.transformExecuteArgs.call(this, args)));
let executeTimeout;
const timeoutPromise = new Promise((_, reject) => {
executeTimeout = setTimeout(() => {
const timeoutError = `script timeout${this.activeDialog
? ' reason: a browser dialog has opened as result of a executeScript call'
: ''}`;
return reject(new Error(timeoutError));
}, scriptTimeout);
});
const result = await Promise.race([executePromise, timeoutPromise]);
clearTimeout(executeTimeout);
return utils_1.transformExecuteResult.call(this, page, result);
}
exports.default = executeScript;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function findElement(this: DevToolsDriver, { using, value }: {
using: string;
value: string;
}): Promise<Record<"element-6066-11e4-a52e-4f735466cecf", string> | Error>;
//# sourceMappingURL=findElement.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"findElement.d.ts","sourceRoot":"","sources":["../../src/commands/findElement.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,IAAI,EAAE,cAAc,EACpB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,0EAgBrD"}
+20
View File
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const utils_1 = require("../utils");
function findElement({ using, value }) {
if (!constants_1.SUPPORTED_SELECTOR_STRATEGIES.includes(using)) {
throw new Error(`selector strategy "${using}" is not yet supported`);
}
if (using === 'link text') {
using = 'xpath';
value = `//a[normalize-space() = "${value}"]`;
}
else if (using === 'partial link text') {
using = 'xpath';
value = `//a[contains(., "${value}")]`;
}
const page = this.getPageHandle(true);
return utils_1.findElement.call(this, page, using, value);
}
exports.default = findElement;
+7
View File
@@ -0,0 +1,7 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function findElementFromElement(this: DevToolsDriver, { elementId, using, value }: {
elementId: string;
using: string;
value: string;
}): Promise<Record<"element-6066-11e4-a52e-4f735466cecf", string> | Error>;
//# sourceMappingURL=findElementFromElement.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"findElementFromElement.d.ts","sourceRoot":"","sources":["../../src/commands/findElementFromElement.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,sBAAsB,CAChD,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,0EAqBnF"}
+23
View File
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const utils_1 = require("../utils");
async function findElementFromElement({ elementId, using, value }) {
if (!constants_1.SUPPORTED_SELECTOR_STRATEGIES.includes(using)) {
throw new Error(`selector strategy "${using}" is not yet supported`);
}
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
if (using === 'link text') {
using = 'xpath';
value = `.//a[normalize-space() = "${value}"]`;
}
else if (using === 'partial link text') {
using = 'xpath';
value = `.//a[contains(., "${value}")]`;
}
return utils_1.findElement.call(this, elementHandle, using, value);
}
exports.default = findElementFromElement;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function findElements(this: DevToolsDriver, { using, value }: {
using: string;
value: string;
}): Promise<Record<"element-6066-11e4-a52e-4f735466cecf", string>[]>;
//# sourceMappingURL=findElements.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"findElements.d.ts","sourceRoot":"","sources":["../../src/commands/findElements.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,YAAY,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,oEAgBrD"}
+20
View File
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const utils_1 = require("../utils");
async function findElements({ using, value }) {
if (!constants_1.SUPPORTED_SELECTOR_STRATEGIES.includes(using)) {
throw new Error(`selector strategy "${using}" is not yet supported`);
}
if (using === 'link text') {
using = 'xpath';
value = `//a[normalize-space() = "${value}"]`;
}
else if (using === 'partial link text') {
using = 'xpath';
value = `//a[contains(., "${value}")]`;
}
const page = this.getPageHandle(true);
return utils_1.findElements.call(this, page, using, value);
}
exports.default = findElements;
+7
View File
@@ -0,0 +1,7 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function findElementFromElements(this: DevToolsDriver, { elementId, using, value }: {
elementId: string;
using: string;
value: string;
}): Promise<Record<"element-6066-11e4-a52e-4f735466cecf", string>[]>;
//# sourceMappingURL=findElementsFromElement.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"findElementsFromElement.d.ts","sourceRoot":"","sources":["../../src/commands/findElementsFromElement.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,uBAAuB,CACjD,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,oEAqBnF"}
+23
View File
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../constants");
const utils_1 = require("../utils");
async function findElementFromElements({ elementId, using, value }) {
if (!constants_1.SUPPORTED_SELECTOR_STRATEGIES.includes(using)) {
throw new Error(`selector strategy "${using}" is not yet supported`);
}
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
if (using === 'link text') {
using = 'xpath';
value = `.//a[normalize-space() = "${value}"]`;
}
else if (using === 'partial link text') {
using = 'xpath';
value = `.//a[contains(., "${value}")]`;
}
return utils_1.findElements.call(this, elementHandle, using, value);
}
exports.default = findElementFromElements;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function forward(this: DevToolsDriver): Promise<null>;
//# sourceMappingURL=forward.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"forward.d.ts","sourceRoot":"","sources":["../../src/commands/forward.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,OAAO,CAAE,IAAI,EAAE,cAAc,iBAK1D"}
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function forward() {
delete this.currentFrame;
const page = this.getPageHandle();
await page.goForward();
return null;
}
exports.default = forward;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getActiveElement(this: DevToolsDriver): Promise<Record<"element-6066-11e4-a52e-4f735466cecf", string> | Error>;
//# sourceMappingURL=getActiveElement.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getActiveElement.d.ts","sourceRoot":"","sources":["../../src/commands/getActiveElement.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,gBAAgB,CAC1C,IAAI,EAAE,cAAc,0EA4BvB"}
+24
View File
@@ -0,0 +1,24 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const findElement_1 = __importDefault(require("./findElement"));
const getActiveElement_1 = __importDefault(require("../scripts/getActiveElement"));
const cleanUpSerializationSelector_1 = __importDefault(require("../scripts/cleanUpSerializationSelector"));
const constants_1 = require("../constants");
async function getActiveElement() {
const page = this.getPageHandle(true);
const selector = `[${constants_1.SERIALIZE_PROPERTY}]`;
const hasElem = await page.$eval('html', getActiveElement_1.default, constants_1.SERIALIZE_PROPERTY);
if (!hasElem) {
throw new Error('no element active');
}
const activeElement = await findElement_1.default.call(this, {
using: 'css selector',
value: selector
});
await page.$eval(selector, cleanUpSerializationSelector_1.default, constants_1.SERIALIZE_PROPERTY);
return activeElement;
}
exports.default = getActiveElement;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getAlertText(this: DevToolsDriver): string;
//# sourceMappingURL=getAlertText.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getAlertText.d.ts","sourceRoot":"","sources":["../../src/commands/getAlertText.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,IAAI,EAAE,cAAc,UAMzD"}
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getAlertText() {
if (!this.activeDialog) {
throw new Error('no such alert');
}
return this.activeDialog.message();
}
exports.default = getAlertText;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getAllCookies(this: DevToolsDriver): Promise<import("devtools-protocol").Protocol.Network.Cookie[]>;
//# sourceMappingURL=getAllCookies.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getAllCookies.d.ts","sourceRoot":"","sources":["../../src/commands/getAllCookies.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,aAAa,CAAE,IAAI,EAAE,cAAc,kEAGhE"}
+7
View File
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function getAllCookies() {
const page = this.getPageHandle();
return page.cookies();
}
exports.default = getAllCookies;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementAttribute(this: DevToolsDriver, { elementId, name }: {
elementId: string;
name: string;
}): Promise<string | null>;
//# sourceMappingURL=getElementAttribute.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getElementAttribute.d.ts","sourceRoot":"","sources":["../../src/commands/getElementAttribute.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,mBAAmB,CAC7C,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,0BAS3D"}
+16
View File
@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getElementAttribute_1 = __importDefault(require("../scripts/getElementAttribute"));
const utils_1 = require("../utils");
async function getElementAttribute({ elementId, name }) {
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const page = this.getPageHandle(true);
return page.$eval('html', getElementAttribute_1.default, elementHandle, name);
}
exports.default = getElementAttribute;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementCSSValue(this: DevToolsDriver, { elementId, propertyName }: {
elementId: string;
propertyName: string;
}): Promise<string>;
//# sourceMappingURL=getElementCSSValue.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getElementCSSValue.d.ts","sourceRoot":"","sources":["../../src/commands/getElementCSSValue.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,kBAAkB,CAC5C,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,mBAS3E"}
+16
View File
@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getElementCSSValue_1 = __importDefault(require("../scripts/getElementCSSValue"));
const utils_1 = require("../utils");
async function getElementCSSValue({ elementId, propertyName }) {
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const page = this.getPageHandle(true);
return page.$eval('html', getElementCSSValue_1.default, elementHandle, propertyName);
}
exports.default = getElementCSSValue;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementComputedLabel(this: DevToolsDriver, { elementId }: {
elementId: string;
}): Promise<string | undefined>;
//# sourceMappingURL=getElementComputedLabel.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"getElementComputedLabel.d.ts","sourceRoot":"","sources":["../../src/commands/getElementComputedLabel.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,uBAAuB,CACjD,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,+BAavC"}
+14
View File
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function getElementComputedLabel({ elementId }) {
const page = this.getPageHandle(true);
const elementHandle = await this.elementStore.get(elementId);
const snapshot = await page.accessibility.snapshot({
root: elementHandle
});
if (!snapshot) {
return '';
}
return snapshot.name;
}
exports.default = getElementComputedLabel;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementComputedRole(this: DevToolsDriver, { elementId }: {
elementId: string;
}): Promise<string>;
//# sourceMappingURL=getElementComputedRole.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getElementComputedRole.d.ts","sourceRoot":"","sources":["../../src/commands/getElementComputedRole.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,sBAAsB,CAChD,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,mBAavC"}
+14
View File
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function getElementComputedRole({ elementId }) {
const page = this.getPageHandle(true);
const elementHandle = await this.elementStore.get(elementId);
const snapshot = await page.accessibility.snapshot({
root: elementHandle
});
if (!snapshot) {
return 'Ignored';
}
return snapshot.role;
}
exports.default = getElementComputedRole;
+6
View File
@@ -0,0 +1,6 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementProperty(this: DevToolsDriver, { elementId, name }: {
elementId: string;
name: string;
}): Promise<Record<string, unknown> | null>;
//# sourceMappingURL=getElementProperty.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getElementProperty.d.ts","sourceRoot":"","sources":["../../src/commands/getElementProperty.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,kBAAkB,CAC5C,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,2CAc3D"}
+15
View File
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../utils");
async function getElementProperty({ elementId, name }) {
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const jsHandle = await elementHandle.getProperty(name);
if (!jsHandle) {
return null;
}
return jsHandle.jsonValue();
}
exports.default = getElementProperty;
+10
View File
@@ -0,0 +1,10 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementRect(this: DevToolsDriver, { elementId }: {
elementId: string;
}): Promise<{
x: number;
y: number;
width: number;
height: number;
}>;
//# sourceMappingURL=getElementRect.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getElementRect.d.ts","sourceRoot":"","sources":["../../src/commands/getElementRect.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,cAAc,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE;;;;;GASvC"}
+16
View File
@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getElementRect_1 = __importDefault(require("../scripts/getElementRect"));
const utils_1 = require("../utils");
async function getElementRect({ elementId }) {
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const page = this.getPageHandle(true);
return page.$eval('html', getElementRect_1.default, elementHandle);
}
exports.default = getElementRect;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementTagName(this: DevToolsDriver, { elementId }: {
elementId: string;
}): Promise<string>;
//# sourceMappingURL=getElementTagName.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getElementTagName.d.ts","sourceRoot":"","sources":["../../src/commands/getElementTagName.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,iBAAiB,CAC3C,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,mBAUvC"}
+17
View File
@@ -0,0 +1,17 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getElementTagName_1 = __importDefault(require("../scripts/getElementTagName"));
const utils_1 = require("../utils");
async function getElementTagName({ elementId }) {
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const page = this.getPageHandle(true);
const result = await page.$eval('html', getElementTagName_1.default, elementHandle);
return (result || '').toLowerCase();
}
exports.default = getElementTagName;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getElementText(this: DevToolsDriver, { elementId }: {
elementId: string;
}): Promise<string>;
//# sourceMappingURL=getElementText.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getElementText.d.ts","sourceRoot":"","sources":["../../src/commands/getElementText.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,cAAc,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,mBASvC"}
+16
View File
@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getElementText_1 = __importDefault(require("../scripts/getElementText"));
const utils_1 = require("../utils");
async function getElementText({ elementId }) {
const elementHandle = await this.elementStore.get(elementId);
if (!elementHandle) {
throw utils_1.getStaleElementError(elementId);
}
const page = this.getPageHandle(true);
return page.$eval('html', getElementText_1.default, elementHandle);
}
exports.default = getElementText;
+5
View File
@@ -0,0 +1,5 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getNamedCookie(this: DevToolsDriver, { name }: {
name: string;
}): Promise<import("devtools-protocol").Protocol.Network.Cookie>;
//# sourceMappingURL=getNamedCookie.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getNamedCookie.d.ts","sourceRoot":"","sources":["../../src/commands/getNamedCookie.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,wBAA8B,cAAc,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,gEAW7B"}
+12
View File
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function getNamedCookie({ name }) {
const page = this.getPageHandle();
const cookies = await page.cookies();
const cookie = cookies.find((cookie) => cookie.name === name);
if (!cookie) {
throw new Error(`No cookie with name ${name}`);
}
return cookie;
}
exports.default = getNamedCookie;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getPageSource(this: DevToolsDriver): Promise<string>;
//# sourceMappingURL=getPageSource.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getPageSource.d.ts","sourceRoot":"","sources":["../../src/commands/getPageSource.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,IAAI,EAAE,cAAc,mBAG1D"}
+7
View File
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getPageSource() {
const page = this.getPageHandle(true);
return page.content();
}
exports.default = getPageSource;
+7
View File
@@ -0,0 +1,7 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getTimeouts(this: DevToolsDriver): {
implicit: number | undefined;
pageLoad: number | undefined;
script: number | undefined;
};
//# sourceMappingURL=getTimeouts.d.ts.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"getTimeouts.d.ts","sourceRoot":"","sources":["../../src/commands/getTimeouts.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AAEnD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,IAAI,EAAE,cAAc;;;;EAMxD"}
+10
View File
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getTimeouts() {
return {
implicit: this.timeouts.get('implicit'),
pageLoad: this.timeouts.get('pageLoad'),
script: this.timeouts.get('script')
};
}
exports.default = getTimeouts;
+3
View File
@@ -0,0 +1,3 @@
import type DevToolsDriver from '../devtoolsdriver';
export default function getTitle(this: DevToolsDriver): Promise<string>;
//# sourceMappingURL=getTitle.d.ts.map

Some files were not shown because too many files have changed in this diff Show More