chore: organize imports in playwright-core (#34680)
This commit is contained in:
parent
4bc8cf0d47
commit
4a7f6a6ef0
|
@ -20,6 +20,7 @@ import notice from 'eslint-plugin-notice';
|
|||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import stylistic from '@stylistic/eslint-plugin';
|
||||
import importRules from 'eslint-plugin-import';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
@ -28,6 +29,7 @@ const plugins = {
|
|||
'@stylistic': stylistic,
|
||||
'@typescript-eslint': typescriptEslint,
|
||||
notice,
|
||||
import: importRules,
|
||||
};
|
||||
|
||||
const ignores = [
|
||||
|
@ -57,7 +59,7 @@ const ignores = [
|
|||
|
||||
export const baseRules = {
|
||||
'@typescript-eslint/no-unused-vars': [2, { args: 'none', caughtErrors: 'none' }],
|
||||
'@typescript-eslint/consistent-type-imports': [2, { disallowTypeAnnotations: false }],
|
||||
|
||||
/**
|
||||
* Enforced rules
|
||||
*/
|
||||
|
@ -184,6 +186,19 @@ const noRestrictedGlobalsRules = {
|
|||
],
|
||||
};
|
||||
|
||||
const importOrderRules = {
|
||||
'import/order': [2, {
|
||||
'alphabetize': {
|
||||
'order': 'asc',
|
||||
'caseInsensitive': false
|
||||
},
|
||||
'named': true,
|
||||
'groups': ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index', 'type'],
|
||||
'newlines-between': 'always',
|
||||
}],
|
||||
'import/consistent-type-specifier-style': [2, 'prefer-top-level']
|
||||
};
|
||||
|
||||
const languageOptions = {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 9,
|
||||
|
@ -217,6 +232,11 @@ export default [{
|
|||
'message': 'Please use gracefullyProcessExitDoNotHang function to exit the process.',
|
||||
}],
|
||||
}
|
||||
}, {
|
||||
files: ['packages/playwright-core/**/*.ts'],
|
||||
rules: {
|
||||
...importOrderRules
|
||||
},
|
||||
}, {
|
||||
files: ['packages/playwright/**/*.ts'],
|
||||
rules: {
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
"electron": "^30.1.2",
|
||||
"esbuild": "^0.18.11",
|
||||
"eslint": "^9.19.0",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-notice": "^1.0.0",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
|
@ -1817,6 +1818,13 @@
|
|||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rtsao/scc": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
|
||||
"integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@sindresorhus/is": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
|
||||
|
@ -2019,6 +2027,13 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/json5": {
|
||||
"version": "0.0.29",
|
||||
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
|
||||
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/keyv": {
|
||||
"version": "3.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz",
|
||||
|
@ -2717,6 +2732,27 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/array.prototype.findlastindex": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz",
|
||||
"integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
"es-abstract": "^1.23.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.0.0",
|
||||
"es-shim-unscopables": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/array.prototype.flat": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz",
|
||||
|
@ -3536,6 +3572,19 @@
|
|||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/doctrine": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
|
||||
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "16.4.5",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
|
||||
|
@ -3920,6 +3969,145 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-node": {
|
||||
"version": "0.3.9",
|
||||
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
|
||||
"integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^3.2.7",
|
||||
"is-core-module": "^2.13.0",
|
||||
"resolve": "^1.22.4"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-node/node_modules/debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-node/node_modules/resolve": {
|
||||
"version": "1.22.10",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz",
|
||||
"integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-core-module": "^2.16.0",
|
||||
"path-parse": "^1.0.7",
|
||||
"supports-preserve-symlinks-flag": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"resolve": "bin/resolve"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-module-utils": {
|
||||
"version": "2.12.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz",
|
||||
"integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^3.2.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"eslint": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-module-utils/node_modules/debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import": {
|
||||
"version": "2.31.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz",
|
||||
"integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@rtsao/scc": "^1.1.0",
|
||||
"array-includes": "^3.1.8",
|
||||
"array.prototype.findlastindex": "^1.2.5",
|
||||
"array.prototype.flat": "^1.3.2",
|
||||
"array.prototype.flatmap": "^1.3.2",
|
||||
"debug": "^3.2.7",
|
||||
"doctrine": "^2.1.0",
|
||||
"eslint-import-resolver-node": "^0.3.9",
|
||||
"eslint-module-utils": "^2.12.0",
|
||||
"hasown": "^2.0.2",
|
||||
"is-core-module": "^2.15.1",
|
||||
"is-glob": "^4.0.3",
|
||||
"minimatch": "^3.1.2",
|
||||
"object.fromentries": "^2.0.8",
|
||||
"object.groupby": "^1.0.3",
|
||||
"object.values": "^1.2.0",
|
||||
"semver": "^6.3.1",
|
||||
"string.prototype.trimend": "^1.0.8",
|
||||
"tsconfig-paths": "^3.15.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import/node_modules/debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-notice": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-notice/-/eslint-plugin-notice-1.0.0.tgz",
|
||||
|
@ -3991,18 +4179,6 @@
|
|||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react/node_modules/doctrine": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
|
||||
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
|
@ -5105,12 +5281,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.13.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
|
||||
"integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
|
||||
"version": "2.16.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
|
||||
"integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"hasown": "^2.0.0"
|
||||
"hasown": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
|
@ -6104,6 +6284,21 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/object.groupby": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz",
|
||||
"integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1",
|
||||
"es-abstract": "^1.23.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/object.values": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz",
|
||||
|
@ -7287,6 +7482,16 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-bom": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
||||
"integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-json-comments": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
|
||||
|
@ -7424,6 +7629,32 @@
|
|||
"typescript": ">=4.8.4"
|
||||
}
|
||||
},
|
||||
"node_modules/tsconfig-paths": {
|
||||
"version": "3.15.0",
|
||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz",
|
||||
"integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/json5": "^0.0.29",
|
||||
"json5": "^1.0.2",
|
||||
"minimist": "^1.2.6",
|
||||
"strip-bom": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tsconfig-paths/node_modules/json5": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"json5": "lib/cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
"electron": "^30.1.2",
|
||||
"esbuild": "^0.18.11",
|
||||
"eslint": "^9.19.0",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-notice": "^1.0.0",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.1.0",
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/order */
|
||||
|
||||
import colorsLibrary from 'colors/safe';
|
||||
export const colors = colorsLibrary;
|
||||
|
||||
|
|
|
@ -14,13 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { LaunchAndroidServerOptions } from './client/types';
|
||||
import { ws } from './utilsBundle';
|
||||
import type { WebSocketEventEmitter } from './utilsBundle';
|
||||
import type { BrowserServer } from './client/browserType';
|
||||
import { createGuid } from './utils';
|
||||
import { createPlaywright } from './server/playwright';
|
||||
import { PlaywrightServer } from './remote/playwrightServer';
|
||||
import { createPlaywright } from './server/playwright';
|
||||
import { createGuid } from './utils';
|
||||
import { ws } from './utilsBundle';
|
||||
|
||||
import type { BrowserServer } from './client/browserType';
|
||||
import type { LaunchAndroidServerOptions } from './client/types';
|
||||
import type { WebSocketEventEmitter } from './utilsBundle';
|
||||
|
||||
export class AndroidServerLauncherImpl {
|
||||
async launchServer(options: LaunchAndroidServerOptions = {}): Promise<BrowserServer> {
|
||||
|
|
|
@ -14,19 +14,20 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { LaunchServerOptions, Logger } from './client/types';
|
||||
import { ws } from './utilsBundle';
|
||||
import type { WebSocketEventEmitter } from './utilsBundle';
|
||||
import type { BrowserServerLauncher, BrowserServer } from './client/browserType';
|
||||
import { envObjectToArray } from './client/clientHelper';
|
||||
import { createGuid } from './utils';
|
||||
import type { ProtocolLogger } from './server/types';
|
||||
import { serverSideCallMetadata } from './server/instrumentation';
|
||||
import { createPlaywright } from './server/playwright';
|
||||
import { SocksProxy } from './common/socksProxy';
|
||||
import { PlaywrightServer } from './remote/playwrightServer';
|
||||
import { helper } from './server/helper';
|
||||
import { serverSideCallMetadata } from './server/instrumentation';
|
||||
import { createPlaywright } from './server/playwright';
|
||||
import { createGuid } from './utils';
|
||||
import { rewriteErrorMessage } from './utils/stackTrace';
|
||||
import { SocksProxy } from './common/socksProxy';
|
||||
import { ws } from './utilsBundle';
|
||||
|
||||
import type { BrowserServer, BrowserServerLauncher } from './client/browserType';
|
||||
import type { LaunchServerOptions, Logger } from './client/types';
|
||||
import type { ProtocolLogger } from './server/types';
|
||||
import type { WebSocketEventEmitter } from './utilsBundle';
|
||||
|
||||
export class BrowserServerLauncherImpl implements BrowserServerLauncher {
|
||||
private _browserName: 'chromium' | 'firefox' | 'webkit' | 'bidiFirefox' | 'bidiChromium';
|
||||
|
|
|
@ -16,15 +16,17 @@
|
|||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import fs from 'fs';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import * as playwright from '../..';
|
||||
import type { BrowserType } from '../client/browserType';
|
||||
import type { LaunchServerOptions } from '../client/types';
|
||||
import { createPlaywright, DispatcherConnection, RootDispatcher, PlaywrightDispatcher } from '../server';
|
||||
import { PipeTransport } from '../protocol/transport';
|
||||
import { PlaywrightServer } from '../remote/playwrightServer';
|
||||
import { DispatcherConnection, PlaywrightDispatcher, RootDispatcher, createPlaywright } from '../server';
|
||||
import { gracefullyProcessExitDoNotHang } from '../utils/processLauncher';
|
||||
|
||||
import type { BrowserType } from '../client/browserType';
|
||||
import type { LaunchServerOptions } from '../client/types';
|
||||
|
||||
export function printApiJson() {
|
||||
// Note: this file is generated by build-playwright-driver.sh
|
||||
console.log(JSON.stringify(require('../../api.json')));
|
||||
|
|
|
@ -16,25 +16,28 @@
|
|||
|
||||
/* eslint-disable no-console */
|
||||
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import type { Command } from '../utilsBundle';
|
||||
import { program, dotenv } from '../utilsBundle';
|
||||
export { program } from '../utilsBundle';
|
||||
import { runDriver, runServer, printApiJson, launchBrowserServer } from './driver';
|
||||
import { runTraceInBrowser, runTraceViewerApp } from '../server/trace/viewer/traceViewer';
|
||||
import type { TraceViewerServerOptions } from '../server/trace/viewer/traceViewer';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
import * as playwright from '../..';
|
||||
import type { BrowserContext } from '../client/browserContext';
|
||||
import type { Browser } from '../client/browser';
|
||||
import type { Page } from '../client/page';
|
||||
import type { BrowserType } from '../client/browserType';
|
||||
import type { BrowserContextOptions, LaunchOptions } from '../client/types';
|
||||
import { wrapInASCIIBox, isLikelyNpxGlobal, assert, gracefullyProcessExitDoNotHang, getPackageManagerExecCommand } from '../utils';
|
||||
import type { Executable } from '../server';
|
||||
import { registry, writeDockerVersion } from '../server';
|
||||
import { launchBrowserServer, printApiJson, runDriver, runServer } from './driver';
|
||||
import { isTargetClosedError } from '../client/errors';
|
||||
import { runTraceInBrowser, runTraceViewerApp } from '../server/trace/viewer/traceViewer';
|
||||
import { assert, getPackageManagerExecCommand, gracefullyProcessExitDoNotHang, isLikelyNpxGlobal, wrapInASCIIBox } from '../utils';
|
||||
import { dotenv, program } from '../utilsBundle';
|
||||
|
||||
import type { Browser } from '../client/browser';
|
||||
import type { BrowserContext } from '../client/browserContext';
|
||||
import type { BrowserType } from '../client/browserType';
|
||||
import type { Page } from '../client/page';
|
||||
import type { BrowserContextOptions, LaunchOptions } from '../client/types';
|
||||
import type { Executable } from '../server';
|
||||
import type { TraceViewerServerOptions } from '../server/trace/viewer/traceViewer';
|
||||
import type { Command } from '../utilsBundle';
|
||||
|
||||
export { program } from '../utilsBundle';
|
||||
|
||||
const packageJSON = require('../../package.json');
|
||||
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { ElementHandle } from './elementHandle';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
type SerializedAXNode = Omit<channels.AXNode, 'valueString' | 'valueNumber' | 'children' | 'checked' | 'pressed'> & {
|
||||
value?: string|number,
|
||||
|
|
|
@ -14,22 +14,24 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import { isString, isRegExp, monotonicTime } from '../utils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { Events } from './events';
|
||||
import { EventEmitter } from 'events';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { isRegExp, isString, monotonicTime } from '../utils';
|
||||
import { BrowserContext, prepareBrowserContextParams } from './browserContext';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as types from './types';
|
||||
import type { Page } from './page';
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
import { Waiter } from './waiter';
|
||||
import { EventEmitter } from 'events';
|
||||
import { Connection } from './connection';
|
||||
import { isTargetClosedError, TargetClosedError } from './errors';
|
||||
import { TargetClosedError, isTargetClosedError } from './errors';
|
||||
import { Events } from './events';
|
||||
import { Waiter } from './waiter';
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
import { raceAgainstDeadline } from '../utils/timeoutRunner';
|
||||
|
||||
import type { Page } from './page';
|
||||
import type * as types from './types';
|
||||
import type * as api from '../../types/types';
|
||||
import type { AndroidServerLauncherImpl } from '../androidServerImpl';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
type Direction = 'down' | 'up' | 'left' | 'right';
|
||||
type SpeedOptions = { speed?: number };
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
export { Accessibility } from './accessibility';
|
||||
export { Android, AndroidDevice, AndroidWebView, AndroidInput, AndroidSocket } from './android';
|
||||
export { Android, AndroidDevice, AndroidInput, AndroidSocket, AndroidWebView } from './android';
|
||||
export { Browser } from './browser';
|
||||
export { BrowserContext } from './browserContext';
|
||||
export type { BrowserServer } from './browserType';
|
||||
|
@ -26,7 +26,7 @@ export { Coverage } from './coverage';
|
|||
export { Dialog } from './dialog';
|
||||
export { Download } from './download';
|
||||
export { Electron, ElectronApplication } from './electron';
|
||||
export { Locator, FrameLocator } from './locator';
|
||||
export { FrameLocator, Locator } from './locator';
|
||||
export { ElementHandle } from './elementHandle';
|
||||
export { FileChooser } from './fileChooser';
|
||||
export type { Logger } from './types';
|
||||
|
|
|
@ -14,11 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { Stream } from './stream';
|
||||
import { mkdirIfNeeded } from '../utils/fileUtils';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { Readable } from 'stream';
|
||||
|
||||
export class Artifact extends ChannelOwner<channels.ArtifactChannel> {
|
||||
|
|
|
@ -14,20 +14,22 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { BrowserContext, prepareBrowserContextParams } from './browserContext';
|
||||
import type { Page } from './page';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { Events } from './events';
|
||||
import type { LaunchOptions, BrowserContextOptions, HeadersArray } from './types';
|
||||
import { isTargetClosedError } from './errors';
|
||||
import type * as api from '../../types/types';
|
||||
import { CDPSession } from './cdpSession';
|
||||
import type { BrowserType } from './browserType';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { Artifact } from './artifact';
|
||||
import { BrowserContext, prepareBrowserContextParams } from './browserContext';
|
||||
import { CDPSession } from './cdpSession';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { isTargetClosedError } from './errors';
|
||||
import { Events } from './events';
|
||||
import { mkdirIfNeeded } from '../utils';
|
||||
|
||||
import type { BrowserType } from './browserType';
|
||||
import type { Page } from './page';
|
||||
import type { BrowserContextOptions, HeadersArray, LaunchOptions } from './types';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class Browser extends ChannelOwner<channels.BrowserChannel> implements api.Browser {
|
||||
readonly _contexts = new Set<BrowserContext>();
|
||||
private _isConnected = true;
|
||||
|
|
|
@ -15,35 +15,38 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Page, BindingCall } from './page';
|
||||
import { Frame } from './frame';
|
||||
import * as network from './network';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { Artifact } from './artifact';
|
||||
import { Browser } from './browser';
|
||||
import { CDPSession } from './cdpSession';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { evaluationScript } from './clientHelper';
|
||||
import { Browser } from './browser';
|
||||
import { Worker } from './worker';
|
||||
import { Events } from './events';
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
import { Waiter } from './waiter';
|
||||
import type { Headers, WaitForEventOptions, BrowserContextOptions, LaunchOptions, StorageState } from './types';
|
||||
import { type URLMatch, headersObjectToArray, isRegExp, isString, urlMatchesEqual, mkdirIfNeeded } from '../utils';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import { CDPSession } from './cdpSession';
|
||||
import { Tracing } from './tracing';
|
||||
import type { BrowserType } from './browserType';
|
||||
import { Artifact } from './artifact';
|
||||
import { APIRequestContext } from './fetch';
|
||||
import { rewriteErrorMessage } from '../utils/stackTrace';
|
||||
import { HarRouter } from './harRouter';
|
||||
import { Clock } from './clock';
|
||||
import { ConsoleMessage } from './consoleMessage';
|
||||
import { Dialog } from './dialog';
|
||||
import { WebError } from './webError';
|
||||
import { TargetClosedError, parseError } from './errors';
|
||||
import { Clock } from './clock';
|
||||
import { Events } from './events';
|
||||
import { APIRequestContext } from './fetch';
|
||||
import { Frame } from './frame';
|
||||
import { HarRouter } from './harRouter';
|
||||
import * as network from './network';
|
||||
import { BindingCall, Page } from './page';
|
||||
import { Tracing } from './tracing';
|
||||
import { Waiter } from './waiter';
|
||||
import { WebError } from './webError';
|
||||
import { Worker } from './worker';
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
import { headersObjectToArray, isRegExp, isString, mkdirIfNeeded, urlMatchesEqual } from '../utils';
|
||||
import { rewriteErrorMessage } from '../utils/stackTrace';
|
||||
|
||||
import type { BrowserType } from './browserType';
|
||||
import type { BrowserContextOptions, Headers, LaunchOptions, StorageState, WaitForEventOptions } from './types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type { URLMatch } from '../utils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel> implements api.BrowserContext {
|
||||
_pages = new Set<Page>();
|
||||
|
|
|
@ -14,19 +14,20 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { Browser } from './browser';
|
||||
import { BrowserContext, prepareBrowserContextParams } from './browserContext';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import type { LaunchOptions, LaunchServerOptions, ConnectOptions, LaunchPersistentContextOptions, Logger } from './types';
|
||||
import { envObjectToArray } from './clientHelper';
|
||||
import { Connection } from './connection';
|
||||
import { Events } from './events';
|
||||
import type { ChildProcess } from 'child_process';
|
||||
import { envObjectToArray } from './clientHelper';
|
||||
import { assert, headersObjectToArray, monotonicTime } from '../utils';
|
||||
import type * as api from '../../types/types';
|
||||
import { raceAgainstDeadline } from '../utils/timeoutRunner';
|
||||
|
||||
import type { Playwright } from './playwright';
|
||||
import type { ConnectOptions, LaunchOptions, LaunchPersistentContextOptions, LaunchServerOptions, Logger } from './types';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { ChildProcess } from 'child_process';
|
||||
|
||||
export interface BrowserServerLauncher {
|
||||
launchServer(options?: LaunchServerOptions): Promise<api.BrowserServer>;
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import type { Protocol } from '../server/chromium/protocol';
|
||||
|
||||
import type * as api from '../../types/types';
|
||||
import type { Protocol } from '../server/chromium/protocol';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class CDPSession extends ChannelOwner<channels.CDPSessionChannel> implements api.CDPSession {
|
||||
static from(cdpSession: channels.CDPSessionChannel): CDPSession {
|
||||
|
|
|
@ -15,15 +15,17 @@
|
|||
*/
|
||||
|
||||
import { EventEmitter } from './eventEmitter';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { maybeFindValidator, ValidationError, type ValidatorContext } from '../protocol/validator';
|
||||
import { ValidationError, maybeFindValidator } from '../protocol/validator';
|
||||
import { isUnderTest } from '../utils';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
import { captureLibraryStackTrace, stringifyStackFrames } from '../utils/stackTrace';
|
||||
import { isUnderTest } from '../utils';
|
||||
import { zones } from '../utils/zones';
|
||||
|
||||
import type { ClientInstrumentation } from './clientInstrumentation';
|
||||
import type { Connection } from './connection';
|
||||
import type { Logger } from './types';
|
||||
import type { ValidatorContext } from '../protocol/validator';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
type Listener = (...args: any[]) => void;
|
||||
|
||||
|
|
|
@ -15,10 +15,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as types from './types';
|
||||
import fs from 'fs';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { isString } from '../utils';
|
||||
|
||||
import type * as types from './types';
|
||||
|
||||
export function envObjectToArray(env: types.Env): { name: string, value: string }[] {
|
||||
const result: { name: string, value: string }[] = [];
|
||||
for (const name in env) {
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { StackFrame } from '@protocol/channels';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type { APIRequestContext } from './fetch';
|
||||
import type { StackFrame } from '@protocol/channels';
|
||||
|
||||
// Instrumentation can mutate the data, for example change apiName or stepId.
|
||||
export interface ApiCallData {
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as api from '../../types/types';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type * as api from '../../types/types';
|
||||
|
||||
export class Clock implements api.Clock {
|
||||
private _browserContext: BrowserContext;
|
||||
|
|
|
@ -14,37 +14,40 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
import { Android, AndroidDevice, AndroidSocket } from './android';
|
||||
import { Artifact } from './artifact';
|
||||
import { Browser } from './browser';
|
||||
import { BrowserContext } from './browserContext';
|
||||
import { BrowserType } from './browserType';
|
||||
import { CDPSession } from './cdpSession';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { createInstrumentation } from './clientInstrumentation';
|
||||
import { Dialog } from './dialog';
|
||||
import { Electron, ElectronApplication } from './electron';
|
||||
import { ElementHandle } from './elementHandle';
|
||||
import { TargetClosedError, parseError } from './errors';
|
||||
import { APIRequestContext } from './fetch';
|
||||
import { Frame } from './frame';
|
||||
import { JSHandle } from './jsHandle';
|
||||
import { Request, Response, Route, WebSocket, WebSocketRoute } from './network';
|
||||
import { Page, BindingCall } from './page';
|
||||
import { Worker } from './worker';
|
||||
import { Dialog } from './dialog';
|
||||
import { parseError, TargetClosedError } from './errors';
|
||||
import { CDPSession } from './cdpSession';
|
||||
import { Playwright } from './playwright';
|
||||
import { Electron, ElectronApplication } from './electron';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { Stream } from './stream';
|
||||
import { WritableStream } from './writableStream';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
import { SelectorsOwner } from './selectors';
|
||||
import { Android, AndroidSocket, AndroidDevice } from './android';
|
||||
import { Artifact } from './artifact';
|
||||
import { EventEmitter } from 'events';
|
||||
import { JsonPipe } from './jsonPipe';
|
||||
import { APIRequestContext } from './fetch';
|
||||
import { LocalUtils } from './localUtils';
|
||||
import { Request, Response, Route, WebSocket, WebSocketRoute } from './network';
|
||||
import { BindingCall, Page } from './page';
|
||||
import { Playwright } from './playwright';
|
||||
import { SelectorsOwner } from './selectors';
|
||||
import { Stream } from './stream';
|
||||
import { Tracing } from './tracing';
|
||||
import { findValidator, ValidationError, type ValidatorContext } from '../protocol/validator';
|
||||
import { createInstrumentation } from './clientInstrumentation';
|
||||
import type { ClientInstrumentation } from './clientInstrumentation';
|
||||
import { Worker } from './worker';
|
||||
import { WritableStream } from './writableStream';
|
||||
import { ValidationError, findValidator } from '../protocol/validator';
|
||||
import { formatCallLog, rewriteErrorMessage, zones } from '../utils';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
|
||||
import type { ClientInstrumentation } from './clientInstrumentation';
|
||||
import type { ValidatorContext } from '../protocol/validator';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
class Root extends ChannelOwner<channels.RootChannel> {
|
||||
constructor(connection: Connection) {
|
||||
|
|
|
@ -15,11 +15,13 @@
|
|||
*/
|
||||
|
||||
import * as util from 'util';
|
||||
|
||||
import { JSHandle } from './jsHandle';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type * as api from '../../types/types';
|
||||
import { Page } from './page';
|
||||
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
type ConsoleMessageLocation = channels.BrowserContextConsoleEvent['location'];
|
||||
|
||||
export class ConsoleMessage implements api.ConsoleMessage {
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class Coverage implements api.Coverage {
|
||||
private _channel: channels.PageChannel;
|
||||
|
|
|
@ -14,11 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import type * as api from '../../types/types';
|
||||
import { Page } from './page';
|
||||
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export class Dialog extends ChannelOwner<channels.DialogChannel> implements api.Dialog {
|
||||
static from(dialog: channels.DialogChannel): Dialog {
|
||||
return (dialog as any)._object;
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { Readable } from 'stream';
|
||||
import type * as api from '../../types/types';
|
||||
import type { Artifact } from './artifact';
|
||||
import type { Page } from './page';
|
||||
import type * as api from '../../types/types';
|
||||
import type { Readable } from 'stream';
|
||||
|
||||
export class Download implements api.Download {
|
||||
private _page: Page;
|
||||
|
|
|
@ -14,22 +14,23 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BrowserWindow } from 'electron';
|
||||
import type * as childProcess from 'child_process';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
import { BrowserContext, prepareBrowserContextParams } from './browserContext';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { envObjectToArray } from './clientHelper';
|
||||
import { ConsoleMessage } from './consoleMessage';
|
||||
import { TargetClosedError, isTargetClosedError } from './errors';
|
||||
import { Events } from './events';
|
||||
import { JSHandle, parseResult, serializeArgument } from './jsHandle';
|
||||
import type { Page } from './page';
|
||||
import { ConsoleMessage } from './consoleMessage';
|
||||
import type { Env, WaitForEventOptions, Headers, BrowserContextOptions } from './types';
|
||||
import { Waiter } from './waiter';
|
||||
import { TargetClosedError, isTargetClosedError } from './errors';
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
|
||||
import type { Page } from './page';
|
||||
import type { BrowserContextOptions, Env, Headers, WaitForEventOptions } from './types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type * as childProcess from 'child_process';
|
||||
import type { BrowserWindow } from 'electron';
|
||||
|
||||
type ElectronOptions = Omit<channels.ElectronLaunchOptions, 'env'|'extraHTTPHeaders'|'recordHar'|'colorScheme'|'acceptDownloads'> & {
|
||||
env?: Env,
|
||||
|
|
|
@ -14,24 +14,26 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { Frame } from './frame';
|
||||
import type { Locator } from './locator';
|
||||
import { JSHandle, serializeArgument, parseResult } from './jsHandle';
|
||||
import type { ChannelOwner } from './channelOwner';
|
||||
import type { SelectOption, FilePayload, Rect, SelectOptionOptions } from './types';
|
||||
import fs from 'fs';
|
||||
import { mime } from '../utilsBundle';
|
||||
import path from 'path';
|
||||
import { assert, isString } from '../utils';
|
||||
import { fileUploadSizeLimit, mkdirIfNeeded } from '../utils/fileUtils';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import { WritableStream } from './writableStream';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { pipeline } from 'stream';
|
||||
import { promisify } from 'util';
|
||||
|
||||
import { Frame } from './frame';
|
||||
import { JSHandle, parseResult, serializeArgument } from './jsHandle';
|
||||
import { assert, isString } from '../utils';
|
||||
import { fileUploadSizeLimit, mkdirIfNeeded } from '../utils/fileUtils';
|
||||
import { mime } from '../utilsBundle';
|
||||
import { WritableStream } from './writableStream';
|
||||
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type { ChannelOwner } from './channelOwner';
|
||||
import type { Locator } from './locator';
|
||||
import type { FilePayload, Rect, SelectOption, SelectOptionOptions } from './types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
const pipelineAsync = promisify(pipeline);
|
||||
|
||||
export class ElementHandle<T extends Node = Node> extends JSHandle<T> implements api.ElementHandle {
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { SerializedError } from '@protocol/channels';
|
||||
import { isError } from '../utils';
|
||||
import { parseSerializedValue, serializeValue } from '../protocol/serializers';
|
||||
import { isError } from '../utils';
|
||||
|
||||
import type { SerializedError } from '@protocol/channels';
|
||||
|
||||
export class TimeoutError extends Error {
|
||||
constructor(message: string) {
|
||||
|
|
|
@ -22,12 +22,15 @@
|
|||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { EventEmitter as OriginalEventEmitter } from 'events';
|
||||
|
||||
import { isUnderTest } from '../utils';
|
||||
|
||||
import type { EventEmitter as EventEmitterType } from 'events';
|
||||
|
||||
type EventType = string | symbol;
|
||||
type Listener = (...args: any[]) => any;
|
||||
type EventMap = Record<EventType, Listener | Listener[]>;
|
||||
import { EventEmitter as OriginalEventEmitter } from 'events';
|
||||
import type { EventEmitter as EventEmitterType } from 'events';
|
||||
import { isUnderTest } from '../utils';
|
||||
|
||||
export class EventEmitter implements EventEmitterType {
|
||||
|
||||
|
|
|
@ -14,22 +14,24 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
|
||||
import { assert, headersObjectToArray, isString } from '../utils';
|
||||
import { toClientCertificatesProtocol } from './browserContext';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { TargetClosedError, isTargetClosedError } from './errors';
|
||||
import { RawHeaders } from './network';
|
||||
import { Tracing } from './tracing';
|
||||
import { mkdirIfNeeded } from '../utils/fileUtils';
|
||||
|
||||
import type { Playwright } from './playwright';
|
||||
import type { ClientCertificate, FilePayload, Headers, SetStorageState, StorageState } from './types';
|
||||
import type { Serializable } from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type { HeadersArray, NameValue } from '../common/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { assert, headersObjectToArray, isString } from '../utils';
|
||||
import { mkdirIfNeeded } from '../utils/fileUtils';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { RawHeaders } from './network';
|
||||
import type { ClientCertificate, FilePayload, Headers, SetStorageState, StorageState } from './types';
|
||||
import type { Playwright } from './playwright';
|
||||
import { Tracing } from './tracing';
|
||||
import { TargetClosedError, isTargetClosedError } from './errors';
|
||||
import { toClientCertificatesProtocol } from './browserContext';
|
||||
|
||||
export type FetchOptions = {
|
||||
params?: { [key: string]: string | number | boolean; } | URLSearchParams | string,
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
import type { ElementHandle } from './elementHandle';
|
||||
import type { Page } from './page';
|
||||
import type { FilePayload } from './types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class FileChooser implements api.FileChooser {
|
||||
private _page: Page;
|
||||
|
|
|
@ -15,27 +15,30 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { assert } from '../utils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { EventEmitter } from 'events';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { FrameLocator, Locator, testIdAttributeName } from './locator';
|
||||
import type { LocatorOptions } from './locator';
|
||||
import { getByAltTextSelector, getByLabelSelector, getByPlaceholderSelector, getByRoleSelector, getByTestIdSelector, getByTextSelector, getByTitleSelector } from '../utils/isomorphic/locatorUtils';
|
||||
import type { ByRoleOptions } from '../utils/isomorphic/locatorUtils';
|
||||
import { ElementHandle, convertSelectOptionValues, convertInputFiles } from './elementHandle';
|
||||
import { assertMaxArguments, JSHandle, serializeArgument, parseResult } from './jsHandle';
|
||||
import fs from 'fs';
|
||||
import * as network from './network';
|
||||
import type { Page } from './page';
|
||||
import { EventEmitter } from 'events';
|
||||
import { Waiter } from './waiter';
|
||||
import { Events } from './events';
|
||||
import type { LifecycleEvent, SelectOption, SelectOptionOptions, FilePayload, WaitForFunctionOptions, StrictOptions } from './types';
|
||||
import { kLifecycleEvents } from './types';
|
||||
import { type URLMatch, urlMatches } from '../utils';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import { assert } from '../utils';
|
||||
import { urlMatches } from '../utils';
|
||||
import { addSourceUrlToScript } from './clientHelper';
|
||||
import { ElementHandle, convertInputFiles, convertSelectOptionValues } from './elementHandle';
|
||||
import { Events } from './events';
|
||||
import { JSHandle, assertMaxArguments, parseResult, serializeArgument } from './jsHandle';
|
||||
import * as network from './network';
|
||||
import { kLifecycleEvents } from './types';
|
||||
import { Waiter } from './waiter';
|
||||
import { getByAltTextSelector, getByLabelSelector, getByPlaceholderSelector, getByRoleSelector, getByTestIdSelector, getByTextSelector, getByTitleSelector } from '../utils/isomorphic/locatorUtils';
|
||||
|
||||
import type { LocatorOptions } from './locator';
|
||||
import type { Page } from './page';
|
||||
import type { FilePayload, LifecycleEvent, SelectOption, SelectOptionOptions, StrictOptions, WaitForFunctionOptions } from './types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type { URLMatch } from '../utils';
|
||||
import type { ByRoleOptions } from '../utils/isomorphic/locatorUtils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export type WaitForNavigationOptions = {
|
||||
timeout?: number,
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type { LocalUtils } from './localUtils';
|
||||
import type { Route } from './network';
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type * as api from '../../types/types';
|
||||
import type { Page } from './page';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class Keyboard implements api.Keyboard {
|
||||
private _page: Page;
|
||||
|
|
|
@ -14,12 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { parseSerializedValue, serializeValue } from '../protocol/serializers';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import { isTargetClosedError } from './errors';
|
||||
import { parseSerializedValue, serializeValue } from '../protocol/serializers';
|
||||
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export class JSHandle<T = any> extends ChannelOwner<channels.JSHandleChannel> implements api.JSHandle {
|
||||
private _preview: string;
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class JsonPipe extends ChannelOwner<channels.JsonPipeChannel> {
|
||||
static from(jsonPipe: channels.JsonPipeChannel): JsonPipe {
|
||||
return (jsonPipe as any)._object;
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
|
||||
import type { Size } from './types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
type DeviceDescriptor = {
|
||||
userAgent: string,
|
||||
|
|
|
@ -14,18 +14,21 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import * as util from 'util';
|
||||
|
||||
import { asLocator, isString, monotonicTime } from '../utils';
|
||||
import { ElementHandle } from './elementHandle';
|
||||
import { parseResult, serializeArgument } from './jsHandle';
|
||||
import { getByAltTextSelector, getByLabelSelector, getByPlaceholderSelector, getByRoleSelector, getByTestIdSelector, getByTextSelector, getByTitleSelector } from '../utils/isomorphic/locatorUtils';
|
||||
import { escapeForTextSelector } from '../utils/isomorphic/stringUtils';
|
||||
|
||||
import type { Frame } from './frame';
|
||||
import type { FilePayload, FrameExpectParams, Rect, SelectOption, SelectOptionOptions, TimeoutOptions } from './types';
|
||||
import { parseResult, serializeArgument } from './jsHandle';
|
||||
import { escapeForTextSelector } from '../utils/isomorphic/stringUtils';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type { ByRoleOptions } from '../utils/isomorphic/locatorUtils';
|
||||
import { getByAltTextSelector, getByLabelSelector, getByPlaceholderSelector, getByRoleSelector, getByTestIdSelector, getByTextSelector, getByTitleSelector } from '../utils/isomorphic/locatorUtils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export type LocatorOptions = {
|
||||
hasText?: string | RegExp;
|
||||
|
|
|
@ -14,26 +14,28 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import { URLSearchParams } from 'url';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { isTargetClosedError } from './errors';
|
||||
import { Events } from './events';
|
||||
import { APIResponse } from './fetch';
|
||||
import { Frame } from './frame';
|
||||
import { Worker } from './worker';
|
||||
import type { Headers, RemoteAddr, SecurityDetails, WaitForEventOptions } from './types';
|
||||
import fs from 'fs';
|
||||
import { mime } from '../utilsBundle';
|
||||
import { assert, isString, headersObjectToArray, isRegExp, rewriteErrorMessage, MultiMap, urlMatches, zones } from '../utils';
|
||||
import type { URLMatch, Zone } from '../utils';
|
||||
import { ManualPromise, LongStandingScope } from '../utils/manualPromise';
|
||||
import { Events } from './events';
|
||||
import type { Page } from './page';
|
||||
import { MultiMap, assert, headersObjectToArray, isRegExp, isString, rewriteErrorMessage, urlMatches, zones } from '../utils';
|
||||
import { Waiter } from './waiter';
|
||||
import { LongStandingScope, ManualPromise } from '../utils/manualPromise';
|
||||
import { mime } from '../utilsBundle';
|
||||
|
||||
import type { Headers, RemoteAddr, SecurityDetails, WaitForEventOptions } from './types';
|
||||
import type { URLMatch, Zone } from '../utils';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type { Page } from './page';
|
||||
import type { Serializable } from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type { HeadersArray } from '../common/types';
|
||||
import { APIResponse } from './fetch';
|
||||
import type { Serializable } from '../../types/structs';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import { isTargetClosedError } from './errors';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export type NetworkCookie = {
|
||||
name: string,
|
||||
|
|
|
@ -15,38 +15,42 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import { serializeError, isTargetClosedError, TargetClosedError } from './errors';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { TargetClosedError, isTargetClosedError, serializeError } from './errors';
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { assert, headersObjectToArray, isObject, isRegExp, isString, LongStandingScope, urlMatches, urlMatchesEqual, mkdirIfNeeded, trimStringWithEllipsis, type URLMatch } from '../utils';
|
||||
import { LongStandingScope, assert, headersObjectToArray, isObject, isRegExp, isString, mkdirIfNeeded, trimStringWithEllipsis, urlMatches, urlMatchesEqual } from '../utils';
|
||||
import { Accessibility } from './accessibility';
|
||||
import { Artifact } from './artifact';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { evaluationScript } from './clientHelper';
|
||||
import { Coverage } from './coverage';
|
||||
import { Download } from './download';
|
||||
import { determineScreenshotType, ElementHandle } from './elementHandle';
|
||||
import { ElementHandle, determineScreenshotType } from './elementHandle';
|
||||
import { Events } from './events';
|
||||
import type { APIRequestContext } from './fetch';
|
||||
import { FileChooser } from './fileChooser';
|
||||
import type { WaitForNavigationOptions } from './frame';
|
||||
import { Frame, verifyLoadState } from './frame';
|
||||
import { HarRouter } from './harRouter';
|
||||
import { Keyboard, Mouse, Touchscreen } from './input';
|
||||
import { assertMaxArguments, JSHandle, parseResult, serializeArgument } from './jsHandle';
|
||||
import type { FrameLocator, Locator, LocatorOptions } from './locator';
|
||||
import type { ByRoleOptions } from '../utils/isomorphic/locatorUtils';
|
||||
import { type RouteHandlerCallback, type Request, Response, Route, RouteHandler, validateHeaders, WebSocket, type WebSocketRouteHandlerCallback, WebSocketRoute, WebSocketRouteHandler } from './network';
|
||||
import type { FilePayload, Headers, LifecycleEvent, SelectOption, SelectOptionOptions, Size, WaitForEventOptions, WaitForFunctionOptions } from './types';
|
||||
import { JSHandle, assertMaxArguments, parseResult, serializeArgument } from './jsHandle';
|
||||
import { Response, Route, RouteHandler, WebSocket, WebSocketRoute, WebSocketRouteHandler, validateHeaders } from './network';
|
||||
import { Video } from './video';
|
||||
import { Waiter } from './waiter';
|
||||
import { Worker } from './worker';
|
||||
import { HarRouter } from './harRouter';
|
||||
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type { Clock } from './clock';
|
||||
import type { APIRequestContext } from './fetch';
|
||||
import type { WaitForNavigationOptions } from './frame';
|
||||
import type { FrameLocator, Locator, LocatorOptions } from './locator';
|
||||
import type { Request, RouteHandlerCallback, WebSocketRouteHandlerCallback } from './network';
|
||||
import type { FilePayload, Headers, LifecycleEvent, SelectOption, SelectOptionOptions, Size, WaitForEventOptions, WaitForFunctionOptions } from './types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type { URLMatch } from '../utils';
|
||||
import type { ByRoleOptions } from '../utils/isomorphic/locatorUtils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
type PDFOptions = Omit<channels.PagePdfParams, 'width' | 'height' | 'margin'> & {
|
||||
width?: string | number,
|
||||
|
|
|
@ -14,14 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { TimeoutError } from './errors';
|
||||
import { Android } from './android';
|
||||
import { BrowserType } from './browserType';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { Electron } from './electron';
|
||||
import { TimeoutError } from './errors';
|
||||
import { APIRequest } from './fetch';
|
||||
import { Selectors, SelectorsOwner } from './selectors';
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { BrowserContextOptions, LaunchOptions } from 'playwright-core';
|
||||
|
||||
export class Playwright extends ChannelOwner<channels.PlaywrightChannel> {
|
||||
|
|
|
@ -14,12 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { evaluationScript } from './clientHelper';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { evaluationScript } from './clientHelper';
|
||||
import { setTestIdAttribute, testIdAttributeName } from './locator';
|
||||
|
||||
import type { SelectorEngine } from './types';
|
||||
import type * as api from '../../types/types';
|
||||
import { setTestIdAttribute, testIdAttributeName } from './locator';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export class Selectors implements api.Selectors {
|
||||
private _channels = new Set<SelectorsOwner>();
|
||||
|
|
|
@ -15,9 +15,11 @@
|
|||
*/
|
||||
|
||||
import { Readable } from 'stream';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class Stream extends ChannelOwner<channels.StreamChannel> {
|
||||
static from(Stream: channels.StreamChannel): Stream {
|
||||
return (Stream as any)._object;
|
||||
|
|
|
@ -14,11 +14,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { Artifact } from './artifact';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class Tracing extends ChannelOwner<channels.TracingChannel> implements api.Tracing {
|
||||
private _includeSources = false;
|
||||
_tracesDir: string | undefined;
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { Size } from '../common/types';
|
||||
export type { Size, Point, Rect, Quad, TimeoutOptions, HeadersArray } from '../common/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
export type { HeadersArray, Point, Quad, Rect, Size, TimeoutOptions } from '../common/types';
|
||||
|
||||
type LoggerSeverity = 'verbose' | 'info' | 'warning' | 'error';
|
||||
export interface Logger {
|
||||
|
|
|
@ -14,11 +14,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { Page } from './page';
|
||||
import type * as api from '../../types/types';
|
||||
import { ManualPromise } from '../utils';
|
||||
|
||||
import type { Artifact } from './artifact';
|
||||
import type { Connection } from './connection';
|
||||
import { ManualPromise } from '../utils';
|
||||
import type { Page } from './page';
|
||||
import type * as api from '../../types/types';
|
||||
|
||||
export class Video implements api.Video {
|
||||
private _artifact: Promise<Artifact | null> | null = null;
|
||||
|
|
|
@ -14,13 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { EventEmitter } from 'events';
|
||||
import { rewriteErrorMessage } from '../utils/stackTrace';
|
||||
import { TimeoutError } from './errors';
|
||||
import { createGuid, zones } from '../utils';
|
||||
import { rewriteErrorMessage } from '../utils/stackTrace';
|
||||
|
||||
import type { Zone } from '../utils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { ChannelOwner } from './channelOwner';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { EventEmitter } from 'events';
|
||||
|
||||
export class Waiter {
|
||||
private _dispose: (() => void)[];
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as api from '../../types/types';
|
||||
import type { Page } from './page';
|
||||
import type * as api from '../../types/types';
|
||||
|
||||
export class WebError implements api.WebError {
|
||||
private _page: Page | null;
|
||||
|
|
|
@ -14,17 +14,19 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Events } from './events';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
import { assertMaxArguments, JSHandle, parseResult, serializeArgument } from './jsHandle';
|
||||
import type { Page } from './page';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as structs from '../../types/structs';
|
||||
import { Events } from './events';
|
||||
import { JSHandle, assertMaxArguments, parseResult, serializeArgument } from './jsHandle';
|
||||
import { LongStandingScope } from '../utils';
|
||||
import { TargetClosedError } from './errors';
|
||||
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type { Page } from './page';
|
||||
import type * as structs from '../../types/structs';
|
||||
import type * as api from '../../types/types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export class Worker extends ChannelOwner<channels.WorkerChannel> implements api.Worker {
|
||||
_page: Page | undefined; // Set for web workers.
|
||||
_context: BrowserContext | undefined; // Set for service workers.
|
||||
|
|
|
@ -15,9 +15,11 @@
|
|||
*/
|
||||
|
||||
import { Writable } from 'stream';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
import { ChannelOwner } from './channelOwner';
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class WritableStream extends ChannelOwner<channels.WritableStreamChannel> {
|
||||
static from(Stream: channels.WritableStreamChannel): WritableStream {
|
||||
return (Stream as any)._object;
|
||||
|
|
|
@ -15,11 +15,13 @@
|
|||
*/
|
||||
|
||||
import EventEmitter from 'events';
|
||||
import type { AddressInfo } from 'net';
|
||||
import net from 'net';
|
||||
import * as net from 'net';
|
||||
|
||||
import { assert, createGuid, } from '../utils';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
import { createSocket } from '../utils/happy-eyeballs';
|
||||
import { assert, createGuid, } from '../utils';
|
||||
|
||||
import type { AddressInfo } from 'net';
|
||||
|
||||
// https://tools.ietf.org/html/rfc1928
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
import { blendWithWhite, colorDeltaE94, rgb2gray } from './colorUtils';
|
||||
import { ImageChannel } from './imageChannel';
|
||||
import { ssim, FastStats } from './stats';
|
||||
import { FastStats, ssim } from './stats';
|
||||
|
||||
const SSIM_WINDOW_RADIUS = 15;
|
||||
const VARIANCE_WINDOW_RADIUS = 1;
|
||||
|
|
|
@ -14,11 +14,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { Playwright as PlaywrightAPI } from './client/playwright';
|
||||
import { createPlaywright, DispatcherConnection, RootDispatcher, PlaywrightDispatcher } from './server';
|
||||
import { Connection } from './client/connection';
|
||||
import { BrowserServerLauncherImpl } from './browserServerImpl';
|
||||
import { AndroidServerLauncherImpl } from './androidServerImpl';
|
||||
import { BrowserServerLauncherImpl } from './browserServerImpl';
|
||||
import { Connection } from './client/connection';
|
||||
import { DispatcherConnection, PlaywrightDispatcher, RootDispatcher, createPlaywright } from './server';
|
||||
|
||||
import type { Playwright as PlaywrightAPI } from './client/playwright';
|
||||
import type { Language } from './utils';
|
||||
|
||||
export function createInProcessPlaywright(): PlaywrightAPI {
|
||||
|
|
|
@ -14,13 +14,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Connection } from './client/connection';
|
||||
import { PipeTransport } from './protocol/transport';
|
||||
import type { Playwright } from './client/playwright';
|
||||
import * as childProcess from 'child_process';
|
||||
import * as path from 'path';
|
||||
|
||||
import { Connection } from './client/connection';
|
||||
import { PipeTransport } from './protocol/transport';
|
||||
import { ManualPromise } from './utils/manualPromise';
|
||||
|
||||
import type { Playwright } from './client/playwright';
|
||||
|
||||
|
||||
export async function start(env: any = {}): Promise<{ playwright: Playwright, stop: () => Promise<void> }> {
|
||||
const client = new PlaywrightClient(env);
|
||||
const playwright = await client._playwright;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
// This file is generated by generate_channels.js, do not edit manually.
|
||||
|
||||
/* eslint-disable import/order */
|
||||
import { scheme, tOptional, tObject, tBoolean, tNumber, tString, tAny, tEnum, tArray, tBinary, tChannel, tType } from './validatorPrimitives';
|
||||
export type { Validator, ValidatorContext } from './validatorPrimitives';
|
||||
export { ValidationError, findValidator, maybeFindValidator, createMetadataValidator } from './validatorPrimitives';
|
||||
|
|
|
@ -14,21 +14,22 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { WebSocket } from '../utilsBundle';
|
||||
import type { DispatcherScope, Playwright } from '../server';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { createPlaywright, DispatcherConnection, RootDispatcher, PlaywrightDispatcher } from '../server';
|
||||
import { Browser } from '../server/browser';
|
||||
import { serverSideCallMetadata } from '../server/instrumentation';
|
||||
import { SocksProxy } from '../common/socksProxy';
|
||||
import { assert, isUnderTest } from '../utils';
|
||||
import type { LaunchOptions } from '../server/types';
|
||||
import { DispatcherConnection, PlaywrightDispatcher, RootDispatcher, createPlaywright } from '../server';
|
||||
import { AndroidDevice } from '../server/android/android';
|
||||
import { Browser } from '../server/browser';
|
||||
import { DebugControllerDispatcher } from '../server/dispatchers/debugControllerDispatcher';
|
||||
import { serverSideCallMetadata } from '../server/instrumentation';
|
||||
import { assert, isUnderTest } from '../utils';
|
||||
import { startProfiling, stopProfiling } from '../utils';
|
||||
import { monotonicTime } from '../utils';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
|
||||
import type { DispatcherScope, Playwright } from '../server';
|
||||
import type { LaunchOptions } from '../server/types';
|
||||
import type { WebSocket } from '../utilsBundle';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export type ClientType = 'controller' | 'launch-browser' | 'reuse-browser' | 'pre-launched-browser-or-android';
|
||||
|
||||
type Options = {
|
||||
|
|
|
@ -14,18 +14,20 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { PlaywrightConnection } from './playwrightConnection';
|
||||
import { createPlaywright } from '../server/playwright';
|
||||
import { userAgentVersionMatchesErrorMessage } from '../utils';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
import { Semaphore } from '../utils/semaphore';
|
||||
import { WSServer } from '../utils/wsServer';
|
||||
|
||||
import type { ClientType } from './playwrightConnection';
|
||||
import type { SocksProxy } from '../common/socksProxy';
|
||||
import type { AndroidDevice } from '../server/android/android';
|
||||
import type { Browser } from '../server/browser';
|
||||
import type { Playwright } from '../server/playwright';
|
||||
import { createPlaywright } from '../server/playwright';
|
||||
import { PlaywrightConnection } from './playwrightConnection';
|
||||
import type { ClientType } from './playwrightConnection';
|
||||
import type { LaunchOptions } from '../server/types';
|
||||
import { Semaphore } from '../utils/semaphore';
|
||||
import type { AndroidDevice } from '../server/android/android';
|
||||
import type { SocksProxy } from '../common/socksProxy';
|
||||
import { debugLogger } from '../utils/debugLogger';
|
||||
import { userAgentVersionMatchesErrorMessage } from '../utils';
|
||||
import { WSServer } from '../utils/wsServer';
|
||||
|
||||
|
||||
type ServerOptions = {
|
||||
path: string;
|
||||
|
|
|
@ -14,31 +14,33 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { debug } from '../../utilsBundle';
|
||||
import { EventEmitter } from 'events';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import type * as stream from 'stream';
|
||||
import { wsReceiver, wsSender } from '../../utilsBundle';
|
||||
import { createGuid, makeWaitForNextTask, isUnderTest, getPackageManagerExecCommand } from '../../utils';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
import { TimeoutSettings } from '../../common/timeoutSettings';
|
||||
import { PipeTransport } from '../../protocol/transport';
|
||||
import { createGuid, getPackageManagerExecCommand, isUnderTest, makeWaitForNextTask } from '../../utils';
|
||||
import { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
import { removeFolders } from '../../utils/fileUtils';
|
||||
import type { BrowserOptions, BrowserProcess } from '../browser';
|
||||
import type { BrowserContext } from '../browserContext';
|
||||
import { gracefullyCloseSet } from '../../utils/processLauncher';
|
||||
import { debug } from '../../utilsBundle';
|
||||
import { wsReceiver, wsSender } from '../../utilsBundle';
|
||||
import { validateBrowserContextOptions } from '../browserContext';
|
||||
import { ProgressController } from '../progress';
|
||||
import { chromiumSwitches } from '../chromium/chromiumSwitches';
|
||||
import { CRBrowser } from '../chromium/crBrowser';
|
||||
import { helper } from '../helper';
|
||||
import type * as types from '../types';
|
||||
import { PipeTransport } from '../../protocol/transport';
|
||||
import { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
import { gracefullyCloseSet } from '../../utils/processLauncher';
|
||||
import { TimeoutSettings } from '../../common/timeoutSettings';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { SdkObject, serverSideCallMetadata } from '../instrumentation';
|
||||
import { chromiumSwitches } from '../chromium/chromiumSwitches';
|
||||
import { ProgressController } from '../progress';
|
||||
import { registry } from '../registry';
|
||||
|
||||
import type { BrowserOptions, BrowserProcess } from '../browser';
|
||||
import type { BrowserContext } from '../browserContext';
|
||||
import type * as types from '../types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type * as stream from 'stream';
|
||||
|
||||
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-');
|
||||
|
||||
export interface Backend {
|
||||
|
|
|
@ -14,12 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { debug } from '../../utilsBundle';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import * as net from 'net';
|
||||
import { EventEmitter } from 'events';
|
||||
import type { Backend, DeviceBackend, SocketBackend } from './android';
|
||||
import * as net from 'net';
|
||||
|
||||
import { assert, createGuid } from '../../utils';
|
||||
import { debug } from '../../utilsBundle';
|
||||
|
||||
import type { Backend, DeviceBackend, SocketBackend } from './android';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export class AdbBackend implements Backend {
|
||||
async devices(options: channels.AndroidDevicesOptions = {}): Promise<DeviceBackend[]> {
|
||||
|
|
|
@ -14,11 +14,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { assert } from '../utils';
|
||||
import { ManualPromise } from '../utils/manualPromise';
|
||||
import { SdkObject } from './instrumentation';
|
||||
import { TargetClosedError } from './errors';
|
||||
import { SdkObject } from './instrumentation';
|
||||
import { ManualPromise } from '../utils/manualPromise';
|
||||
|
||||
type SaveCallback = (localPath: string, error?: Error) => Promise<void>;
|
||||
type CancelCallback = () => Promise<void>;
|
||||
|
|
|
@ -14,23 +14,25 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import type { BrowserOptions } from '../browser';
|
||||
import { Browser } from '../browser';
|
||||
import { assertBrowserContextIsNotOwned, BrowserContext } from '../browserContext';
|
||||
import type { SdkObject } from '../instrumentation';
|
||||
import { BrowserContext, assertBrowserContextIsNotOwned } from '../browserContext';
|
||||
import * as network from '../network';
|
||||
import type { InitScript, Page } from '../page';
|
||||
import type { ConnectionTransport } from '../transport';
|
||||
import type * as types from '../types';
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
import { BidiConnection } from './bidiConnection';
|
||||
import { bidiBytesValueToString } from './bidiNetworkManager';
|
||||
import { BidiPage } from './bidiPage';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import type { BrowserOptions } from '../browser';
|
||||
import type { SdkObject } from '../instrumentation';
|
||||
import type { InitScript, Page } from '../page';
|
||||
import type { ConnectionTransport } from '../transport';
|
||||
import type * as types from '../types';
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export class BidiBrowser extends Browser {
|
||||
private readonly _connection: BidiConnection;
|
||||
readonly _browserSession: BidiSession;
|
||||
|
|
|
@ -14,18 +14,21 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import os from 'os';
|
||||
import * as os from 'os';
|
||||
|
||||
import { assert, wrapInASCIIBox } from '../../utils';
|
||||
import { BrowserReadyState, BrowserType, kNoXServerRunningError } from '../browserType';
|
||||
import { BidiBrowser } from './bidiBrowser';
|
||||
import { kBrowserCloseMessageId } from './bidiConnection';
|
||||
import { chromiumSwitches } from '../chromium/chromiumSwitches';
|
||||
|
||||
import type { Env } from '../../utils/processLauncher';
|
||||
import type { BrowserOptions } from '../browser';
|
||||
import { BrowserReadyState, BrowserType, kNoXServerRunningError } from '../browserType';
|
||||
import { chromiumSwitches } from '../chromium/chromiumSwitches';
|
||||
import type { SdkObject } from '../instrumentation';
|
||||
import type { ProtocolError } from '../protocolError';
|
||||
import type { ConnectionTransport } from '../transport';
|
||||
import type * as types from '../types';
|
||||
import { BidiBrowser } from './bidiBrowser';
|
||||
import { kBrowserCloseMessageId } from './bidiConnection';
|
||||
|
||||
|
||||
export class BidiChromium extends BrowserType {
|
||||
constructor(parent: SdkObject) {
|
||||
|
|
|
@ -15,14 +15,16 @@
|
|||
*/
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import type { ConnectionTransport, ProtocolRequest, ProtocolResponse } from '../transport';
|
||||
import type { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
|
||||
import { debugLogger } from '../../utils/debugLogger';
|
||||
import type { ProtocolLogger } from '../types';
|
||||
import { helper } from '../helper';
|
||||
import { ProtocolError } from '../protocolError';
|
||||
import type * as bidi from './third_party/bidiProtocol';
|
||||
|
||||
import type { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
import type { ConnectionTransport, ProtocolRequest, ProtocolResponse } from '../transport';
|
||||
import type { ProtocolLogger } from '../types';
|
||||
import type * as bidiCommands from './third_party/bidiCommands';
|
||||
import type * as bidi from './third_party/bidiProtocol';
|
||||
|
||||
// BidiPlaywright uses this special id to issue Browser.close command which we
|
||||
// should ignore.
|
||||
|
|
|
@ -16,11 +16,12 @@
|
|||
|
||||
import { parseEvaluationResultValue } from '../isomorphic/utilityScriptSerializers';
|
||||
import * as js from '../javascript';
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
import { BidiDeserializer } from './third_party/bidiDeserializer';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
import { BidiSerializer } from './third_party/bidiSerializer';
|
||||
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
|
||||
export class BidiExecutionContext implements js.ExecutionContextDelegate {
|
||||
private readonly _session: BidiSession;
|
||||
readonly _target: bidi.Script.Target;
|
||||
|
|
|
@ -14,19 +14,22 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
import { assert, wrapInASCIIBox } from '../../utils';
|
||||
import { BrowserReadyState, BrowserType, kNoXServerRunningError } from '../browserType';
|
||||
import { BidiBrowser } from './bidiBrowser';
|
||||
import { kBrowserCloseMessageId } from './bidiConnection';
|
||||
import { createProfile } from './third_party/firefoxPrefs';
|
||||
|
||||
import type { Env } from '../../utils/processLauncher';
|
||||
import type { BrowserOptions } from '../browser';
|
||||
import { BrowserReadyState, BrowserType, kNoXServerRunningError } from '../browserType';
|
||||
import type { SdkObject } from '../instrumentation';
|
||||
import type { ProtocolError } from '../protocolError';
|
||||
import type { ConnectionTransport } from '../transport';
|
||||
import type * as types from '../types';
|
||||
import { BidiBrowser } from './bidiBrowser';
|
||||
import { kBrowserCloseMessageId } from './bidiConnection';
|
||||
import { createProfile } from './third_party/firefoxPrefs';
|
||||
|
||||
|
||||
export class BidiFirefox extends BrowserType {
|
||||
constructor(parent: SdkObject) {
|
||||
|
|
|
@ -14,12 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { resolveSmartModifierString } from '../input';
|
||||
import { getBidiKeyValue } from './third_party/bidiKeyboard';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
|
||||
import type * as input from '../input';
|
||||
import type * as types from '../types';
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
import { getBidiKeyValue } from './third_party/bidiKeyboard';
|
||||
import { resolveSmartModifierString } from '../input';
|
||||
|
||||
export class RawKeyboardImpl implements input.RawKeyboard {
|
||||
private _session: BidiSession;
|
||||
|
|
|
@ -14,15 +14,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import type { Page } from '../page';
|
||||
import * as network from '../network';
|
||||
import type * as frames from '../frames';
|
||||
import type * as types from '../types';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
import { parseRawCookie } from '../cookieStore';
|
||||
import * as network from '../network';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import type * as frames from '../frames';
|
||||
import type { Page } from '../page';
|
||||
import type * as types from '../types';
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
|
||||
|
||||
export class BidiNetworkManager {
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
|
||||
import * as bidiMapper from 'chromium-bidi/lib/cjs/bidiMapper/BidiMapper';
|
||||
import * as bidiCdpConnection from 'chromium-bidi/lib/cjs/cdp/CdpConnection';
|
||||
import type * as bidiTransport from 'chromium-bidi/lib/cjs/utils/transport';
|
||||
import type { ChromiumBidi } from 'chromium-bidi/lib/cjs/protocol/protocol';
|
||||
import type { ConnectionTransport, ProtocolRequest, ProtocolResponse } from '../transport';
|
||||
|
||||
import { debugLogger } from '../../utils/debugLogger';
|
||||
|
||||
import type { ConnectionTransport, ProtocolRequest, ProtocolResponse } from '../transport';
|
||||
import type { ChromiumBidi } from 'chromium-bidi/lib/cjs/protocol/protocol';
|
||||
import type * as bidiTransport from 'chromium-bidi/lib/cjs/utils/transport';
|
||||
|
||||
const bidiServerLogger = (prefix: string, ...args: unknown[]): void => {
|
||||
debugLogger.log(prefix as any, args);
|
||||
};
|
||||
|
|
|
@ -14,26 +14,27 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import { assert } from '../../utils';
|
||||
import type * as accessibility from '../accessibility';
|
||||
import * as dom from '../dom';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import { BrowserContext } from '../browserContext';
|
||||
import * as dialog from '../dialog';
|
||||
import type * as frames from '../frames';
|
||||
import * as dom from '../dom';
|
||||
import { Page } from '../page';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { BidiExecutionContext } from './bidiExecutionContext';
|
||||
import { RawKeyboardImpl, RawMouseImpl, RawTouchscreenImpl } from './bidiInput';
|
||||
import { BidiNetworkManager } from './bidiNetworkManager';
|
||||
import { BidiPDF } from './bidiPdf';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import type * as accessibility from '../accessibility';
|
||||
import type * as frames from '../frames';
|
||||
import type { InitScript, PageDelegate } from '../page';
|
||||
import type { Progress } from '../progress';
|
||||
import type * as types from '../types';
|
||||
import type { BidiBrowserContext } from './bidiBrowser';
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
import { RawKeyboardImpl, RawMouseImpl, RawTouchscreenImpl } from './bidiInput';
|
||||
import * as bidi from './third_party/bidiProtocol';
|
||||
import { BidiExecutionContext } from './bidiExecutionContext';
|
||||
import { BidiNetworkManager } from './bidiNetworkManager';
|
||||
import { BrowserContext } from '../browserContext';
|
||||
import { BidiPDF } from './bidiPdf';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
const UTILITY_WORLD_NAME = '__playwright_utility_world__';
|
||||
const kPlaywrightBindingChannel = 'playwrightChannel';
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
*/
|
||||
|
||||
import { assert } from '../../utils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
import type { BidiSession } from './bidiConnection';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
const PagePaperFormats: { [key: string]: { width: number, height: number }} = {
|
||||
letter: { width: 8.5, height: 11 },
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
/* eslint-disable curly, indent */
|
||||
|
||||
|
|
|
@ -14,19 +14,21 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as types from './types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { BrowserContext, validateBrowserContextOptions } from './browserContext';
|
||||
import { Page } from './page';
|
||||
import { Download } from './download';
|
||||
import type { ProxySettings } from './types';
|
||||
import type { ChildProcess } from 'child_process';
|
||||
import type { RecentLogsCollector } from '../utils/debugLogger';
|
||||
import type { CallMetadata } from './instrumentation';
|
||||
import { SdkObject } from './instrumentation';
|
||||
import { Artifact } from './artifact';
|
||||
import { BrowserContext, validateBrowserContextOptions } from './browserContext';
|
||||
import { Download } from './download';
|
||||
import { SdkObject } from './instrumentation';
|
||||
import { Page } from './page';
|
||||
import { ClientCertificatesProxy } from './socksClientCertificatesInterceptor';
|
||||
|
||||
import type { CallMetadata } from './instrumentation';
|
||||
import type * as types from './types';
|
||||
import type { ProxySettings } from './types';
|
||||
import type { RecentLogsCollector } from '../utils/debugLogger';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { ChildProcess } from 'child_process';
|
||||
|
||||
|
||||
export interface BrowserProcess {
|
||||
onclose?: ((exitCode: number | null, signal: string | null) => void);
|
||||
process?: ChildProcess;
|
||||
|
|
|
@ -15,36 +15,38 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { TimeoutSettings } from '../common/timeoutSettings';
|
||||
import { createGuid, debugMode } from '../utils';
|
||||
import { mkdirIfNeeded } from '../utils/fileUtils';
|
||||
import type { Browser, BrowserOptions } from './browser';
|
||||
import type { Download } from './download';
|
||||
import type * as frames from './frames';
|
||||
import { Clock } from './clock';
|
||||
import { Debugger } from './debugger';
|
||||
import { BrowserContextAPIRequestContext } from './fetch';
|
||||
import { HarRecorder } from './har/harRecorder';
|
||||
import { helper } from './helper';
|
||||
import { SdkObject, serverSideCallMetadata } from './instrumentation';
|
||||
import * as utilityScriptSerializers from './isomorphic/utilityScriptSerializers';
|
||||
import * as network from './network';
|
||||
import { InitScript } from './page';
|
||||
import { Page, PageBinding } from './page';
|
||||
import { Recorder } from './recorder';
|
||||
import * as storageScript from './storageScript';
|
||||
import { mkdirIfNeeded } from '../utils/fileUtils';
|
||||
import { RecorderApp } from './recorder/recorderApp';
|
||||
import * as consoleApiSource from '../generated/consoleApiSource';
|
||||
import { Tracing } from './trace/recorder/tracing';
|
||||
|
||||
import type { Artifact } from './artifact';
|
||||
import type { Browser, BrowserOptions } from './browser';
|
||||
import type { Download } from './download';
|
||||
import type * as frames from './frames';
|
||||
import type { CallMetadata } from './instrumentation';
|
||||
import type { Progress, ProgressController } from './progress';
|
||||
import type { Selectors } from './selectors';
|
||||
import type { ClientCertificatesProxy } from './socksClientCertificatesInterceptor';
|
||||
import type * as types from './types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import type { CallMetadata } from './instrumentation';
|
||||
import { serverSideCallMetadata, SdkObject } from './instrumentation';
|
||||
import { Debugger } from './debugger';
|
||||
import { Tracing } from './trace/recorder/tracing';
|
||||
import { HarRecorder } from './har/harRecorder';
|
||||
import { Recorder } from './recorder';
|
||||
import * as consoleApiSource from '../generated/consoleApiSource';
|
||||
import { BrowserContextAPIRequestContext } from './fetch';
|
||||
import type { Artifact } from './artifact';
|
||||
import { Clock } from './clock';
|
||||
import type { ClientCertificatesProxy } from './socksClientCertificatesInterceptor';
|
||||
import { RecorderApp } from './recorder/recorderApp';
|
||||
import * as storageScript from './storageScript';
|
||||
import * as utilityScriptSerializers from './isomorphic/utilityScriptSerializers';
|
||||
|
||||
export abstract class BrowserContext extends SdkObject {
|
||||
static Events = {
|
||||
|
|
|
@ -14,32 +14,35 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import path from 'path';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import * as path from 'path';
|
||||
|
||||
import { normalizeProxySettings, validateBrowserContextOptions } from './browserContext';
|
||||
import type { BrowserName } from './registry';
|
||||
import { registry } from './registry';
|
||||
import type { ConnectionTransport } from './transport';
|
||||
import { WebSocketTransport } from './transport';
|
||||
import type { BrowserOptions, Browser, BrowserProcess } from './browser';
|
||||
import type { Env } from '../utils/processLauncher';
|
||||
import { launchProcess, envArrayToObject } from '../utils/processLauncher';
|
||||
import { PipeTransport } from './pipeTransport';
|
||||
import type { Progress } from './progress';
|
||||
import { ProgressController } from './progress';
|
||||
import type * as types from './types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { DEFAULT_TIMEOUT, TimeoutSettings } from '../common/timeoutSettings';
|
||||
import { debugMode, ManualPromise } from '../utils';
|
||||
import { existsAsync } from '../utils/fileUtils';
|
||||
import { ManualPromise, debugMode } from '../utils';
|
||||
import { helper } from './helper';
|
||||
import { RecentLogsCollector } from '../utils/debugLogger';
|
||||
import type { CallMetadata } from './instrumentation';
|
||||
import { SdkObject } from './instrumentation';
|
||||
import { type ProtocolError, isProtocolError } from './protocolError';
|
||||
import { PipeTransport } from './pipeTransport';
|
||||
import { ProgressController } from './progress';
|
||||
import { isProtocolError } from './protocolError';
|
||||
import { registry } from './registry';
|
||||
import { ClientCertificatesProxy } from './socksClientCertificatesInterceptor';
|
||||
import { WebSocketTransport } from './transport';
|
||||
import { RecentLogsCollector } from '../utils/debugLogger';
|
||||
import { existsAsync } from '../utils/fileUtils';
|
||||
import { envArrayToObject, launchProcess } from '../utils/processLauncher';
|
||||
|
||||
import type { Browser, BrowserOptions, BrowserProcess } from './browser';
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import type { CallMetadata } from './instrumentation';
|
||||
import type { Progress } from './progress';
|
||||
import type { ProtocolError } from './protocolError';
|
||||
import type { BrowserName } from './registry';
|
||||
import type { ConnectionTransport } from './transport';
|
||||
import type * as types from './types';
|
||||
import type { Env } from '../utils/processLauncher';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export const kNoXServerRunningError = 'Looks like you launched a headed browser without having a XServer running.\n' +
|
||||
'Set either \'headless: true\' or use \'xvfb-run <your-playwright-app>\' before running Playwright.\n\n<3 Playwright Team';
|
||||
|
|
|
@ -15,40 +15,42 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import type stream from 'stream';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
import { chromiumSwitches } from './chromiumSwitches';
|
||||
import { CRBrowser } from './crBrowser';
|
||||
import type { Env } from '../../utils/processLauncher';
|
||||
import { gracefullyCloseSet } from '../../utils/processLauncher';
|
||||
import { kBrowserCloseMessageId } from './crConnection';
|
||||
import { TimeoutSettings } from '../../common/timeoutSettings';
|
||||
import { debugMode, headersArrayToObject, headersObjectToArray, } from '../../utils';
|
||||
import { wrapInASCIIBox } from '../../utils/ascii';
|
||||
import { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
import { removeFolders } from '../../utils/fileUtils';
|
||||
import { ManualPromise } from '../../utils/manualPromise';
|
||||
import { fetchData } from '../../utils/network';
|
||||
import { gracefullyCloseSet } from '../../utils/processLauncher';
|
||||
import { getUserAgent } from '../../utils/userAgent';
|
||||
import { validateBrowserContextOptions } from '../browserContext';
|
||||
import { BrowserType, kNoXServerRunningError } from '../browserType';
|
||||
import { BrowserReadyState } from '../browserType';
|
||||
import type { ConnectionTransport, ProtocolRequest } from '../transport';
|
||||
import { helper } from '../helper';
|
||||
import { registry } from '../registry';
|
||||
import { WebSocketTransport } from '../transport';
|
||||
import { CRDevTools } from './crDevTools';
|
||||
import type { BrowserOptions, BrowserProcess } from '../browser';
|
||||
import { Browser } from '../browser';
|
||||
import type * as types from '../types';
|
||||
import type { HTTPRequestParams } from '../../utils/network';
|
||||
import { fetchData } from '../../utils/network';
|
||||
import { getUserAgent } from '../../utils/userAgent';
|
||||
import { wrapInASCIIBox } from '../../utils/ascii';
|
||||
import { debugMode, headersArrayToObject, headersObjectToArray, } from '../../utils';
|
||||
import { removeFolders } from '../../utils/fileUtils';
|
||||
import { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
import type { Progress } from '../progress';
|
||||
import { ProgressController } from '../progress';
|
||||
import { TimeoutSettings } from '../../common/timeoutSettings';
|
||||
import { helper } from '../helper';
|
||||
|
||||
import type { HTTPRequestParams } from '../../utils/network';
|
||||
import type { Env } from '../../utils/processLauncher';
|
||||
import type { BrowserOptions, BrowserProcess } from '../browser';
|
||||
import type { CallMetadata, SdkObject } from '../instrumentation';
|
||||
import type http from 'http';
|
||||
import { registry } from '../registry';
|
||||
import { ManualPromise } from '../../utils/manualPromise';
|
||||
import { validateBrowserContextOptions } from '../browserContext';
|
||||
import { chromiumSwitches } from './chromiumSwitches';
|
||||
import type { Progress } from '../progress';
|
||||
import type { ProtocolError } from '../protocolError';
|
||||
import type { ConnectionTransport, ProtocolRequest } from '../transport';
|
||||
import type * as types from '../types';
|
||||
import type http from 'http';
|
||||
import type stream from 'stream';
|
||||
|
||||
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-');
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Protocol } from './protocol';
|
||||
import type * as dom from '../dom';
|
||||
import type * as accessibility from '../accessibility';
|
||||
import type * as dom from '../dom';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export async function getAccessibilityTree(client: CRSession, needle?: dom.ElementHandle): Promise<{tree: accessibility.AXNode, needle: accessibility.AXNode | null}> {
|
||||
|
|
|
@ -15,28 +15,30 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BrowserOptions } from '../browser';
|
||||
import path from 'path';
|
||||
import { Browser } from '../browser';
|
||||
import { assertBrowserContextIsNotOwned, BrowserContext, verifyGeolocation } from '../browserContext';
|
||||
import * as path from 'path';
|
||||
|
||||
import { assert, createGuid } from '../../utils';
|
||||
import * as network from '../network';
|
||||
import type { InitScript, Worker } from '../page';
|
||||
import { Page } from '../page';
|
||||
import { Artifact } from '../artifact';
|
||||
import { Browser } from '../browser';
|
||||
import { BrowserContext, assertBrowserContextIsNotOwned, verifyGeolocation } from '../browserContext';
|
||||
import { Frame } from '../frames';
|
||||
import type { Dialog } from '../dialog';
|
||||
import type { ConnectionTransport } from '../transport';
|
||||
import type * as types from '../types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { CRSession, CDPSession } from './crConnection';
|
||||
import { ConnectionEvents, CRConnection } from './crConnection';
|
||||
import * as network from '../network';
|
||||
import { Page } from '../page';
|
||||
import { CRConnection, ConnectionEvents } from './crConnection';
|
||||
import { CRPage } from './crPage';
|
||||
import { saveProtocolStream } from './crProtocolHelper';
|
||||
import type { Protocol } from './protocol';
|
||||
import type { CRDevTools } from './crDevTools';
|
||||
import { CRServiceWorker } from './crServiceWorker';
|
||||
|
||||
import type { Dialog } from '../dialog';
|
||||
import type { InitScript, Worker } from '../page';
|
||||
import type { ConnectionTransport } from '../transport';
|
||||
import type * as types from '../types';
|
||||
import type { CDPSession, CRSession } from './crConnection';
|
||||
import type { CRDevTools } from './crDevTools';
|
||||
import type { Protocol } from './protocol';
|
||||
import type { BrowserOptions } from '../browser';
|
||||
import type { SdkObject } from '../instrumentation';
|
||||
import { Artifact } from '../artifact';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
export class CRBrowser extends Browser {
|
||||
readonly _connection: CRConnection;
|
||||
|
|
|
@ -15,16 +15,20 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { type RegisteredListener, assert, eventsHelper } from '../../utils';
|
||||
import type { ConnectionTransport, ProtocolRequest, ProtocolResponse } from '../transport';
|
||||
import type { Protocol } from './protocol';
|
||||
import { EventEmitter } from 'events';
|
||||
import type { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
|
||||
import { assert, eventsHelper } from '../../utils';
|
||||
import { debugLogger } from '../../utils/debugLogger';
|
||||
import type { ProtocolLogger } from '../types';
|
||||
import { helper } from '../helper';
|
||||
import { ProtocolError } from '../protocolError';
|
||||
|
||||
import type { RegisteredListener } from '../../utils';
|
||||
import type { ConnectionTransport, ProtocolRequest, ProtocolResponse } from '../transport';
|
||||
import type { Protocol } from './protocol';
|
||||
import type { RecentLogsCollector } from '../../utils/debugLogger';
|
||||
import type { ProtocolLogger } from '../types';
|
||||
|
||||
|
||||
export const ConnectionEvents = {
|
||||
Disconnected: Symbol('ConnectionEvents.Disconnected')
|
||||
};
|
||||
|
|
|
@ -15,12 +15,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import type { Protocol } from './protocol';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { assert } from '../../utils';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Protocol } from './protocol';
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
export class CRCoverage {
|
||||
private _jsCoverage: JSCoverage;
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
|
||||
const kBindingName = '__pw_devtools__';
|
||||
|
|
|
@ -13,11 +13,13 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { toModifiersMask } from './crProtocolHelper';
|
||||
import { assert } from '../../utils';
|
||||
|
||||
import type { CRPage } from './crPage';
|
||||
import type * as types from '../types';
|
||||
import { assert } from '../../utils';
|
||||
import type { Protocol } from './protocol';
|
||||
import { toModifiersMask } from './crProtocolHelper';
|
||||
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
|
|
@ -15,14 +15,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import { getExceptionMessage, releaseObject } from './crProtocolHelper';
|
||||
import type { Protocol } from './protocol';
|
||||
import * as js from '../javascript';
|
||||
import { rewriteErrorMessage } from '../../utils/stackTrace';
|
||||
import { parseEvaluationResultValue } from '../isomorphic/utilityScriptSerializers';
|
||||
import * as js from '../javascript';
|
||||
import { isSessionClosedError } from '../protocolError';
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Protocol } from './protocol';
|
||||
|
||||
export class CRExecutionContext implements js.ExecutionContextDelegate {
|
||||
_client: CRSession;
|
||||
_contextId: number;
|
||||
|
|
|
@ -15,14 +15,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { isString } from '../../utils';
|
||||
import * as input from '../input';
|
||||
import { macEditingCommands } from '../macEditingCommands';
|
||||
import { toButtonsMask, toModifiersMask } from './crProtocolHelper';
|
||||
|
||||
import type * as types from '../types';
|
||||
import type { CRSession } from './crConnection';
|
||||
import { macEditingCommands } from '../macEditingCommands';
|
||||
import { isString } from '../../utils';
|
||||
import type { DragManager } from './crDragDrop';
|
||||
import type { CRPage } from './crPage';
|
||||
import { toButtonsMask, toModifiersMask } from './crProtocolHelper';
|
||||
|
||||
|
||||
export class RawKeyboardImpl implements input.RawKeyboard {
|
||||
constructor(
|
||||
|
|
|
@ -15,20 +15,22 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Page } from '../page';
|
||||
import { helper } from '../helper';
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import { assert, headersArrayToObject, headersObjectToArray } from '../../utils';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import type { Protocol } from './protocol';
|
||||
import { helper } from '../helper';
|
||||
import * as network from '../network';
|
||||
import { isProtocolError, isSessionClosedError } from '../protocolError';
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Protocol } from './protocol';
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import type * as contexts from '../browserContext';
|
||||
import type * as frames from '../frames';
|
||||
import type { Page } from '../page';
|
||||
import type * as types from '../types';
|
||||
import type { CRPage } from './crPage';
|
||||
import { assert, headersArrayToObject, headersObjectToArray } from '../../utils';
|
||||
import type { CRServiceWorker } from './crServiceWorker';
|
||||
import { isProtocolError, isSessionClosedError } from '../protocolError';
|
||||
|
||||
|
||||
type SessionInfo = {
|
||||
session: CRSession;
|
||||
|
|
|
@ -15,25 +15,21 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import { registry } from '../registry';
|
||||
import { rewriteErrorMessage } from '../../utils/stackTrace';
|
||||
import * as path from 'path';
|
||||
|
||||
import { assert, createGuid } from '../../utils';
|
||||
import { eventsHelper } from '../../utils/eventsHelper';
|
||||
import { rewriteErrorMessage } from '../../utils/stackTrace';
|
||||
import * as dialog from '../dialog';
|
||||
import * as dom from '../dom';
|
||||
import * as frames from '../frames';
|
||||
import { helper } from '../helper';
|
||||
import * as network from '../network';
|
||||
import { type InitScript, PageBinding, type PageDelegate } from '../page';
|
||||
import { PageBinding } from '../page';
|
||||
import { Page, Worker } from '../page';
|
||||
import type { Progress } from '../progress';
|
||||
import type * as types from '../types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { registry } from '../registry';
|
||||
import { getAccessibilityTree } from './crAccessibility';
|
||||
import { CRBrowserContext } from './crBrowser';
|
||||
import type { CRSession } from './crConnection';
|
||||
import { CRCoverage } from './crCoverage';
|
||||
import { DragManager } from './crDragDrop';
|
||||
import { CRExecutionContext } from './crExecutionContext';
|
||||
|
@ -42,12 +38,19 @@ import { CRNetworkManager } from './crNetworkManager';
|
|||
import { CRPDF } from './crPdf';
|
||||
import { exceptionToError, releaseObject, toConsoleMessageLocation } from './crProtocolHelper';
|
||||
import { platformToFontFamilies } from './defaultFontFamilies';
|
||||
import type { Protocol } from './protocol';
|
||||
import { VideoRecorder } from './videoRecorder';
|
||||
import { BrowserContext } from '../browserContext';
|
||||
import { TargetClosedError } from '../errors';
|
||||
import { isSessionClosedError } from '../protocolError';
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Protocol } from './protocol';
|
||||
import type { RegisteredListener } from '../../utils/eventsHelper';
|
||||
import type { InitScript, PageDelegate } from '../page';
|
||||
import type { Progress } from '../progress';
|
||||
import type * as types from '../types';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
|
||||
const UTILITY_WORLD_NAME = '__playwright_utility_world__';
|
||||
export type WindowBounds = { top?: number, left?: number, width?: number, height?: number };
|
||||
|
|
|
@ -15,10 +15,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { assert } from '../../utils';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import type { CRSession } from './crConnection';
|
||||
import { readProtocolStream } from './crProtocolHelper';
|
||||
import { assert } from '../../utils';
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
const PagePaperFormats: { [key: string]: { width: number, height: number }} = {
|
||||
letter: { width: 8.5, height: 11 },
|
||||
|
|
|
@ -15,13 +15,16 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Protocol } from './protocol';
|
||||
import fs from 'fs';
|
||||
import type * as types from '../types';
|
||||
import * as fs from 'fs';
|
||||
|
||||
import { mkdirIfNeeded } from '../../utils/fileUtils';
|
||||
import { splitErrorMessage } from '../../utils/stackTrace';
|
||||
|
||||
import type { CRSession } from './crConnection';
|
||||
import type { Protocol } from './protocol';
|
||||
import type * as types from '../types';
|
||||
|
||||
|
||||
export function getExceptionMessage(exceptionDetails: Protocol.Runtime.ExceptionDetails): string {
|
||||
if (exceptionDetails.exception)
|
||||
return exceptionDetails.exception.description || String(exceptionDetails.exception.value);
|
||||
|
|
|
@ -14,12 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
import { Worker } from '../page';
|
||||
import type { CRBrowserContext } from './crBrowser';
|
||||
import type { CRSession } from './crConnection';
|
||||
import { CRExecutionContext } from './crExecutionContext';
|
||||
import { CRNetworkManager } from './crNetworkManager';
|
||||
import * as network from '../network';
|
||||
import { BrowserContext } from '../browserContext';
|
||||
import * as network from '../network';
|
||||
|
||||
import type { CRBrowserContext } from './crBrowser';
|
||||
import type { CRSession } from './crConnection';
|
||||
|
||||
export class CRServiceWorker extends Worker {
|
||||
readonly _browserContext: CRBrowserContext;
|
||||
|
|
|
@ -14,14 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { ChildProcess } from 'child_process';
|
||||
import { assert, monotonicTime } from '../../utils';
|
||||
import { Page } from '../page';
|
||||
import { launchProcess } from '../../utils/processLauncher';
|
||||
import type { Progress } from '../progress';
|
||||
import { ProgressController } from '../progress';
|
||||
import { serverSideCallMetadata } from '../instrumentation';
|
||||
import { Page } from '../page';
|
||||
import { ProgressController } from '../progress';
|
||||
|
||||
import type { Progress } from '../progress';
|
||||
import type * as types from '../types';
|
||||
import type { ChildProcess } from 'child_process';
|
||||
|
||||
const fps = 25;
|
||||
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BrowserContext } from './browserContext';
|
||||
import * as clockSource from '../generated/clockSource';
|
||||
|
||||
import type { BrowserContext } from './browserContext';
|
||||
|
||||
export class Clock {
|
||||
private _browserContext: BrowserContext;
|
||||
private _scriptInstalled = false;
|
||||
|
|
|
@ -14,13 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
import { sanitizeDeviceOptions, toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
|
||||
import { escapeWithQuotes, asLocator } from '../../utils';
|
||||
import { asLocator, escapeWithQuotes } from '../../utils';
|
||||
import { deviceDescriptors } from '../deviceDescriptors';
|
||||
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
|
||||
type CSharpLanguageMode = 'library' | 'mstest' | 'nunit';
|
||||
|
||||
export class CSharpLanguageGenerator implements LanguageGenerator {
|
||||
|
|
|
@ -14,14 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type * as types from '../types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import { toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
|
||||
import { deviceDescriptors } from '../deviceDescriptors';
|
||||
import { JavaScriptFormatter } from './javascript';
|
||||
import { escapeWithQuotes, asLocator } from '../../utils';
|
||||
import { asLocator, escapeWithQuotes } from '../../utils';
|
||||
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type * as types from '../types';
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
|
||||
type JavaLanguageMode = 'library' | 'junit';
|
||||
|
||||
|
|
|
@ -14,12 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
import { sanitizeDeviceOptions, toSignalMap, toKeyboardModifiers, toClickOptionsForSourceCode } from './language';
|
||||
import { sanitizeDeviceOptions, toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
|
||||
import { asLocator, escapeWithQuotes } from '../../utils';
|
||||
import { deviceDescriptors } from '../deviceDescriptors';
|
||||
import { escapeWithQuotes, asLocator } from '../../utils';
|
||||
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
|
||||
export class JavaScriptLanguageGenerator implements LanguageGenerator {
|
||||
id: string;
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
*/
|
||||
|
||||
import { asLocator } from '../../utils';
|
||||
import type * as actions from '@recorder/actions';
|
||||
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
|
||||
export class JsonlLanguageGenerator implements LanguageGenerator {
|
||||
id = 'jsonl';
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
*/
|
||||
|
||||
import type { BrowserContextOptions } from '../../..';
|
||||
import type * as actions from '@recorder/actions';
|
||||
import type * as types from '../types';
|
||||
import type { LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
|
||||
export function generateCode(actions: actions.ActionInContext[], languageGenerator: LanguageGenerator, options: LanguageGeneratorOptions) {
|
||||
const header = languageGenerator.generateHeader(options);
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CSharpLanguageGenerator } from './csharp';
|
||||
import { JavaLanguageGenerator } from './java';
|
||||
import { JavaScriptLanguageGenerator } from './javascript';
|
||||
import { JsonlLanguageGenerator } from './jsonl';
|
||||
import { CSharpLanguageGenerator } from './csharp';
|
||||
import { PythonLanguageGenerator } from './python';
|
||||
|
||||
export function languageSet() {
|
||||
|
|
|
@ -14,13 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
import { sanitizeDeviceOptions, toSignalMap, toKeyboardModifiers, toClickOptionsForSourceCode } from './language';
|
||||
import { escapeWithQuotes, toSnakeCase, asLocator } from '../../utils';
|
||||
import { sanitizeDeviceOptions, toClickOptionsForSourceCode, toKeyboardModifiers, toSignalMap } from './language';
|
||||
import { asLocator, escapeWithQuotes, toSnakeCase } from '../../utils';
|
||||
import { deviceDescriptors } from '../deviceDescriptors';
|
||||
|
||||
import type { Language, LanguageGenerator, LanguageGeneratorOptions } from './types';
|
||||
import type { BrowserContextOptions } from '../../../types/types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
|
||||
export class PythonLanguageGenerator implements LanguageGenerator {
|
||||
id: string;
|
||||
groupName = 'Python';
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
|
||||
import type { BrowserContextOptions, LaunchOptions } from '../../../types/types';
|
||||
import type * as actions from '@recorder/actions';
|
||||
import type { Language } from '../../utils';
|
||||
import type * as actions from '@recorder/actions';
|
||||
export type { Language } from '../../utils';
|
||||
|
||||
export type LanguageGeneratorOptions = {
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
|
||||
import type * as js from './javascript';
|
||||
import type { ConsoleMessageLocation } from './types';
|
||||
import type { Page } from './page';
|
||||
import type { ConsoleMessageLocation } from './types';
|
||||
|
||||
export class ConsoleMessage {
|
||||
private _type: string;
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { kMaxCookieExpiresDateInSeconds } from './network';
|
||||
|
||||
import type * as channels from '@protocol/channels';
|
||||
|
||||
class Cookie {
|
||||
private _raw: channels.NetworkCookie;
|
||||
constructor(data: channels.NetworkCookie) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue