screenshot/test_1
This commit is contained in:
27
node_modules/playwright-core/lib/protocol/debug.js
generated
vendored
Normal file
27
node_modules/playwright-core/lib/protocol/debug.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.slowMoActions = exports.pausesBeforeInputActions = exports.commandsWithTracingSnapshots = void 0;
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// This file is generated by generate_channels.js, do not edit manually.
|
||||
|
||||
const slowMoActions = exports.slowMoActions = new Set(['Page.goBack', 'Page.goForward', 'Page.reload', 'Page.keyboardDown', 'Page.keyboardUp', 'Page.keyboardInsertText', 'Page.keyboardType', 'Page.keyboardPress', 'Page.mouseMove', 'Page.mouseDown', 'Page.mouseUp', 'Page.mouseClick', 'Page.mouseWheel', 'Page.touchscreenTap', 'Frame.blur', 'Frame.check', 'Frame.click', 'Frame.dragAndDrop', 'Frame.dblclick', 'Frame.dispatchEvent', 'Frame.fill', 'Frame.focus', 'Frame.goto', 'Frame.hover', 'Frame.press', 'Frame.selectOption', 'Frame.setInputFiles', 'Frame.tap', 'Frame.type', 'Frame.uncheck', 'ElementHandle.check', 'ElementHandle.click', 'ElementHandle.dblclick', 'ElementHandle.dispatchEvent', 'ElementHandle.fill', 'ElementHandle.focus', 'ElementHandle.hover', 'ElementHandle.press', 'ElementHandle.scrollIntoViewIfNeeded', 'ElementHandle.selectOption', 'ElementHandle.selectText', 'ElementHandle.setInputFiles', 'ElementHandle.tap', 'ElementHandle.type', 'ElementHandle.uncheck']);
|
||||
const commandsWithTracingSnapshots = exports.commandsWithTracingSnapshots = new Set(['EventTarget.waitForEventInfo', 'BrowserContext.waitForEventInfo', 'Page.waitForEventInfo', 'WebSocket.waitForEventInfo', 'ElectronApplication.waitForEventInfo', 'AndroidDevice.waitForEventInfo', 'Page.emulateMedia', 'Page.goBack', 'Page.goForward', 'Page.reload', 'Page.expectScreenshot', 'Page.screenshot', 'Page.setViewportSize', 'Page.keyboardDown', 'Page.keyboardUp', 'Page.keyboardInsertText', 'Page.keyboardType', 'Page.keyboardPress', 'Page.mouseMove', 'Page.mouseDown', 'Page.mouseUp', 'Page.mouseClick', 'Page.mouseWheel', 'Page.touchscreenTap', 'Page.accessibilitySnapshot', 'Frame.evalOnSelector', 'Frame.evalOnSelectorAll', 'Frame.addScriptTag', 'Frame.addStyleTag', 'Frame.ariaSnapshot', 'Frame.blur', 'Frame.check', 'Frame.click', 'Frame.content', 'Frame.dragAndDrop', 'Frame.dblclick', 'Frame.dispatchEvent', 'Frame.evaluateExpression', 'Frame.evaluateExpressionHandle', 'Frame.fill', 'Frame.focus', 'Frame.getAttribute', 'Frame.goto', 'Frame.hover', 'Frame.innerHTML', 'Frame.innerText', 'Frame.inputValue', 'Frame.isChecked', 'Frame.isDisabled', 'Frame.isEnabled', 'Frame.isHidden', 'Frame.isVisible', 'Frame.isEditable', 'Frame.press', 'Frame.querySelector', 'Frame.querySelectorAll', 'Frame.queryCount', 'Frame.selectOption', 'Frame.setContent', 'Frame.setInputFiles', 'Frame.tap', 'Frame.textContent', 'Frame.type', 'Frame.uncheck', 'Frame.waitForTimeout', 'Frame.waitForFunction', 'Frame.waitForSelector', 'Frame.expect', 'JSHandle.evaluateExpression', 'ElementHandle.evaluateExpression', 'JSHandle.evaluateExpressionHandle', 'ElementHandle.evaluateExpressionHandle', 'ElementHandle.evalOnSelector', 'ElementHandle.evalOnSelectorAll', 'ElementHandle.boundingBox', 'ElementHandle.check', 'ElementHandle.click', 'ElementHandle.contentFrame', 'ElementHandle.dblclick', 'ElementHandle.dispatchEvent', 'ElementHandle.fill', 'ElementHandle.focus', 'ElementHandle.hover', 'ElementHandle.innerHTML', 'ElementHandle.innerText', 'ElementHandle.inputValue', 'ElementHandle.isChecked', 'ElementHandle.isDisabled', 'ElementHandle.isEditable', 'ElementHandle.isEnabled', 'ElementHandle.isHidden', 'ElementHandle.isVisible', 'ElementHandle.press', 'ElementHandle.querySelector', 'ElementHandle.querySelectorAll', 'ElementHandle.screenshot', 'ElementHandle.scrollIntoViewIfNeeded', 'ElementHandle.selectOption', 'ElementHandle.selectText', 'ElementHandle.setInputFiles', 'ElementHandle.tap', 'ElementHandle.textContent', 'ElementHandle.type', 'ElementHandle.uncheck', 'ElementHandle.waitForElementState', 'ElementHandle.waitForSelector']);
|
||||
const pausesBeforeInputActions = exports.pausesBeforeInputActions = new Set(['Frame.check', 'Frame.click', 'Frame.dragAndDrop', 'Frame.dblclick', 'Frame.fill', 'Frame.hover', 'Frame.press', 'Frame.selectOption', 'Frame.setInputFiles', 'Frame.tap', 'Frame.type', 'Frame.uncheck', 'ElementHandle.check', 'ElementHandle.click', 'ElementHandle.dblclick', 'ElementHandle.fill', 'ElementHandle.hover', 'ElementHandle.press', 'ElementHandle.selectOption', 'ElementHandle.setInputFiles', 'ElementHandle.tap', 'ElementHandle.type', 'ElementHandle.uncheck']);
|
||||
173
node_modules/playwright-core/lib/protocol/serializers.js
generated
vendored
Normal file
173
node_modules/playwright-core/lib/protocol/serializers.js
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.parseSerializedValue = parseSerializedValue;
|
||||
exports.serializeValue = serializeValue;
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
function parseSerializedValue(value, handles) {
|
||||
return innerParseSerializedValue(value, handles, new Map());
|
||||
}
|
||||
function innerParseSerializedValue(value, handles, refs) {
|
||||
if (value.ref !== undefined) return refs.get(value.ref);
|
||||
if (value.n !== undefined) return value.n;
|
||||
if (value.s !== undefined) return value.s;
|
||||
if (value.b !== undefined) return value.b;
|
||||
if (value.v !== undefined) {
|
||||
if (value.v === 'undefined') return undefined;
|
||||
if (value.v === 'null') return null;
|
||||
if (value.v === 'NaN') return NaN;
|
||||
if (value.v === 'Infinity') return Infinity;
|
||||
if (value.v === '-Infinity') return -Infinity;
|
||||
if (value.v === '-0') return -0;
|
||||
}
|
||||
if (value.d !== undefined) return new Date(value.d);
|
||||
if (value.u !== undefined) return new URL(value.u);
|
||||
if (value.bi !== undefined) return BigInt(value.bi);
|
||||
if (value.e !== undefined) {
|
||||
const error = new Error(value.e.m);
|
||||
error.name = value.e.n;
|
||||
error.stack = value.e.s;
|
||||
return error;
|
||||
}
|
||||
if (value.r !== undefined) return new RegExp(value.r.p, value.r.f);
|
||||
if (value.a !== undefined) {
|
||||
const result = [];
|
||||
refs.set(value.id, result);
|
||||
for (const v of value.a) result.push(innerParseSerializedValue(v, handles, refs));
|
||||
return result;
|
||||
}
|
||||
if (value.o !== undefined) {
|
||||
const result = {};
|
||||
refs.set(value.id, result);
|
||||
for (const {
|
||||
k,
|
||||
v
|
||||
} of value.o) result[k] = innerParseSerializedValue(v, handles, refs);
|
||||
return result;
|
||||
}
|
||||
if (value.h !== undefined) {
|
||||
if (handles === undefined) throw new Error('Unexpected handle');
|
||||
return handles[value.h];
|
||||
}
|
||||
throw new Error('Unexpected value');
|
||||
}
|
||||
function serializeValue(value, handleSerializer) {
|
||||
return innerSerializeValue(value, handleSerializer, {
|
||||
lastId: 0,
|
||||
visited: new Map()
|
||||
});
|
||||
}
|
||||
function innerSerializeValue(value, handleSerializer, visitorInfo) {
|
||||
const handle = handleSerializer(value);
|
||||
if ('fallThrough' in handle) value = handle.fallThrough;else return handle;
|
||||
if (typeof value === 'symbol') return {
|
||||
v: 'undefined'
|
||||
};
|
||||
if (Object.is(value, undefined)) return {
|
||||
v: 'undefined'
|
||||
};
|
||||
if (Object.is(value, null)) return {
|
||||
v: 'null'
|
||||
};
|
||||
if (Object.is(value, NaN)) return {
|
||||
v: 'NaN'
|
||||
};
|
||||
if (Object.is(value, Infinity)) return {
|
||||
v: 'Infinity'
|
||||
};
|
||||
if (Object.is(value, -Infinity)) return {
|
||||
v: '-Infinity'
|
||||
};
|
||||
if (Object.is(value, -0)) return {
|
||||
v: '-0'
|
||||
};
|
||||
if (typeof value === 'boolean') return {
|
||||
b: value
|
||||
};
|
||||
if (typeof value === 'number') return {
|
||||
n: value
|
||||
};
|
||||
if (typeof value === 'string') return {
|
||||
s: value
|
||||
};
|
||||
if (typeof value === 'bigint') return {
|
||||
bi: value.toString()
|
||||
};
|
||||
if (isError(value)) return {
|
||||
e: {
|
||||
n: value.name,
|
||||
m: value.message,
|
||||
s: value.stack || ''
|
||||
}
|
||||
};
|
||||
if (isDate(value)) return {
|
||||
d: value.toJSON()
|
||||
};
|
||||
if (isURL(value)) return {
|
||||
u: value.toJSON()
|
||||
};
|
||||
if (isRegExp(value)) return {
|
||||
r: {
|
||||
p: value.source,
|
||||
f: value.flags
|
||||
}
|
||||
};
|
||||
const id = visitorInfo.visited.get(value);
|
||||
if (id) return {
|
||||
ref: id
|
||||
};
|
||||
if (Array.isArray(value)) {
|
||||
const a = [];
|
||||
const id = ++visitorInfo.lastId;
|
||||
visitorInfo.visited.set(value, id);
|
||||
for (let i = 0; i < value.length; ++i) a.push(innerSerializeValue(value[i], handleSerializer, visitorInfo));
|
||||
return {
|
||||
a,
|
||||
id
|
||||
};
|
||||
}
|
||||
if (typeof value === 'object') {
|
||||
const o = [];
|
||||
const id = ++visitorInfo.lastId;
|
||||
visitorInfo.visited.set(value, id);
|
||||
for (const name of Object.keys(value)) o.push({
|
||||
k: name,
|
||||
v: innerSerializeValue(value[name], handleSerializer, visitorInfo)
|
||||
});
|
||||
return {
|
||||
o,
|
||||
id
|
||||
};
|
||||
}
|
||||
throw new Error('Unexpected value');
|
||||
}
|
||||
function isRegExp(obj) {
|
||||
return obj instanceof RegExp || Object.prototype.toString.call(obj) === '[object RegExp]';
|
||||
}
|
||||
function isDate(obj) {
|
||||
return obj instanceof Date || Object.prototype.toString.call(obj) === '[object Date]';
|
||||
}
|
||||
function isURL(obj) {
|
||||
return obj instanceof URL || Object.prototype.toString.call(obj) === '[object URL]';
|
||||
}
|
||||
function isError(obj) {
|
||||
const proto = obj ? Object.getPrototypeOf(obj) : null;
|
||||
return obj instanceof Error || (proto === null || proto === void 0 ? void 0 : proto.name) === 'Error' || proto && isError(proto);
|
||||
}
|
||||
2825
node_modules/playwright-core/lib/protocol/validator.js
generated
vendored
Normal file
2825
node_modules/playwright-core/lib/protocol/validator.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
138
node_modules/playwright-core/lib/protocol/validatorPrimitives.js
generated
vendored
Normal file
138
node_modules/playwright-core/lib/protocol/validatorPrimitives.js
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ValidationError = void 0;
|
||||
exports.createMetadataValidator = createMetadataValidator;
|
||||
exports.findValidator = findValidator;
|
||||
exports.maybeFindValidator = maybeFindValidator;
|
||||
exports.tUndefined = exports.tType = exports.tString = exports.tOptional = exports.tObject = exports.tNumber = exports.tEnum = exports.tChannel = exports.tBoolean = exports.tBinary = exports.tArray = exports.tAny = exports.scheme = void 0;
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class ValidationError extends Error {}
|
||||
exports.ValidationError = ValidationError;
|
||||
const scheme = exports.scheme = {};
|
||||
function findValidator(type, method, kind) {
|
||||
const validator = maybeFindValidator(type, method, kind);
|
||||
if (!validator) throw new ValidationError(`Unknown scheme for ${kind}: ${type}.${method}`);
|
||||
return validator;
|
||||
}
|
||||
function maybeFindValidator(type, method, kind) {
|
||||
const schemeName = type + (kind === 'Initializer' ? '' : method[0].toUpperCase() + method.substring(1)) + kind;
|
||||
return scheme[schemeName];
|
||||
}
|
||||
function createMetadataValidator() {
|
||||
return tOptional(scheme['Metadata']);
|
||||
}
|
||||
const tNumber = (arg, path, context) => {
|
||||
if (arg instanceof Number) return arg.valueOf();
|
||||
if (typeof arg === 'number') return arg;
|
||||
throw new ValidationError(`${path}: expected number, got ${typeof arg}`);
|
||||
};
|
||||
exports.tNumber = tNumber;
|
||||
const tBoolean = (arg, path, context) => {
|
||||
if (arg instanceof Boolean) return arg.valueOf();
|
||||
if (typeof arg === 'boolean') return arg;
|
||||
throw new ValidationError(`${path}: expected boolean, got ${typeof arg}`);
|
||||
};
|
||||
exports.tBoolean = tBoolean;
|
||||
const tString = (arg, path, context) => {
|
||||
if (arg instanceof String) return arg.valueOf();
|
||||
if (typeof arg === 'string') return arg;
|
||||
throw new ValidationError(`${path}: expected string, got ${typeof arg}`);
|
||||
};
|
||||
exports.tString = tString;
|
||||
const tBinary = (arg, path, context) => {
|
||||
if (context.binary === 'fromBase64') {
|
||||
if (arg instanceof String) return Buffer.from(arg.valueOf(), 'base64');
|
||||
if (typeof arg === 'string') return Buffer.from(arg, 'base64');
|
||||
throw new ValidationError(`${path}: expected base64-encoded buffer, got ${typeof arg}`);
|
||||
}
|
||||
if (context.binary === 'toBase64') {
|
||||
if (!(arg instanceof Buffer)) throw new ValidationError(`${path}: expected Buffer, got ${typeof arg}`);
|
||||
return arg.toString('base64');
|
||||
}
|
||||
if (context.binary === 'buffer') {
|
||||
if (!(arg instanceof Buffer)) throw new ValidationError(`${path}: expected Buffer, got ${typeof arg}`);
|
||||
return arg;
|
||||
}
|
||||
throw new ValidationError(`Unsupported binary behavior "${context.binary}"`);
|
||||
};
|
||||
exports.tBinary = tBinary;
|
||||
const tUndefined = (arg, path, context) => {
|
||||
if (Object.is(arg, undefined)) return arg;
|
||||
throw new ValidationError(`${path}: expected undefined, got ${typeof arg}`);
|
||||
};
|
||||
exports.tUndefined = tUndefined;
|
||||
const tAny = (arg, path, context) => {
|
||||
return arg;
|
||||
};
|
||||
exports.tAny = tAny;
|
||||
const tOptional = v => {
|
||||
return (arg, path, context) => {
|
||||
if (Object.is(arg, undefined)) return arg;
|
||||
return v(arg, path, context);
|
||||
};
|
||||
};
|
||||
exports.tOptional = tOptional;
|
||||
const tArray = v => {
|
||||
return (arg, path, context) => {
|
||||
if (!Array.isArray(arg)) throw new ValidationError(`${path}: expected array, got ${typeof arg}`);
|
||||
return arg.map((x, index) => v(x, path + '[' + index + ']', context));
|
||||
};
|
||||
};
|
||||
exports.tArray = tArray;
|
||||
const tObject = s => {
|
||||
return (arg, path, context) => {
|
||||
if (Object.is(arg, null)) throw new ValidationError(`${path}: expected object, got null`);
|
||||
if (typeof arg !== 'object') throw new ValidationError(`${path}: expected object, got ${typeof arg}`);
|
||||
const result = {};
|
||||
for (const [key, v] of Object.entries(s)) {
|
||||
const value = v(arg[key], path ? path + '.' + key : key, context);
|
||||
if (!Object.is(value, undefined)) result[key] = value;
|
||||
}
|
||||
if (context.isUnderTest()) {
|
||||
for (const [key, value] of Object.entries(arg)) {
|
||||
if (key.startsWith('__testHook')) result[key] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
};
|
||||
exports.tObject = tObject;
|
||||
const tEnum = e => {
|
||||
return (arg, path, context) => {
|
||||
if (!e.includes(arg)) throw new ValidationError(`${path}: expected one of (${e.join('|')})`);
|
||||
return arg;
|
||||
};
|
||||
};
|
||||
exports.tEnum = tEnum;
|
||||
const tChannel = names => {
|
||||
return (arg, path, context) => {
|
||||
return context.tChannelImpl(names, arg, path, context);
|
||||
};
|
||||
};
|
||||
exports.tChannel = tChannel;
|
||||
const tType = name => {
|
||||
return (arg, path, context) => {
|
||||
const v = scheme[name];
|
||||
if (!v) throw new ValidationError(path + ': unknown type "' + name + '"');
|
||||
return v(arg, path, context);
|
||||
};
|
||||
};
|
||||
exports.tType = tType;
|
||||
Reference in New Issue
Block a user