@checkly/playwright-core 1.41.23 → 1.41.25
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.
- package/lib/cli/driver.js +1 -9
- package/lib/cli/program.js +3 -11
- package/lib/client/channelOwner.js +1 -1
- package/lib/client/clientHelper.js +1 -5
- package/lib/client/connection.js +1 -1
- package/lib/client/consoleMessage.js +1 -1
- package/lib/client/electron.js +0 -3
- package/lib/client/events.js +0 -1
- package/lib/client/frame.js +1 -2
- package/lib/client/harRouter.js +1 -7
- package/lib/client/page.js +6 -25
- package/lib/common/debugLogger.js +0 -1
- package/lib/common/socksProxy.js +1 -1
- package/lib/generated/consoleApiSource.js +1 -1
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/generated/recorderSource.js +1 -1
- package/lib/outofprocess.js +1 -1
- package/lib/protocol/validator.js +29 -46
- package/lib/remote/playwrightConnection.js +1 -1
- package/lib/remote/playwrightServer.js +166 -72
- package/lib/server/android/android.js +1 -1
- package/lib/server/browserType.js +2 -2
- package/lib/server/chromium/chromium.js +4 -5
- package/lib/server/chromium/crConnection.js +1 -1
- package/lib/server/chromium/crPage.js +2 -45
- package/lib/server/console.js +3 -1
- package/lib/server/debugController.js +3 -0
- package/lib/server/deviceDescriptorsSource.json +50 -50
- package/lib/server/dispatchers/browserContextDispatcher.js +2 -3
- package/lib/server/dispatchers/dispatcher.js +10 -9
- package/lib/server/dispatchers/electronDispatcher.js +0 -13
- package/lib/server/dispatchers/frameDispatcher.js +6 -0
- package/lib/server/dispatchers/pageDispatcher.js +10 -14
- package/lib/server/dom.js +167 -130
- package/lib/server/electron/electron.js +12 -38
- package/lib/server/electron/loader.js +2 -4
- package/lib/server/firefox/ffAccessibility.js +1 -2
- package/lib/server/firefox/ffConnection.js +1 -1
- package/lib/server/firefox/ffPage.js +1 -1
- package/lib/server/frames.js +20 -39
- package/lib/server/helper.js +1 -1
- package/lib/server/page.js +5 -49
- package/lib/server/pipeTransport.js +1 -1
- package/lib/server/playwright.js +1 -1
- package/lib/server/progress.js +11 -3
- package/lib/server/recorder/csharp.js +1 -1
- package/lib/server/recorder.js +1 -1
- package/lib/server/registry/browserFetcher.js +1 -1
- package/lib/server/registry/dependencies.js +4 -5
- package/lib/server/registry/index.js +30 -48
- package/lib/server/registry/nativeDeps.js +94 -0
- package/lib/server/trace/recorder/snapshotter.js +1 -1
- package/lib/server/trace/recorder/tracing.js +2 -5
- package/lib/server/trace/viewer/traceViewer.js +1 -1
- package/lib/server/transport.js +2 -4
- package/lib/server/webkit/wkConnection.js +1 -1
- package/lib/server/webkit/wkPage.js +2 -2
- package/lib/utils/comparators.js +4 -4
- package/lib/utils/fileUtils.js +0 -4
- package/lib/utils/hostPlatform.js +1 -1
- package/lib/utils/index.js +0 -11
- package/lib/utils/isomorphic/locatorParser.js +4 -6
- package/lib/utils/network.js +0 -33
- package/lib/utils/processLauncher.js +0 -7
- package/lib/vite/htmlReport/index.html +11 -11
- package/lib/vite/traceViewer/assets/codeMirrorModule-2mdjgmqe.js +24 -0
- package/lib/vite/traceViewer/assets/codeMirrorModule-GJA8DRmd.js +24 -0
- package/lib/vite/traceViewer/assets/wsPort-93o0i57c.js +69 -0
- package/lib/vite/traceViewer/assets/wsPort-qI0zJPR7.js +69 -0
- package/lib/vite/traceViewer/index.LR1HufLs.js +2 -0
- package/lib/vite/traceViewer/index.Ox-CymYJ.js +2 -0
- package/lib/vite/traceViewer/index.html +3 -3
- package/lib/vite/traceViewer/sw.bundle.js +4 -4
- package/lib/vite/traceViewer/uiMode.YGPXSUMv.js +10 -0
- package/lib/vite/traceViewer/uiMode.YYFJGvtV.js +10 -0
- package/lib/vite/traceViewer/uiMode.html +3 -3
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
21
21
|
var util = _interopRequireWildcard(require("util"));
|
|
22
22
|
var fs = _interopRequireWildcard(require("fs"));
|
|
23
23
|
var _utilsBundle = require("../../utilsBundle");
|
|
24
|
+
var _linuxUtils = require("../../utils/linuxUtils");
|
|
24
25
|
var _network = require("../../utils/network");
|
|
25
26
|
var _userAgent = require("../../utils/userAgent");
|
|
26
27
|
var _utils = require("../../utils");
|
|
@@ -29,7 +30,6 @@ var _hostPlatform = require("../../utils/hostPlatform");
|
|
|
29
30
|
var _spawnAsync = require("../../utils/spawnAsync");
|
|
30
31
|
var _dependencies = require("./dependencies");
|
|
31
32
|
var _browserFetcher = require("./browserFetcher");
|
|
32
|
-
var _debugLogger = require("../../utils/debugLogger");
|
|
33
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
34
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
35
35
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -84,10 +84,10 @@ const EXECUTABLE_PATHS = {
|
|
|
84
84
|
const DOWNLOAD_PATHS = {
|
|
85
85
|
'chromium': {
|
|
86
86
|
'<unknown>': undefined,
|
|
87
|
-
'ubuntu18.04-x64':
|
|
87
|
+
'ubuntu18.04-x64': 'builds/chromium/%s/chromium-linux.zip',
|
|
88
88
|
'ubuntu20.04-x64': 'builds/chromium/%s/chromium-linux.zip',
|
|
89
89
|
'ubuntu22.04-x64': 'builds/chromium/%s/chromium-linux.zip',
|
|
90
|
-
'ubuntu18.04-arm64':
|
|
90
|
+
'ubuntu18.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
|
|
91
91
|
'ubuntu20.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
|
|
92
92
|
'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-linux-arm64.zip',
|
|
93
93
|
'debian11-x64': 'builds/chromium/%s/chromium-linux.zip',
|
|
@@ -107,10 +107,10 @@ const DOWNLOAD_PATHS = {
|
|
|
107
107
|
},
|
|
108
108
|
'chromium-tip-of-tree': {
|
|
109
109
|
'<unknown>': undefined,
|
|
110
|
-
'ubuntu18.04-x64':
|
|
110
|
+
'ubuntu18.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
|
|
111
111
|
'ubuntu20.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
|
|
112
112
|
'ubuntu22.04-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
|
|
113
|
-
'ubuntu18.04-arm64':
|
|
113
|
+
'ubuntu18.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
|
|
114
114
|
'ubuntu20.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
|
|
115
115
|
'ubuntu22.04-arm64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux-arm64.zip',
|
|
116
116
|
'debian11-x64': 'builds/chromium-tip-of-tree/%s/chromium-tip-of-tree-linux.zip',
|
|
@@ -130,10 +130,10 @@ const DOWNLOAD_PATHS = {
|
|
|
130
130
|
},
|
|
131
131
|
'chromium-with-symbols': {
|
|
132
132
|
'<unknown>': undefined,
|
|
133
|
-
'ubuntu18.04-x64':
|
|
133
|
+
'ubuntu18.04-x64': 'builds/chromium/%s/chromium-with-symbols-linux.zip',
|
|
134
134
|
'ubuntu20.04-x64': 'builds/chromium/%s/chromium-with-symbols-linux.zip',
|
|
135
135
|
'ubuntu22.04-x64': 'builds/chromium/%s/chromium-with-symbols-linux.zip',
|
|
136
|
-
'ubuntu18.04-arm64':
|
|
136
|
+
'ubuntu18.04-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip',
|
|
137
137
|
'ubuntu20.04-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip',
|
|
138
138
|
'ubuntu22.04-arm64': 'builds/chromium/%s/chromium-with-symbols-linux-arm64.zip',
|
|
139
139
|
'debian11-x64': 'builds/chromium/%s/chromium-with-symbols-linux.zip',
|
|
@@ -153,7 +153,7 @@ const DOWNLOAD_PATHS = {
|
|
|
153
153
|
},
|
|
154
154
|
'firefox': {
|
|
155
155
|
'<unknown>': undefined,
|
|
156
|
-
'ubuntu18.04-x64':
|
|
156
|
+
'ubuntu18.04-x64': 'builds/firefox/%s/firefox-ubuntu-18.04.zip',
|
|
157
157
|
'ubuntu20.04-x64': 'builds/firefox/%s/firefox-ubuntu-20.04.zip',
|
|
158
158
|
'ubuntu22.04-x64': 'builds/firefox/%s/firefox-ubuntu-22.04.zip',
|
|
159
159
|
'ubuntu18.04-arm64': undefined,
|
|
@@ -176,7 +176,7 @@ const DOWNLOAD_PATHS = {
|
|
|
176
176
|
},
|
|
177
177
|
'firefox-beta': {
|
|
178
178
|
'<unknown>': undefined,
|
|
179
|
-
'ubuntu18.04-x64':
|
|
179
|
+
'ubuntu18.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-18.04.zip',
|
|
180
180
|
'ubuntu20.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-20.04.zip',
|
|
181
181
|
'ubuntu22.04-x64': 'builds/firefox-beta/%s/firefox-beta-ubuntu-22.04.zip',
|
|
182
182
|
'ubuntu18.04-arm64': undefined,
|
|
@@ -222,7 +222,7 @@ const DOWNLOAD_PATHS = {
|
|
|
222
222
|
},
|
|
223
223
|
'webkit': {
|
|
224
224
|
'<unknown>': undefined,
|
|
225
|
-
'ubuntu18.04-x64':
|
|
225
|
+
'ubuntu18.04-x64': 'builds/deprecated-webkit-ubuntu-18.04/%s/deprecated-webkit-ubuntu-18.04.zip',
|
|
226
226
|
'ubuntu20.04-x64': 'builds/webkit/%s/webkit-ubuntu-20.04.zip',
|
|
227
227
|
'ubuntu22.04-x64': 'builds/webkit/%s/webkit-ubuntu-22.04.zip',
|
|
228
228
|
'ubuntu18.04-arm64': undefined,
|
|
@@ -245,10 +245,10 @@ const DOWNLOAD_PATHS = {
|
|
|
245
245
|
},
|
|
246
246
|
'ffmpeg': {
|
|
247
247
|
'<unknown>': undefined,
|
|
248
|
-
'ubuntu18.04-x64':
|
|
248
|
+
'ubuntu18.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
|
|
249
249
|
'ubuntu20.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
|
|
250
250
|
'ubuntu22.04-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
|
|
251
|
-
'ubuntu18.04-arm64':
|
|
251
|
+
'ubuntu18.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
|
|
252
252
|
'ubuntu20.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
|
|
253
253
|
'ubuntu22.04-arm64': 'builds/ffmpeg/%s/ffmpeg-linux-arm64.zip',
|
|
254
254
|
'debian11-x64': 'builds/ffmpeg/%s/ffmpeg-linux.zip',
|
|
@@ -268,10 +268,10 @@ const DOWNLOAD_PATHS = {
|
|
|
268
268
|
},
|
|
269
269
|
'android': {
|
|
270
270
|
'<unknown>': 'builds/android/%s/android.zip',
|
|
271
|
-
'ubuntu18.04-x64':
|
|
271
|
+
'ubuntu18.04-x64': 'builds/android/%s/android.zip',
|
|
272
272
|
'ubuntu20.04-x64': 'builds/android/%s/android.zip',
|
|
273
273
|
'ubuntu22.04-x64': 'builds/android/%s/android.zip',
|
|
274
|
-
'ubuntu18.04-arm64':
|
|
274
|
+
'ubuntu18.04-arm64': 'builds/android/%s/android.zip',
|
|
275
275
|
'ubuntu20.04-arm64': 'builds/android/%s/android.zip',
|
|
276
276
|
'ubuntu22.04-arm64': 'builds/android/%s/android.zip',
|
|
277
277
|
'debian11-x64': 'builds/android/%s/android.zip',
|
|
@@ -374,7 +374,7 @@ class Registry {
|
|
|
374
374
|
executablePath: () => chromiumExecutable,
|
|
375
375
|
executablePathOrDie: sdkLanguage => executablePathOrDie('chromium', chromiumExecutable, chromium.installByDefault, sdkLanguage),
|
|
376
376
|
installType: chromium.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
377
|
-
|
|
377
|
+
validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'chromium', chromium.dir, ['chrome-linux'], [], ['chrome-win']),
|
|
378
378
|
downloadURLs: this._downloadURLs(chromium),
|
|
379
379
|
browserVersion: chromium.browserVersion,
|
|
380
380
|
_install: () => this._downloadExecutable(chromium, chromiumExecutable),
|
|
@@ -391,7 +391,7 @@ class Registry {
|
|
|
391
391
|
executablePath: () => chromiumWithSymbolsExecutable,
|
|
392
392
|
executablePathOrDie: sdkLanguage => executablePathOrDie('chromium-with-symbols', chromiumWithSymbolsExecutable, chromiumWithSymbols.installByDefault, sdkLanguage),
|
|
393
393
|
installType: chromiumWithSymbols.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
394
|
-
|
|
394
|
+
validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'chromium', chromiumWithSymbols.dir, ['chrome-linux'], [], ['chrome-win']),
|
|
395
395
|
downloadURLs: this._downloadURLs(chromiumWithSymbols),
|
|
396
396
|
browserVersion: chromiumWithSymbols.browserVersion,
|
|
397
397
|
_install: () => this._downloadExecutable(chromiumWithSymbols, chromiumWithSymbolsExecutable),
|
|
@@ -408,7 +408,7 @@ class Registry {
|
|
|
408
408
|
executablePath: () => chromiumTipOfTreeExecutable,
|
|
409
409
|
executablePathOrDie: sdkLanguage => executablePathOrDie('chromium-tip-of-tree', chromiumTipOfTreeExecutable, chromiumTipOfTree.installByDefault, sdkLanguage),
|
|
410
410
|
installType: chromiumTipOfTree.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
411
|
-
|
|
411
|
+
validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'chromium', chromiumTipOfTree.dir, ['chrome-linux'], [], ['chrome-win']),
|
|
412
412
|
downloadURLs: this._downloadURLs(chromiumTipOfTree),
|
|
413
413
|
browserVersion: chromiumTipOfTree.browserVersion,
|
|
414
414
|
_install: () => this._downloadExecutable(chromiumTipOfTree, chromiumTipOfTreeExecutable),
|
|
@@ -485,7 +485,7 @@ class Registry {
|
|
|
485
485
|
executablePath: () => firefoxExecutable,
|
|
486
486
|
executablePathOrDie: sdkLanguage => executablePathOrDie('firefox', firefoxExecutable, firefox.installByDefault, sdkLanguage),
|
|
487
487
|
installType: firefox.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
488
|
-
|
|
488
|
+
validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'firefox', firefox.dir, ['firefox'], [], ['firefox']),
|
|
489
489
|
downloadURLs: this._downloadURLs(firefox),
|
|
490
490
|
browserVersion: firefox.browserVersion,
|
|
491
491
|
_install: () => this._downloadExecutable(firefox, firefoxExecutable),
|
|
@@ -502,7 +502,7 @@ class Registry {
|
|
|
502
502
|
executablePath: () => firefoxAsanExecutable,
|
|
503
503
|
executablePathOrDie: sdkLanguage => executablePathOrDie('firefox-asan', firefoxAsanExecutable, firefoxAsan.installByDefault, sdkLanguage),
|
|
504
504
|
installType: firefoxAsan.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
505
|
-
|
|
505
|
+
validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'firefox', firefoxAsan.dir, ['firefox'], [], ['firefox']),
|
|
506
506
|
downloadURLs: this._downloadURLs(firefoxAsan),
|
|
507
507
|
browserVersion: firefoxAsan.browserVersion,
|
|
508
508
|
_install: () => this._downloadExecutable(firefoxAsan, firefoxAsanExecutable),
|
|
@@ -519,7 +519,7 @@ class Registry {
|
|
|
519
519
|
executablePath: () => firefoxBetaExecutable,
|
|
520
520
|
executablePathOrDie: sdkLanguage => executablePathOrDie('firefox-beta', firefoxBetaExecutable, firefoxBeta.installByDefault, sdkLanguage),
|
|
521
521
|
installType: firefoxBeta.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
522
|
-
|
|
522
|
+
validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'firefox', firefoxBeta.dir, ['firefox'], [], ['firefox']),
|
|
523
523
|
downloadURLs: this._downloadURLs(firefoxBeta),
|
|
524
524
|
browserVersion: firefoxBeta.browserVersion,
|
|
525
525
|
_install: () => this._downloadExecutable(firefoxBeta, firefoxBetaExecutable),
|
|
@@ -537,7 +537,7 @@ class Registry {
|
|
|
537
537
|
executablePath: () => webkitExecutable,
|
|
538
538
|
executablePathOrDie: sdkLanguage => executablePathOrDie('webkit', webkitExecutable, webkit.installByDefault, sdkLanguage),
|
|
539
539
|
installType: webkit.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
540
|
-
|
|
540
|
+
validateHostRequirements: sdkLanguage => this._validateHostRequirements(sdkLanguage, 'webkit', webkit.dir, webkitLinuxLddDirectories, ['libGLESv2.so.2', 'libx264.so'], ['']),
|
|
541
541
|
downloadURLs: this._downloadURLs(webkit),
|
|
542
542
|
browserVersion: webkit.browserVersion,
|
|
543
543
|
_install: () => this._downloadExecutable(webkit, webkitExecutable),
|
|
@@ -554,7 +554,7 @@ class Registry {
|
|
|
554
554
|
executablePath: () => ffmpegExecutable,
|
|
555
555
|
executablePathOrDie: sdkLanguage => executablePathOrDie('ffmpeg', ffmpegExecutable, ffmpeg.installByDefault, sdkLanguage),
|
|
556
556
|
installType: ffmpeg.installByDefault ? 'download-by-default' : 'download-on-demand',
|
|
557
|
-
|
|
557
|
+
validateHostRequirements: () => Promise.resolve(),
|
|
558
558
|
downloadURLs: this._downloadURLs(ffmpeg),
|
|
559
559
|
_install: () => this._downloadExecutable(ffmpeg, ffmpegExecutable),
|
|
560
560
|
_dependencyGroup: 'tools',
|
|
@@ -569,7 +569,7 @@ class Registry {
|
|
|
569
569
|
executablePath: () => undefined,
|
|
570
570
|
executablePathOrDie: () => '',
|
|
571
571
|
installType: 'download-on-demand',
|
|
572
|
-
|
|
572
|
+
validateHostRequirements: () => Promise.resolve(),
|
|
573
573
|
downloadURLs: this._downloadURLs(android),
|
|
574
574
|
_install: () => this._downloadExecutable(android),
|
|
575
575
|
_dependencyGroup: 'tools',
|
|
@@ -601,7 +601,7 @@ class Registry {
|
|
|
601
601
|
executablePath: sdkLanguage => executablePath(sdkLanguage, false),
|
|
602
602
|
executablePathOrDie: sdkLanguage => executablePath(sdkLanguage, true),
|
|
603
603
|
installType: install ? 'install-script' : 'none',
|
|
604
|
-
|
|
604
|
+
validateHostRequirements: () => Promise.resolve(),
|
|
605
605
|
_isHermeticInstallation: false,
|
|
606
606
|
_install: install
|
|
607
607
|
};
|
|
@@ -624,6 +624,12 @@ class Registry {
|
|
|
624
624
|
return Array.from(set);
|
|
625
625
|
}
|
|
626
626
|
async _validateHostRequirements(sdkLanguage, browserName, browserDirectory, linuxLddDirectories, dlOpenLibraries, windowsExeAndDllDirectories) {
|
|
627
|
+
if ((0, _utils.getAsBooleanFromENV)('PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS')) {
|
|
628
|
+
process.stderr.write('Skipping host requirements validation logic because `PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS` env variable is set.\n');
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
const distributionInfo = await (0, _linuxUtils.getLinuxDistributionInfo)();
|
|
632
|
+
if (browserName === 'firefox' && (distributionInfo === null || distributionInfo === void 0 ? void 0 : distributionInfo.id) === 'ubuntu' && (distributionInfo === null || distributionInfo === void 0 ? void 0 : distributionInfo.version) === '16.04') throw new Error(`Cannot launch Firefox on Ubuntu 16.04! Minimum required Ubuntu version for Firefox browser is 20.04`);
|
|
627
633
|
if (os.platform() === 'linux') return await (0, _dependencies.validateDependenciesLinux)(sdkLanguage, linuxLddDirectories.map(d => _path.default.join(browserDirectory, d)), dlOpenLibraries);
|
|
628
634
|
if (os.platform() === 'win32' && os.arch() === 'x64') return await (0, _dependencies.validateDependenciesWindows)(windowsExeAndDllDirectories.map(d => _path.default.join(browserDirectory, d)));
|
|
629
635
|
}
|
|
@@ -706,30 +712,6 @@ class Registry {
|
|
|
706
712
|
numberOfBrowsersLeft: (await fs.promises.readdir(registryDirectory).catch(() => [])).filter(browserDirectory => isBrowserDirectory(browserDirectory)).length
|
|
707
713
|
};
|
|
708
714
|
}
|
|
709
|
-
async validateHostRequirementsForExecutablesIfNeeded(executables, sdkLanguage) {
|
|
710
|
-
if ((0, _utils.getAsBooleanFromENV)('PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS')) {
|
|
711
|
-
process.stderr.write('Skipping host requirements validation logic because `PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS` env variable is set.\n');
|
|
712
|
-
return;
|
|
713
|
-
}
|
|
714
|
-
for (const executable of executables) await this._validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage);
|
|
715
|
-
}
|
|
716
|
-
async _validateHostRequirementsForExecutableIfNeeded(executable, sdkLanguage) {
|
|
717
|
-
const kMaximumReValidationPeriod = 30 * 24 * 60 * 60 * 1000; // 30 days
|
|
718
|
-
// Executable does not require validation.
|
|
719
|
-
if (!executable.directory) return;
|
|
720
|
-
const markerFile = _path.default.join(executable.directory, 'DEPENDENCIES_VALIDATED');
|
|
721
|
-
// Executable is already validated.
|
|
722
|
-
if (await fs.promises.stat(markerFile).then(stat => Date.now() - stat.mtime.getTime() < kMaximumReValidationPeriod).catch(() => false)) return;
|
|
723
|
-
_debugLogger.debugLogger.log('install', `validating host requirements for "${executable.name}"`);
|
|
724
|
-
try {
|
|
725
|
-
await executable._validateHostRequirements(sdkLanguage);
|
|
726
|
-
_debugLogger.debugLogger.log('install', `validation passed for ${executable.name}`);
|
|
727
|
-
} catch (error) {
|
|
728
|
-
_debugLogger.debugLogger.log('install', `validation failed for ${executable.name}`);
|
|
729
|
-
throw error;
|
|
730
|
-
}
|
|
731
|
-
await fs.promises.writeFile(markerFile, '').catch(() => {});
|
|
732
|
-
}
|
|
733
715
|
_downloadURLs(descriptor) {
|
|
734
716
|
const paths = DOWNLOAD_PATHS[descriptor.name];
|
|
735
717
|
const downloadPathTemplate = paths[_hostPlatform.hostPlatform] || paths['<unknown>'];
|
|
@@ -25,6 +25,100 @@ exports.deps = void 0;
|
|
|
25
25
|
// ./utils/linux-browser-dependencies/run.sh ubuntu:20.04
|
|
26
26
|
|
|
27
27
|
const deps = exports.deps = {
|
|
28
|
+
'ubuntu18.04-x64': {
|
|
29
|
+
tools: ['xvfb', 'fonts-noto-color-emoji', 'ttf-unifont', 'libfontconfig', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'ttf-ubuntu-font-family'],
|
|
30
|
+
chromium: ['fonts-liberation', 'libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libgbm1', 'libglib2.0-0', 'libgtk-3-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxrandr2', 'libxshmfence1'],
|
|
31
|
+
firefox: ['ffmpeg', 'libatk1.0-0', 'libcairo-gobject2', 'libcairo2', 'libdbus-1-3', 'libdbus-glib-1-2', 'libfontconfig1', 'libfreetype6', 'libgdk-pixbuf2.0-0', 'libglib2.0-0', 'libgtk-3-0', 'libpango-1.0-0', 'libpangocairo-1.0-0', 'libpangoft2-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb-shm0', 'libxcb1', 'libxcomposite1', 'libxcursor1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxi6', 'libxrender1', 'libxt6', 'libxtst6'],
|
|
32
|
+
webkit: [],
|
|
33
|
+
lib2package: {
|
|
34
|
+
'libasound.so.2': 'libasound2',
|
|
35
|
+
'libatk-1.0.so.0': 'libatk1.0-0',
|
|
36
|
+
'libatk-bridge-2.0.so.0': 'libatk-bridge2.0-0',
|
|
37
|
+
'libatspi.so.0': 'libatspi2.0-0',
|
|
38
|
+
'libbrotlidec.so.1': 'libbrotli1',
|
|
39
|
+
'libcairo-gobject.so.2': 'libcairo-gobject2',
|
|
40
|
+
'libcairo.so.2': 'libcairo2',
|
|
41
|
+
'libcups.so.2': 'libcups2',
|
|
42
|
+
'libdbus-1.so.3': 'libdbus-1-3',
|
|
43
|
+
'libdbus-glib-1.so.2': 'libdbus-glib-1-2',
|
|
44
|
+
'libdrm.so.2': 'libdrm2',
|
|
45
|
+
'libEGL.so.1': 'libegl1',
|
|
46
|
+
'libenchant.so.1': 'libenchant1c2a',
|
|
47
|
+
'libepoxy.so.0': 'libepoxy0',
|
|
48
|
+
'libevent-2.1.so.6': 'libevent-2.1-6',
|
|
49
|
+
'libevdev.so.2': 'libevdev2',
|
|
50
|
+
'libfontconfig.so.1': 'libfontconfig1',
|
|
51
|
+
'libfreetype.so.6': 'libfreetype6',
|
|
52
|
+
'libgbm.so.1': 'libgbm1',
|
|
53
|
+
'libgdk_pixbuf-2.0.so.0': 'libgdk-pixbuf2.0-0',
|
|
54
|
+
'libgdk-3.so.0': 'libgtk-3-0',
|
|
55
|
+
'libgdk-x11-2.0.so.0': 'libgtk2.0-0',
|
|
56
|
+
'libgio-2.0.so.0': 'libglib2.0-0',
|
|
57
|
+
'libGL.so.1': 'libgl1',
|
|
58
|
+
'libGLESv2.so.2': 'libgles2',
|
|
59
|
+
'libglib-2.0.so.0': 'libglib2.0-0',
|
|
60
|
+
'libgmodule-2.0.so.0': 'libglib2.0-0',
|
|
61
|
+
'libgobject-2.0.so.0': 'libglib2.0-0',
|
|
62
|
+
'libgstapp-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
63
|
+
'libgstaudio-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
64
|
+
'libgstbase-1.0.so.0': 'libgstreamer1.0-0',
|
|
65
|
+
'libgstcodecparsers-1.0.so.0': 'gstreamer1.0-plugins-bad',
|
|
66
|
+
'libgstfft-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
67
|
+
'libgstgl-1.0.so.0': 'libgstreamer-gl1.0-0',
|
|
68
|
+
'libgstpbutils-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
69
|
+
'libgstreamer-1.0.so.0': 'libgstreamer1.0-0',
|
|
70
|
+
'libgsttag-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
71
|
+
'libgstvideo-1.0.so.0': 'gstreamer1.0-plugins-base',
|
|
72
|
+
'libgthread-2.0.so.0': 'libglib2.0-0',
|
|
73
|
+
'libgtk-3.so.0': 'libgtk-3-0',
|
|
74
|
+
'libgtk-x11-2.0.so.0': 'libgtk2.0-0',
|
|
75
|
+
'libharfbuzz-icu.so.0': 'libharfbuzz-icu0',
|
|
76
|
+
'libharfbuzz.so.0': 'libharfbuzz0b',
|
|
77
|
+
'libhyphen.so.0': 'libhyphen0',
|
|
78
|
+
'libicudata.so.60': 'libicu60',
|
|
79
|
+
'libicui18n.so.60': 'libicu60',
|
|
80
|
+
'libicuuc.so.60': 'libicu60',
|
|
81
|
+
'libjpeg.so.8': 'libjpeg-turbo8',
|
|
82
|
+
'libnotify.so.4': 'libnotify4',
|
|
83
|
+
'libnspr4.so': 'libnspr4',
|
|
84
|
+
'libnss3.so': 'libnss3',
|
|
85
|
+
'libnssutil3.so': 'libnss3',
|
|
86
|
+
'libopenjp2.so.7': 'libopenjp2-7',
|
|
87
|
+
'libopus.so.0': 'libopus0',
|
|
88
|
+
'libpango-1.0.so.0': 'libpango-1.0-0',
|
|
89
|
+
'libpangocairo-1.0.so.0': 'libpangocairo-1.0-0',
|
|
90
|
+
'libpangoft2-1.0.so.0': 'libpangoft2-1.0-0',
|
|
91
|
+
'libpng16.so.16': 'libpng16-16',
|
|
92
|
+
'libsecret-1.so.0': 'libsecret-1-0',
|
|
93
|
+
'libsmime3.so': 'libnss3',
|
|
94
|
+
'libvpx.so.5': 'libvpx5',
|
|
95
|
+
'libwayland-client.so.0': 'libwayland-client0',
|
|
96
|
+
'libwayland-egl.so.1': 'libwayland-egl1',
|
|
97
|
+
'libwayland-server.so.0': 'libwayland-server0',
|
|
98
|
+
'libwebp.so.6': 'libwebp6',
|
|
99
|
+
'libwebpdemux.so.2': 'libwebpdemux2',
|
|
100
|
+
'libwoff2dec.so.1.0.2': 'libwoff1',
|
|
101
|
+
'libX11-xcb.so.1': 'libx11-xcb1',
|
|
102
|
+
'libX11.so.6': 'libx11-6',
|
|
103
|
+
'libxcb-dri3.so.0': 'libxcb-dri3-0',
|
|
104
|
+
'libxcb-shm.so.0': 'libxcb-shm0',
|
|
105
|
+
'libxcb.so.1': 'libxcb1',
|
|
106
|
+
'libXcomposite.so.1': 'libxcomposite1',
|
|
107
|
+
'libXcursor.so.1': 'libxcursor1',
|
|
108
|
+
'libXdamage.so.1': 'libxdamage1',
|
|
109
|
+
'libXext.so.6': 'libxext6',
|
|
110
|
+
'libXfixes.so.3': 'libxfixes3',
|
|
111
|
+
'libXi.so.6': 'libxi6',
|
|
112
|
+
'libxkbcommon.so.0': 'libxkbcommon0',
|
|
113
|
+
'libxml2.so.2': 'libxml2',
|
|
114
|
+
'libXrandr.so.2': 'libxrandr2',
|
|
115
|
+
'libXrender.so.1': 'libxrender1',
|
|
116
|
+
'libxslt.so.1': 'libxslt1.1',
|
|
117
|
+
'libXt.so.6': 'libxt6',
|
|
118
|
+
'libXtst.so.6': 'libxtst6',
|
|
119
|
+
'libevent-2.1-6': 'libevent-2.1-6'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
28
122
|
'ubuntu20.04-x64': {
|
|
29
123
|
tools: ['xvfb', 'fonts-noto-color-emoji', 'ttf-unifont', 'libfontconfig', 'libfreetype6', 'xfonts-cyrillic', 'xfonts-scalable', 'fonts-liberation', 'fonts-ipafont-gothic', 'fonts-wqy-zenhei', 'fonts-tlwg-loma-otf', 'ttf-ubuntu-font-family'],
|
|
30
124
|
chromium: ['fonts-liberation', 'libasound2', 'libatk-bridge2.0-0', 'libatk1.0-0', 'libatspi2.0-0', 'libcairo2', 'libcups2', 'libdbus-1-3', 'libdrm2', 'libegl1', 'libgbm1', 'libglib2.0-0', 'libgtk-3-0', 'libnspr4', 'libnss3', 'libpango-1.0-0', 'libx11-6', 'libx11-xcb1', 'libxcb1', 'libxcomposite1', 'libxdamage1', 'libxext6', 'libxfixes3', 'libxrandr2', 'libxshmfence1'],
|
|
@@ -7,7 +7,7 @@ exports.Snapshotter = void 0;
|
|
|
7
7
|
var _browserContext = require("../../browserContext");
|
|
8
8
|
var _page = require("../../page");
|
|
9
9
|
var _eventsHelper = require("../../../utils/eventsHelper");
|
|
10
|
-
var _debugLogger = require("../../../
|
|
10
|
+
var _debugLogger = require("../../../common/debugLogger");
|
|
11
11
|
var _snapshotterInjected = require("./snapshotterInjected");
|
|
12
12
|
var _utils = require("../../../utils");
|
|
13
13
|
var _utilsBundle = require("../../../utilsBundle");
|
|
@@ -20,7 +20,6 @@ var _page = require("../../page");
|
|
|
20
20
|
var _harTracer = require("../../har/harTracer");
|
|
21
21
|
var _snapshotter = require("./snapshotter");
|
|
22
22
|
var _zipBundle = require("../../../zipBundle");
|
|
23
|
-
var _dispatcher = require("../../dispatchers/dispatcher");
|
|
24
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
24
|
/**
|
|
26
25
|
* Copyright (c) Microsoft Corporation.
|
|
@@ -367,7 +366,6 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
367
366
|
});
|
|
368
367
|
}
|
|
369
368
|
_onConsoleMessage(message) {
|
|
370
|
-
var _message$page;
|
|
371
369
|
const event = {
|
|
372
370
|
type: 'console',
|
|
373
371
|
messageType: message.type(),
|
|
@@ -378,7 +376,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
378
376
|
})),
|
|
379
377
|
location: message.location(),
|
|
380
378
|
time: (0, _utils.monotonicTime)(),
|
|
381
|
-
pageId:
|
|
379
|
+
pageId: message.page().guid
|
|
382
380
|
};
|
|
383
381
|
this._appendTraceEvent(event);
|
|
384
382
|
}
|
|
@@ -417,8 +415,7 @@ class Tracing extends _instrumentation.SdkObject {
|
|
|
417
415
|
exports.Tracing = Tracing;
|
|
418
416
|
function visitTraceEvent(object, sha1s) {
|
|
419
417
|
if (Array.isArray(object)) return object.map(o => visitTraceEvent(o, sha1s));
|
|
420
|
-
if (object instanceof
|
|
421
|
-
if (object instanceof Buffer) return `<Buffer>`;
|
|
418
|
+
if (object instanceof Buffer) return undefined;
|
|
422
419
|
if (object instanceof Date) return object;
|
|
423
420
|
if (typeof object === 'object') {
|
|
424
421
|
const result = {};
|
|
@@ -168,7 +168,7 @@ async function openTraceInBrowser(traceUrls, options) {
|
|
|
168
168
|
} = await startTraceViewerServer(traceUrls, options);
|
|
169
169
|
// eslint-disable-next-line no-console
|
|
170
170
|
console.log('\nListening on ' + url);
|
|
171
|
-
if (!(0, _utils.isUnderTest)()) await (0, _utilsBundle.open)(url
|
|
171
|
+
if (!(0, _utils.isUnderTest)()) await (0, _utilsBundle.open)(url).catch(() => {});
|
|
172
172
|
}
|
|
173
173
|
class StdinServer {
|
|
174
174
|
constructor() {
|
package/lib/server/transport.js
CHANGED
|
@@ -83,10 +83,8 @@ class WebSocketTransport {
|
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
if (result.redirect) {
|
|
86
|
-
// Strip
|
|
87
|
-
const newHeaders = Object.fromEntries(Object.entries(headers || {}).filter(([name]) =>
|
|
88
|
-
return !name.includes('access-key') && name.toLowerCase() !== 'authorization';
|
|
89
|
-
}));
|
|
86
|
+
// Strip access key headers from the redirected request.
|
|
87
|
+
const newHeaders = Object.fromEntries(Object.entries(headers || {}).filter(([name]) => !name.includes('access-key')));
|
|
90
88
|
return WebSocketTransport._connect(progress, result.redirect.headers.location, newHeaders, {
|
|
91
89
|
follow: true,
|
|
92
90
|
hadRedirects: true
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.kPageProxyMessageReceived = exports.kBrowserCloseMessageId = exports.WKSession = exports.WKConnection = void 0;
|
|
7
7
|
var _events = require("events");
|
|
8
8
|
var _utils = require("../../utils");
|
|
9
|
-
var _debugLogger = require("../../
|
|
9
|
+
var _debugLogger = require("../../common/debugLogger");
|
|
10
10
|
var _helper = require("../helper");
|
|
11
11
|
var _protocolError = require("../protocolError");
|
|
12
12
|
/**
|
|
@@ -22,7 +22,7 @@ var _wkInput = require("./wkInput");
|
|
|
22
22
|
var _wkInterceptableRequest = require("./wkInterceptableRequest");
|
|
23
23
|
var _wkProvisionalPage = require("./wkProvisionalPage");
|
|
24
24
|
var _wkWorkers = require("./wkWorkers");
|
|
25
|
-
var _debugLogger = require("../../
|
|
25
|
+
var _debugLogger = require("../../common/debugLogger");
|
|
26
26
|
var _manualPromise = require("../../utils/manualPromise");
|
|
27
27
|
var _browserContext = require("../browserContext");
|
|
28
28
|
var _errors = require("../errors");
|
|
@@ -764,7 +764,7 @@ class WKPage {
|
|
|
764
764
|
scripts.push('delete window.ondevicemotion');
|
|
765
765
|
scripts.push('delete window.ondeviceorientation');
|
|
766
766
|
}
|
|
767
|
-
scripts.push('if (!window.safari) window.safari = {
|
|
767
|
+
scripts.push('if (!window.safari) window.safari = {};');
|
|
768
768
|
scripts.push('if (!window.GestureEvent) window.GestureEvent = function GestureEvent() {};');
|
|
769
769
|
for (const binding of this._page.allBindings()) scripts.push(binding.source);
|
|
770
770
|
scripts.push(...this._browserContext.initScripts);
|
package/lib/utils/comparators.js
CHANGED
|
@@ -49,7 +49,7 @@ function compareBuffersOrStrings(actualBuffer, expectedBuffer) {
|
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
51
|
function compareImages(mimeType, actualBuffer, expectedBuffer, options = {}) {
|
|
52
|
-
var _options$
|
|
52
|
+
var _options$_comparator, _ref;
|
|
53
53
|
if (!actualBuffer || !(actualBuffer instanceof Buffer)) return {
|
|
54
54
|
errorMessage: 'Actual result should be a Buffer.'
|
|
55
55
|
};
|
|
@@ -75,19 +75,19 @@ function compareImages(mimeType, actualBuffer, expectedBuffer, options = {}) {
|
|
|
75
75
|
height: size.height
|
|
76
76
|
});
|
|
77
77
|
let count;
|
|
78
|
-
if (options.
|
|
78
|
+
if (options._comparator === 'ssim-cie94') {
|
|
79
79
|
count = (0, _compare.compare)(expected.data, actual.data, diff.data, size.width, size.height, {
|
|
80
80
|
// All ΔE* formulae are originally designed to have the difference of 1.0 stand for a "just noticeable difference" (JND).
|
|
81
81
|
// See https://en.wikipedia.org/wiki/Color_difference#CIELAB_%CE%94E*
|
|
82
82
|
maxColorDeltaE94: 1.0
|
|
83
83
|
});
|
|
84
|
-
} else if (((_options$
|
|
84
|
+
} else if (((_options$_comparator = options._comparator) !== null && _options$_comparator !== void 0 ? _options$_comparator : 'pixelmatch') === 'pixelmatch') {
|
|
85
85
|
var _options$threshold;
|
|
86
86
|
count = pixelmatch(expected.data, actual.data, diff.data, size.width, size.height, {
|
|
87
87
|
threshold: (_options$threshold = options.threshold) !== null && _options$threshold !== void 0 ? _options$threshold : 0.2
|
|
88
88
|
});
|
|
89
89
|
} else {
|
|
90
|
-
throw new Error(`Configuration specifies unknown comparator "${options.
|
|
90
|
+
throw new Error(`Configuration specifies unknown comparator "${options._comparator}"`);
|
|
91
91
|
}
|
|
92
92
|
const maxDiffPixels1 = options.maxDiffPixels;
|
|
93
93
|
const maxDiffPixels2 = options.maxDiffPixelRatio !== undefined ? expected.width * expected.height * options.maxDiffPixelRatio : undefined;
|
package/lib/utils/fileUtils.js
CHANGED
|
@@ -9,7 +9,6 @@ exports.fileUploadSizeLimit = exports.existsAsync = void 0;
|
|
|
9
9
|
exports.mkdirIfNeeded = mkdirIfNeeded;
|
|
10
10
|
exports.removeFolders = removeFolders;
|
|
11
11
|
exports.sanitizeForFilePath = sanitizeForFilePath;
|
|
12
|
-
exports.toPosixPath = toPosixPath;
|
|
13
12
|
var _fs = _interopRequireDefault(require("fs"));
|
|
14
13
|
var _path = _interopRequireDefault(require("path"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -60,7 +59,4 @@ async function copyFileAndMakeWritable(from, to) {
|
|
|
60
59
|
}
|
|
61
60
|
function sanitizeForFilePath(s) {
|
|
62
61
|
return s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, '-');
|
|
63
|
-
}
|
|
64
|
-
function toPosixPath(aPath) {
|
|
65
|
-
return aPath.split(_path.default.sep).join(_path.default.posix.sep);
|
|
66
62
|
}
|
|
@@ -63,7 +63,7 @@ function calculatePlatform() {
|
|
|
63
63
|
const isOfficiallySupportedPlatform = (distroInfo === null || distroInfo === void 0 ? void 0 : distroInfo.id) === 'ubuntu';
|
|
64
64
|
if (parseInt(distroInfo.version, 10) <= 19) return {
|
|
65
65
|
hostPlatform: 'ubuntu18.04' + archSuffix,
|
|
66
|
-
isOfficiallySupportedPlatform
|
|
66
|
+
isOfficiallySupportedPlatform
|
|
67
67
|
};
|
|
68
68
|
if (parseInt(distroInfo.version, 10) <= 21) return {
|
|
69
69
|
hostPlatform: 'ubuntu20.04' + archSuffix,
|
package/lib/utils/index.js
CHANGED
|
@@ -201,17 +201,6 @@ Object.keys(_rtti).forEach(function (key) {
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
});
|
|
204
|
-
var _semaphore = require("./semaphore");
|
|
205
|
-
Object.keys(_semaphore).forEach(function (key) {
|
|
206
|
-
if (key === "default" || key === "__esModule") return;
|
|
207
|
-
if (key in exports && exports[key] === _semaphore[key]) return;
|
|
208
|
-
Object.defineProperty(exports, key, {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
get: function () {
|
|
211
|
-
return _semaphore[key];
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
204
|
var _spawnAsync = require("./spawnAsync");
|
|
216
205
|
Object.keys(_spawnAsync).forEach(function (key) {
|
|
217
206
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -167,13 +167,11 @@ function locatorOrSelectorAsSelector(language, locator, testIdAttributeName) {
|
|
|
167
167
|
preferredQuote
|
|
168
168
|
} = parseLocator(locator, testIdAttributeName);
|
|
169
169
|
const locators = (0, _locatorGenerators.asLocators)(language, selector, undefined, undefined, preferredQuote);
|
|
170
|
-
const digest = digestForComparison(
|
|
171
|
-
if (locators.some(candidate => digestForComparison(
|
|
170
|
+
const digest = digestForComparison(locator);
|
|
171
|
+
if (locators.some(candidate => digestForComparison(candidate) === digest)) return selector;
|
|
172
172
|
} catch (e) {}
|
|
173
173
|
return '';
|
|
174
174
|
}
|
|
175
|
-
function digestForComparison(
|
|
176
|
-
|
|
177
|
-
if (language === 'javascript') locator = locator.replace(/\\?["`]/g, '\'');
|
|
178
|
-
return locator;
|
|
175
|
+
function digestForComparison(locator) {
|
|
176
|
+
return locator.replace(/\s/g, '').replace(/["`]/g, '\'');
|
|
179
177
|
}
|
package/lib/utils/network.js
CHANGED
|
@@ -9,7 +9,6 @@ exports.createHttpServer = createHttpServer;
|
|
|
9
9
|
exports.createHttpsServer = createHttpsServer;
|
|
10
10
|
exports.fetchData = fetchData;
|
|
11
11
|
exports.httpRequest = httpRequest;
|
|
12
|
-
exports.isURLAvailable = isURLAvailable;
|
|
13
12
|
exports.urlMatches = urlMatches;
|
|
14
13
|
exports.urlMatchesEqual = urlMatchesEqual;
|
|
15
14
|
var _http = _interopRequireDefault(require("http"));
|
|
@@ -142,38 +141,6 @@ function createHttpsServer(...args) {
|
|
|
142
141
|
decorateServer(server);
|
|
143
142
|
return server;
|
|
144
143
|
}
|
|
145
|
-
async function isURLAvailable(url, ignoreHTTPSErrors, onLog, onStdErr) {
|
|
146
|
-
let statusCode = await httpStatusCode(url, ignoreHTTPSErrors, onLog, onStdErr);
|
|
147
|
-
if (statusCode === 404 && url.pathname === '/') {
|
|
148
|
-
const indexUrl = new URL(url);
|
|
149
|
-
indexUrl.pathname = '/index.html';
|
|
150
|
-
statusCode = await httpStatusCode(indexUrl, ignoreHTTPSErrors, onLog, onStdErr);
|
|
151
|
-
}
|
|
152
|
-
return statusCode >= 200 && statusCode < 404;
|
|
153
|
-
}
|
|
154
|
-
async function httpStatusCode(url, ignoreHTTPSErrors, onLog, onStdErr) {
|
|
155
|
-
return new Promise(resolve => {
|
|
156
|
-
onLog === null || onLog === void 0 || onLog(`HTTP HEAD: ${url}`);
|
|
157
|
-
httpRequest({
|
|
158
|
-
method: 'HEAD',
|
|
159
|
-
url: url.toString(),
|
|
160
|
-
headers: {
|
|
161
|
-
Accept: '*/*'
|
|
162
|
-
},
|
|
163
|
-
rejectUnauthorized: !ignoreHTTPSErrors
|
|
164
|
-
}, res => {
|
|
165
|
-
var _res$statusCode;
|
|
166
|
-
res.resume();
|
|
167
|
-
const statusCode = (_res$statusCode = res.statusCode) !== null && _res$statusCode !== void 0 ? _res$statusCode : 0;
|
|
168
|
-
onLog === null || onLog === void 0 || onLog(`HTTP Status: ${statusCode}`);
|
|
169
|
-
resolve(statusCode);
|
|
170
|
-
}, error => {
|
|
171
|
-
if (error.code === 'DEPTH_ZERO_SELF_SIGNED_CERT') onStdErr === null || onStdErr === void 0 || onStdErr(`[WebServer] Self-signed certificate detected. Try adding ignoreHTTPSErrors: true to config.webServer.`);
|
|
172
|
-
onLog === null || onLog === void 0 || onLog(`Error while checking if ${url} is available: ${error.message}`);
|
|
173
|
-
resolve(0);
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
144
|
function decorateServer(server) {
|
|
178
145
|
const sockets = new Set();
|
|
179
146
|
server.on('connection', socket => {
|
|
@@ -95,11 +95,6 @@ function addProcessHandlerIfNeeded(name) {
|
|
|
95
95
|
process.on(name, processHandlers[name]);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function removeProcessHandlersIfNeeded() {
|
|
99
|
-
if (killSet.size) return;
|
|
100
|
-
for (const handler of installedHandlers) process.off(handler, processHandlers[handler]);
|
|
101
|
-
installedHandlers.clear();
|
|
102
|
-
}
|
|
103
98
|
async function launchProcess(options) {
|
|
104
99
|
const stdio = options.stdio === 'pipe' ? ['ignore', 'pipe', 'pipe', 'pipe', 'pipe'] : ['pipe', 'pipe', 'pipe'];
|
|
105
100
|
options.log(`<launching> ${options.command} ${options.args ? options.args.join(' ') : ''}`);
|
|
@@ -154,7 +149,6 @@ async function launchProcess(options) {
|
|
|
154
149
|
processClosed = true;
|
|
155
150
|
gracefullyCloseSet.delete(gracefullyClose);
|
|
156
151
|
killSet.delete(killProcessAndCleanup);
|
|
157
|
-
removeProcessHandlersIfNeeded();
|
|
158
152
|
options.onExit(exitCode, signal);
|
|
159
153
|
// Cleanup as process exits.
|
|
160
154
|
cleanup().then(fulfillCleanup);
|
|
@@ -188,7 +182,6 @@ async function launchProcess(options) {
|
|
|
188
182
|
function killProcess() {
|
|
189
183
|
gracefullyCloseSet.delete(gracefullyClose);
|
|
190
184
|
killSet.delete(killProcessAndCleanup);
|
|
191
|
-
removeProcessHandlersIfNeeded();
|
|
192
185
|
options.log(`[pid=${spawnedProcess.pid}] <kill>`);
|
|
193
186
|
if (spawnedProcess.pid && !spawnedProcess.killed && !processClosed) {
|
|
194
187
|
options.log(`[pid=${spawnedProcess.pid}] <will force kill>`);
|