@checkly/playwright-core 1.48.23 → 1.48.24-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/lib/generated/clockSource.js +1 -2
  2. package/lib/generated/consoleApiSource.js +1 -2
  3. package/lib/generated/injectedScriptSource.js +1 -2
  4. package/lib/generated/pollingRecorderSource.js +1 -2
  5. package/lib/generated/utilityScriptSource.js +1 -2
  6. package/lib/generated/webSocketMockSource.js +1 -2
  7. package/lib/vite/traceViewer/assets/codeMirrorModule-lDjkI8Ax.js +24 -0
  8. package/lib/vite/traceViewer/assets/inspectorTab-BPzhNk9r.js +64 -0
  9. package/lib/vite/traceViewer/assets/workbench-DLv_q9ji.js +9 -0
  10. package/lib/vite/traceViewer/embedded.BIubxTi3.js +2 -0
  11. package/lib/vite/traceViewer/embedded.html +3 -3
  12. package/lib/vite/traceViewer/index.DPD22sZn.js +2 -0
  13. package/lib/vite/traceViewer/index.html +3 -3
  14. package/lib/vite/traceViewer/recorder.BaRuS6Pc.js +2 -0
  15. package/lib/vite/traceViewer/recorder.html +2 -2
  16. package/lib/vite/traceViewer/uiMode.B11wexdJ.js +5 -0
  17. package/lib/vite/traceViewer/uiMode.html +3 -3
  18. package/package.json +1 -1
  19. package/lib/client/clientStackTrace.js +0 -65
  20. package/lib/client/fileUtils.js +0 -31
  21. package/lib/client/platform.js +0 -71
  22. package/lib/client/timeoutSettings.js +0 -65
  23. package/lib/client/webSocket.js +0 -106
  24. package/lib/server/callLog.js +0 -79
  25. package/lib/server/harBackend.js +0 -157
  26. package/lib/server/localUtils.js +0 -203
  27. package/lib/server/recorder/chat.js +0 -177
  28. package/lib/server/storageScript.js +0 -160
  29. package/lib/server/timeoutSettings.js +0 -74
  30. package/lib/server/utils/ascii.js +0 -31
  31. package/lib/server/utils/comparators.js +0 -159
  32. package/lib/server/utils/crypto.js +0 -171
  33. package/lib/server/utils/debug.js +0 -38
  34. package/lib/server/utils/debugLogger.js +0 -93
  35. package/lib/server/utils/env.js +0 -53
  36. package/lib/server/utils/eventsHelper.js +0 -38
  37. package/lib/server/utils/expectUtils.js +0 -33
  38. package/lib/server/utils/fileUtils.js +0 -204
  39. package/lib/server/utils/happyEyeballs.js +0 -209
  40. package/lib/server/utils/hostPlatform.js +0 -145
  41. package/lib/server/utils/httpServer.js +0 -233
  42. package/lib/server/utils/image_tools/colorUtils.js +0 -98
  43. package/lib/server/utils/image_tools/compare.js +0 -108
  44. package/lib/server/utils/image_tools/imageChannel.js +0 -70
  45. package/lib/server/utils/image_tools/stats.js +0 -102
  46. package/lib/server/utils/linuxUtils.js +0 -58
  47. package/lib/server/utils/network.js +0 -160
  48. package/lib/server/utils/nodePlatform.js +0 -140
  49. package/lib/server/utils/pipeTransport.js +0 -82
  50. package/lib/server/utils/processLauncher.js +0 -248
  51. package/lib/server/utils/profiler.js +0 -52
  52. package/lib/server/utils/socksProxy.js +0 -570
  53. package/lib/server/utils/spawnAsync.js +0 -45
  54. package/lib/server/utils/task.js +0 -58
  55. package/lib/server/utils/userAgent.js +0 -91
  56. package/lib/server/utils/wsServer.js +0 -128
  57. package/lib/server/utils/zipFile.js +0 -75
  58. package/lib/server/utils/zones.js +0 -54
  59. package/lib/utils/isomorphic/ariaSnapshot.js +0 -392
  60. package/lib/utils/isomorphic/assert.js +0 -25
  61. package/lib/utils/isomorphic/colors.js +0 -65
  62. package/lib/utils/isomorphic/headers.js +0 -52
  63. package/lib/utils/isomorphic/manualPromise.js +0 -107
  64. package/lib/utils/isomorphic/multimap.js +0 -73
  65. package/lib/utils/isomorphic/rtti.js +0 -41
  66. package/lib/utils/isomorphic/semaphore.js +0 -51
  67. package/lib/utils/isomorphic/stackTrace.js +0 -169
  68. package/lib/utils/isomorphic/time.js +0 -25
  69. package/lib/utils/isomorphic/timeoutRunner.js +0 -66
  70. package/lib/utils/isomorphic/types.js +0 -5
  71. package/lib/utils.js +0 -447
@@ -1,91 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getEmbedderName = getEmbedderName;
7
- exports.getPlaywrightVersion = getPlaywrightVersion;
8
- exports.getUserAgent = getUserAgent;
9
- var _child_process = require("child_process");
10
- var _os = _interopRequireDefault(require("os"));
11
- var _linuxUtils = require("../utils/linuxUtils");
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- /**
14
- * Copyright (c) Microsoft Corporation.
15
- *
16
- * Licensed under the Apache License, Version 2.0 (the "License");
17
- * you may not use this file except in compliance with the License.
18
- * You may obtain a copy of the License at
19
- *
20
- * http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software
23
- * distributed under the License is distributed on an "AS IS" BASIS,
24
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
- * See the License for the specific language governing permissions and
26
- * limitations under the License.
27
- */
28
-
29
- let cachedUserAgent;
30
- function getUserAgent() {
31
- if (cachedUserAgent) return cachedUserAgent;
32
- try {
33
- cachedUserAgent = determineUserAgent();
34
- } catch (e) {
35
- cachedUserAgent = 'Playwright/unknown';
36
- }
37
- return cachedUserAgent;
38
- }
39
- function determineUserAgent() {
40
- let osIdentifier = 'unknown';
41
- let osVersion = 'unknown';
42
- if (process.platform === 'win32') {
43
- const version = _os.default.release().split('.');
44
- osIdentifier = 'windows';
45
- osVersion = `${version[0]}.${version[1]}`;
46
- } else if (process.platform === 'darwin') {
47
- const version = (0, _child_process.execSync)('sw_vers -productVersion', {
48
- stdio: ['ignore', 'pipe', 'ignore']
49
- }).toString().trim().split('.');
50
- osIdentifier = 'macOS';
51
- osVersion = `${version[0]}.${version[1]}`;
52
- } else if (process.platform === 'linux') {
53
- const distroInfo = (0, _linuxUtils.getLinuxDistributionInfoSync)();
54
- if (distroInfo) {
55
- osIdentifier = distroInfo.id || 'linux';
56
- osVersion = distroInfo.version || 'unknown';
57
- } else {
58
- // Linux distribution without /etc/os-release.
59
- // Default to linux/unknown.
60
- osIdentifier = 'linux';
61
- }
62
- }
63
- const additionalTokens = [];
64
- if (process.env.CI) additionalTokens.push('CI/1');
65
- const serializedTokens = additionalTokens.length ? ' ' + additionalTokens.join(' ') : '';
66
- const {
67
- embedderName,
68
- embedderVersion
69
- } = getEmbedderName();
70
- return `Playwright/${getPlaywrightVersion()} (${_os.default.arch()}; ${osIdentifier} ${osVersion}) ${embedderName}/${embedderVersion}${serializedTokens}`;
71
- }
72
- function getEmbedderName() {
73
- let embedderName = 'unknown';
74
- let embedderVersion = 'unknown';
75
- if (!process.env.PW_LANG_NAME) {
76
- embedderName = 'node';
77
- embedderVersion = process.version.substring(1).split('.').slice(0, 2).join('.');
78
- } else if (['node', 'python', 'java', 'csharp'].includes(process.env.PW_LANG_NAME)) {
79
- var _process$env$PW_LANG_;
80
- embedderName = process.env.PW_LANG_NAME;
81
- embedderVersion = (_process$env$PW_LANG_ = process.env.PW_LANG_NAME_VERSION) !== null && _process$env$PW_LANG_ !== void 0 ? _process$env$PW_LANG_ : 'unknown';
82
- }
83
- return {
84
- embedderName,
85
- embedderVersion
86
- };
87
- }
88
- function getPlaywrightVersion(majorMinorOnly = false) {
89
- const version = process.env.PW_VERSION_OVERRIDE || require('./../../../package.json').version;
90
- return majorMinorOnly ? version.split('.').slice(0, 2).join('.') : version;
91
- }
@@ -1,128 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.perMessageDeflate = exports.WSServer = void 0;
7
- var _network = require("./network");
8
- var _utilsBundle = require("../../utilsBundle");
9
- var _debugLogger = require("./debugLogger");
10
- /**
11
- * Copyright (c) Microsoft Corporation.
12
- *
13
- * Licensed under the Apache License, Version 2.0 (the "License");
14
- * you may not use this file except in compliance with the License.
15
- * You may obtain a copy of the License at
16
- *
17
- * http://www.apache.org/licenses/LICENSE-2.0
18
- *
19
- * Unless required by applicable law or agreed to in writing, software
20
- * distributed under the License is distributed on an "AS IS" BASIS,
21
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
- * See the License for the specific language governing permissions and
23
- * limitations under the License.
24
- */
25
-
26
- let lastConnectionId = 0;
27
- const kConnectionSymbol = Symbol('kConnection');
28
- const perMessageDeflate = exports.perMessageDeflate = {
29
- serverNoContextTakeover: true,
30
- zlibDeflateOptions: {
31
- level: 3
32
- },
33
- zlibInflateOptions: {
34
- chunkSize: 10 * 1024
35
- },
36
- threshold: 10 * 1024
37
- };
38
- class WSServer {
39
- constructor(delegate) {
40
- this._wsServer = void 0;
41
- this.server = void 0;
42
- this._delegate = void 0;
43
- this._delegate = delegate;
44
- }
45
- async listen(port = 0, hostname, path) {
46
- _debugLogger.debugLogger.log('server', `Server started at ${new Date()}`);
47
- const server = (0, _network.createHttpServer)((request, response) => {
48
- if (request.method === 'GET' && request.url === '/json') {
49
- response.setHeader('Content-Type', 'application/json');
50
- response.end(JSON.stringify({
51
- wsEndpointPath: path
52
- }));
53
- return;
54
- }
55
- response.end('Running');
56
- });
57
- server.on('error', error => _debugLogger.debugLogger.log('server', String(error)));
58
- this.server = server;
59
- const wsEndpoint = await new Promise((resolve, reject) => {
60
- server.listen(port, hostname, () => {
61
- const address = server.address();
62
- if (!address) {
63
- reject(new Error('Could not bind server socket'));
64
- return;
65
- }
66
- const wsEndpoint = typeof address === 'string' ? `${address}${path}` : `ws://${hostname || 'localhost'}:${address.port}${path}`;
67
- resolve(wsEndpoint);
68
- }).on('error', reject);
69
- });
70
- _debugLogger.debugLogger.log('server', 'Listening at ' + wsEndpoint);
71
- this._wsServer = new _utilsBundle.wsServer({
72
- noServer: true,
73
- perMessageDeflate
74
- });
75
- if (this._delegate.onHeaders) this._wsServer.on('headers', headers => this._delegate.onHeaders(headers));
76
- server.on('upgrade', (request, socket, head) => {
77
- var _this$_delegate$onUpg, _this$_delegate, _this$_wsServer;
78
- const pathname = new URL('http://localhost' + request.url).pathname;
79
- if (pathname !== path) {
80
- socket.write(`HTTP/${request.httpVersion} 400 Bad Request\r\n\r\n`);
81
- socket.destroy();
82
- return;
83
- }
84
- const upgradeResult = (_this$_delegate$onUpg = (_this$_delegate = this._delegate).onUpgrade) === null || _this$_delegate$onUpg === void 0 ? void 0 : _this$_delegate$onUpg.call(_this$_delegate, request, socket);
85
- if (upgradeResult) {
86
- socket.write(upgradeResult.error);
87
- socket.destroy();
88
- return;
89
- }
90
- (_this$_wsServer = this._wsServer) === null || _this$_wsServer === void 0 || _this$_wsServer.handleUpgrade(request, socket, head, ws => {
91
- var _this$_wsServer2;
92
- return (_this$_wsServer2 = this._wsServer) === null || _this$_wsServer2 === void 0 ? void 0 : _this$_wsServer2.emit('connection', ws, request);
93
- });
94
- });
95
- this._wsServer.on('connection', (ws, request) => {
96
- _debugLogger.debugLogger.log('server', 'Connected client ws.extension=' + ws.extensions);
97
- const url = new URL('http://localhost' + (request.url || ''));
98
- const id = String(++lastConnectionId);
99
- _debugLogger.debugLogger.log('server', `[${id}] serving connection: ${request.url}`);
100
- const connection = this._delegate.onConnection(request, url, ws, id);
101
- ws[kConnectionSymbol] = connection;
102
- });
103
- return wsEndpoint;
104
- }
105
- async close() {
106
- var _this$_delegate$onClo, _this$_delegate2;
107
- const server = this._wsServer;
108
- if (!server) return;
109
- _debugLogger.debugLogger.log('server', 'closing websocket server');
110
- const waitForClose = new Promise(f => server.close(f));
111
- // First disconnect all remaining clients.
112
- await Promise.all(Array.from(server.clients).map(async ws => {
113
- const connection = ws[kConnectionSymbol];
114
- if (connection) await connection.close();
115
- try {
116
- ws.terminate();
117
- } catch (e) {}
118
- }));
119
- await waitForClose;
120
- _debugLogger.debugLogger.log('server', 'closing http server');
121
- if (this.server) await new Promise(f => this.server.close(f));
122
- this._wsServer = undefined;
123
- this.server = undefined;
124
- _debugLogger.debugLogger.log('server', 'closed server');
125
- await ((_this$_delegate$onClo = (_this$_delegate2 = this._delegate).onClose) === null || _this$_delegate$onClo === void 0 ? void 0 : _this$_delegate$onClo.call(_this$_delegate2));
126
- }
127
- }
128
- exports.WSServer = WSServer;
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ZipFile = void 0;
7
- var _zipBundle = require("../../zipBundle");
8
- /**
9
- * Copyright (c) Microsoft Corporation.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
-
24
- class ZipFile {
25
- constructor(fileName) {
26
- this._fileName = void 0;
27
- this._zipFile = void 0;
28
- this._entries = new Map();
29
- this._openedPromise = void 0;
30
- this._fileName = fileName;
31
- this._openedPromise = this._open();
32
- }
33
- async _open() {
34
- await new Promise((fulfill, reject) => {
35
- _zipBundle.yauzl.open(this._fileName, {
36
- autoClose: false
37
- }, (e, z) => {
38
- if (e) {
39
- reject(e);
40
- return;
41
- }
42
- this._zipFile = z;
43
- this._zipFile.on('entry', entry => {
44
- this._entries.set(entry.fileName, entry);
45
- });
46
- this._zipFile.on('end', fulfill);
47
- });
48
- });
49
- }
50
- async entries() {
51
- await this._openedPromise;
52
- return [...this._entries.keys()];
53
- }
54
- async read(entryPath) {
55
- await this._openedPromise;
56
- const entry = this._entries.get(entryPath);
57
- if (!entry) throw new Error(`${entryPath} not found in file ${this._fileName}`);
58
- return new Promise((resolve, reject) => {
59
- this._zipFile.openReadStream(entry, (error, readStream) => {
60
- if (error || !readStream) {
61
- reject(error || 'Entry not found');
62
- return;
63
- }
64
- const buffers = [];
65
- readStream.on('data', data => buffers.push(data));
66
- readStream.on('end', () => resolve(Buffer.concat(buffers)));
67
- });
68
- });
69
- }
70
- close() {
71
- var _this$_zipFile;
72
- (_this$_zipFile = this._zipFile) === null || _this$_zipFile === void 0 || _this$_zipFile.close();
73
- }
74
- }
75
- exports.ZipFile = ZipFile;
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Zone = void 0;
7
- exports.currentZone = currentZone;
8
- exports.emptyZone = void 0;
9
- var _async_hooks = require("async_hooks");
10
- /**
11
- * Copyright (c) Microsoft Corporation.
12
- *
13
- * Licensed under the Apache License, Version 2.0 (the "License");
14
- * you may not use this file except in compliance with the License.
15
- * You may obtain a copy of the License at
16
- *
17
- * http://www.apache.org/licenses/LICENSE-2.0
18
- *
19
- * Unless required by applicable law or agreed to in writing, software
20
- * distributed under the License is distributed on an "AS IS" BASIS,
21
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
- * See the License for the specific language governing permissions and
23
- * limitations under the License.
24
- */
25
-
26
- const asyncLocalStorage = new _async_hooks.AsyncLocalStorage();
27
- class Zone {
28
- constructor(asyncLocalStorage, store) {
29
- this._asyncLocalStorage = void 0;
30
- this._data = void 0;
31
- this._asyncLocalStorage = asyncLocalStorage;
32
- this._data = store;
33
- }
34
- with(type, data) {
35
- return new Zone(this._asyncLocalStorage, new Map(this._data).set(type, data));
36
- }
37
- without(type) {
38
- const data = type ? new Map(this._data) : new Map();
39
- data.delete(type);
40
- return new Zone(this._asyncLocalStorage, data);
41
- }
42
- run(func) {
43
- return this._asyncLocalStorage.run(this, func);
44
- }
45
- data(type) {
46
- return this._data.get(type);
47
- }
48
- }
49
- exports.Zone = Zone;
50
- const emptyZone = exports.emptyZone = new Zone(asyncLocalStorage, new Map());
51
- function currentZone() {
52
- var _asyncLocalStorage$ge;
53
- return (_asyncLocalStorage$ge = asyncLocalStorage.getStore()) !== null && _asyncLocalStorage$ge !== void 0 ? _asyncLocalStorage$ge : emptyZone;
54
- }