@checkly/playwright-core 1.41.2-beta.0 → 1.41.2-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.
- package/lib/browserServerImpl.js +1 -1
- package/lib/cli/cli.js +61 -0
- package/lib/cli/driver.js +3 -11
- package/lib/cli/program.js +5 -13
- package/lib/client/android.js +1 -1
- package/lib/client/artifact.js +2 -2
- package/lib/client/browserContext.js +5 -5
- package/lib/client/browserType.js +1 -1
- package/lib/client/channelOwner.js +3 -3
- package/lib/client/clientHelper.js +1 -5
- package/lib/client/connection.js +2 -2
- package/lib/client/consoleMessage.js +2 -2
- package/lib/client/fetch.js +3 -3
- package/lib/client/frame.js +3 -4
- package/lib/client/harRouter.js +1 -1
- package/lib/client/locator.js +2 -2
- package/lib/client/page.js +1 -24
- package/lib/common/debugLogger.js +90 -0
- package/lib/common/socksProxy.js +17 -12
- 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 +3 -3
- package/lib/protocol/validator.js +7 -13
- package/lib/remote/playwrightConnection.js +2 -2
- package/lib/remote/playwrightServer.js +166 -72
- package/lib/server/android/android.js +2 -2
- package/lib/server/android/backendAdb.js +2 -2
- package/lib/server/browser.js +2 -2
- package/lib/server/browserContext.js +9 -8
- package/lib/server/browserType.js +5 -5
- package/lib/server/chromium/chromium.js +1 -1
- package/lib/server/chromium/crBrowser.js +3 -2
- package/lib/server/chromium/crConnection.js +2 -2
- package/lib/server/chromium/crExecutionContext.js +2 -2
- package/lib/server/chromium/crInput.js +2 -2
- package/lib/server/chromium/crNetworkManager.js +23 -37
- package/lib/server/chromium/crPage.js +7 -48
- package/lib/server/chromium/crServiceWorker.js +3 -2
- package/lib/server/debugController.js +3 -0
- package/lib/server/deviceDescriptorsSource.json +50 -50
- package/lib/server/dispatchers/browserContextDispatcher.js +4 -4
- package/lib/server/dispatchers/dispatcher.js +10 -10
- package/lib/server/dispatchers/localUtilsDispatcher.js +4 -4
- package/lib/server/dispatchers/pageDispatcher.js +0 -12
- package/lib/server/dispatchers/playwrightDispatcher.js +5 -5
- package/lib/server/dispatchers/writableStreamDispatcher.js +2 -2
- package/lib/server/dom.js +170 -133
- package/lib/server/electron/electron.js +4 -5
- package/lib/server/electron/loader.js +2 -4
- package/lib/server/fetch.js +4 -4
- package/lib/server/firefox/ffBrowser.js +3 -3
- package/lib/server/firefox/ffConnection.js +1 -1
- package/lib/server/firefox/ffExecutionContext.js +2 -2
- package/lib/server/firefox/ffNetworkManager.js +7 -7
- package/lib/server/firefox/ffPage.js +5 -3
- package/lib/server/firefox/firefox.js +2 -2
- package/lib/server/frames.js +23 -31
- package/lib/server/har/harTracer.js +6 -6
- package/lib/server/helper.js +1 -1
- package/lib/server/input.js +2 -2
- package/lib/server/isomorphic/utilityScriptSerializers.js +1 -0
- package/lib/server/javascript.js +2 -2
- package/lib/server/network.js +23 -5
- package/lib/server/page.js +3 -44
- package/lib/server/pipeTransport.js +1 -1
- package/lib/server/playwright.js +1 -1
- package/lib/server/progress.js +14 -5
- package/lib/server/recorder/csharp.js +1 -1
- package/lib/server/recorder/recorderUtils.js +2 -2
- package/lib/server/recorder.js +14 -14
- package/lib/server/registry/browserFetcher.js +2 -1
- package/lib/server/registry/dependencies.js +6 -7
- package/lib/server/registry/index.js +33 -50
- package/lib/server/registry/nativeDeps.js +94 -0
- package/lib/server/registry/oopDownloadBrowserMain.js +2 -2
- package/lib/server/screenshotter.js +1 -0
- package/lib/server/socksInterceptor.js +2 -2
- package/lib/server/trace/recorder/snapshotter.js +2 -2
- package/lib/server/trace/recorder/tracing.js +9 -7
- package/lib/server/trace/test/inMemorySnapshotter.js +1 -1
- package/lib/server/trace/viewer/traceViewer.js +2 -2
- package/lib/server/transport.js +13 -15
- package/lib/server/webkit/wkBrowser.js +3 -3
- package/lib/server/webkit/wkConnection.js +1 -1
- package/lib/server/webkit/wkExecutionContext.js +2 -2
- package/lib/server/webkit/wkInput.js +2 -2
- package/lib/server/webkit/wkInterceptableRequest.js +2 -2
- package/lib/server/webkit/wkPage.js +12 -10
- package/lib/utils/fileUtils.js +0 -4
- package/lib/utils/happy-eyeballs.js +4 -5
- package/lib/utils/hostPlatform.js +1 -1
- package/lib/utils/index.js +0 -11
- package/lib/utils/isomorphic/cssParser.js +2 -2
- package/lib/utils/isomorphic/locatorParser.js +4 -6
- package/lib/utils/isomorphic/selectorParser.js +1 -0
- package/lib/utils/network.js +0 -33
- package/lib/utils/processLauncher.js +2 -9
- package/lib/utils/profiler.js +2 -2
- package/lib/utils/zipFile.js +1 -1
- package/lib/vite/htmlReport/index.html +13 -12
- package/lib/vite/recorder/assets/codeMirrorModule-2a26f817.js +24 -0
- package/lib/vite/recorder/assets/codeMirrorModule-5d0f417c.css +1 -0
- package/lib/vite/recorder/assets/{index-ljsTwXtJ.css → index-64ce22d5.css} +1 -1
- package/lib/vite/recorder/assets/index-bbf80321.js +41 -0
- package/lib/vite/recorder/index.html +3 -2
- package/lib/vite/{recorder/assets/codeMirrorModule-I9ks4y7D.js → traceViewer/assets/codeMirrorModule-56536a77.js} +13 -13
- package/lib/vite/traceViewer/assets/wsPort-722747dc.js +64 -0
- package/lib/vite/traceViewer/assets/xtermModule-443332e6.js +9 -0
- package/lib/vite/traceViewer/codeMirrorModule.5d0f417c.css +1 -0
- package/lib/vite/traceViewer/codicon.79f233d0.ttf +0 -0
- package/lib/vite/traceViewer/index.1a1fe659.css +1 -0
- package/lib/vite/traceViewer/index.d05939c9.js +2 -0
- package/lib/vite/traceViewer/index.html +5 -4
- package/lib/vite/traceViewer/sw.bundle.js +1 -1
- package/lib/vite/traceViewer/uiMode.8b41a49d.css +1 -0
- package/lib/vite/traceViewer/uiMode.8e0454c4.js +4 -0
- package/lib/vite/traceViewer/uiMode.html +5 -4
- package/lib/vite/traceViewer/wsPort.9c9a6767.css +1 -0
- package/lib/vite/traceViewer/xtermModule.6428296b.css +32 -0
- package/package.json +1 -1
- package/lib/vite/recorder/assets/codeMirrorModule-Hs9-1ZG4.css +0 -1
- package/lib/vite/recorder/assets/index-yg8ypzl6.js +0 -47
- /package/lib/vite/recorder/assets/{codicon-zGuYmc9o.ttf → codicon-79f233d0.ttf} +0 -0
package/lib/server/recorder.js
CHANGED
|
@@ -26,8 +26,8 @@ var _timeoutRunner = require("../utils/timeoutRunner");
|
|
|
26
26
|
var _locatorParser = require("../utils/isomorphic/locatorParser");
|
|
27
27
|
var _stringUtils = require("../utils/isomorphic/stringUtils");
|
|
28
28
|
var _eventsHelper = require("./../utils/eventsHelper");
|
|
29
|
-
function _getRequireWildcardCache(
|
|
30
|
-
function _interopRequireWildcard(
|
|
29
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
/**
|
|
32
32
|
* Copyright (c) Microsoft Corporation.
|
|
33
33
|
*
|
|
@@ -144,7 +144,7 @@ class Recorder {
|
|
|
144
144
|
var _this$_recorderApp;
|
|
145
145
|
this._recorderSources = data.sources;
|
|
146
146
|
this._pushAllSources();
|
|
147
|
-
(_this$_recorderApp = this._recorderApp) === null || _this$_recorderApp === void 0
|
|
147
|
+
(_this$_recorderApp = this._recorderApp) === null || _this$_recorderApp === void 0 ? void 0 : _this$_recorderApp.setFileIfNeeded(data.primaryFileName);
|
|
148
148
|
});
|
|
149
149
|
await this._context.exposeBinding('__pw_recorderState', false, source => {
|
|
150
150
|
let actionSelector = '';
|
|
@@ -213,7 +213,7 @@ class Recorder {
|
|
|
213
213
|
} of this._debugger.pausedDetails()) {
|
|
214
214
|
if (!this._currentCallsMetadata.has(metadata)) this.onBeforeCall(sdkObject, metadata);
|
|
215
215
|
}
|
|
216
|
-
(_this$_recorderApp3 = this._recorderApp) === null || _this$_recorderApp3 === void 0
|
|
216
|
+
(_this$_recorderApp3 = this._recorderApp) === null || _this$_recorderApp3 === void 0 ? void 0 : _this$_recorderApp3.setPaused(this._debugger.isPaused());
|
|
217
217
|
this._updateUserSources();
|
|
218
218
|
this.updateCallLog([...this._currentCallsMetadata.keys()]);
|
|
219
219
|
}
|
|
@@ -222,7 +222,7 @@ class Recorder {
|
|
|
222
222
|
if (this._mode === mode) return;
|
|
223
223
|
this._highlightedSelector = '';
|
|
224
224
|
this._mode = mode;
|
|
225
|
-
(_this$_recorderApp4 = this._recorderApp) === null || _this$_recorderApp4 === void 0
|
|
225
|
+
(_this$_recorderApp4 = this._recorderApp) === null || _this$_recorderApp4 === void 0 ? void 0 : _this$_recorderApp4.setMode(this._mode);
|
|
226
226
|
this._contextRecorder.setEnabled(this._mode === 'recording' || this._mode === 'assertingText' || this._mode === 'assertingVisibility' || this._mode === 'assertingValue');
|
|
227
227
|
this._debugger.setMuted(this._mode === 'recording' || this._mode === 'assertingText' || this._mode === 'assertingVisibility' || this._mode === 'assertingValue');
|
|
228
228
|
if (this._mode !== 'none' && this._mode !== 'standby' && this._context.pages().length === 1) this._context.pages()[0].bringToFront().catch(() => {});
|
|
@@ -258,7 +258,7 @@ class Recorder {
|
|
|
258
258
|
} else if (metadata.params && metadata.params.selector) {
|
|
259
259
|
var _this$_recorderApp5;
|
|
260
260
|
this._highlightedSelector = metadata.params.selector;
|
|
261
|
-
(_this$_recorderApp5 = this._recorderApp) === null || _this$_recorderApp5 === void 0
|
|
261
|
+
(_this$_recorderApp5 = this._recorderApp) === null || _this$_recorderApp5 === void 0 ? void 0 : _this$_recorderApp5.setSelector(this._highlightedSelector).catch(() => {});
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
async onAfterCall(sdkObject, metadata) {
|
|
@@ -306,11 +306,11 @@ class Recorder {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
this._pushAllSources();
|
|
309
|
-
if (fileToSelect) (_this$_recorderApp6 = this._recorderApp) === null || _this$_recorderApp6 === void 0
|
|
309
|
+
if (fileToSelect) (_this$_recorderApp6 = this._recorderApp) === null || _this$_recorderApp6 === void 0 ? void 0 : _this$_recorderApp6.setFileIfNeeded(fileToSelect);
|
|
310
310
|
}
|
|
311
311
|
_pushAllSources() {
|
|
312
312
|
var _this$_recorderApp7;
|
|
313
|
-
(_this$_recorderApp7 = this._recorderApp) === null || _this$_recorderApp7 === void 0
|
|
313
|
+
(_this$_recorderApp7 = this._recorderApp) === null || _this$_recorderApp7 === void 0 ? void 0 : _this$_recorderApp7.setSources([...this._recorderSources, ...this._userSources.values()]);
|
|
314
314
|
}
|
|
315
315
|
async onBeforeInputAction(sdkObject, metadata) {}
|
|
316
316
|
async onCallLog(sdkObject, metadata, logName, message) {
|
|
@@ -327,7 +327,7 @@ class Recorder {
|
|
|
327
327
|
if (this._debugger.isPaused(metadata)) status = 'paused';
|
|
328
328
|
logs.push((0, _recorderUtils.metadataToCallLog)(metadata, status));
|
|
329
329
|
}
|
|
330
|
-
(_this$_recorderApp8 = this._recorderApp) === null || _this$_recorderApp8 === void 0
|
|
330
|
+
(_this$_recorderApp8 = this._recorderApp) === null || _this$_recorderApp8 === void 0 ? void 0 : _this$_recorderApp8.updateCallLogs(logs);
|
|
331
331
|
}
|
|
332
332
|
_readSource(fileName) {
|
|
333
333
|
try {
|
|
@@ -384,7 +384,7 @@ class ContextRecorder extends _events.EventEmitter {
|
|
|
384
384
|
};
|
|
385
385
|
source.revealLine = text.split('\n').length - 1;
|
|
386
386
|
this._recorderSources.push(source);
|
|
387
|
-
if (languageGenerator === this._orderedLanguages[0]) (_this$_throttledOutpu = this._throttledOutputFile) === null || _this$_throttledOutpu === void 0
|
|
387
|
+
if (languageGenerator === this._orderedLanguages[0]) (_this$_throttledOutpu = this._throttledOutputFile) === null || _this$_throttledOutpu === void 0 ? void 0 : _this$_throttledOutpu.setContent(source.text);
|
|
388
388
|
}
|
|
389
389
|
this.emit(ContextRecorder.Events.Change, {
|
|
390
390
|
sources: this._recorderSources,
|
|
@@ -393,11 +393,11 @@ class ContextRecorder extends _events.EventEmitter {
|
|
|
393
393
|
});
|
|
394
394
|
context.on(_browserContext.BrowserContext.Events.BeforeClose, () => {
|
|
395
395
|
var _this$_throttledOutpu2;
|
|
396
|
-
(_this$_throttledOutpu2 = this._throttledOutputFile) === null || _this$_throttledOutpu2 === void 0
|
|
396
|
+
(_this$_throttledOutpu2 = this._throttledOutputFile) === null || _this$_throttledOutpu2 === void 0 ? void 0 : _this$_throttledOutpu2.flush();
|
|
397
397
|
});
|
|
398
398
|
this._listeners.push(_eventsHelper.eventsHelper.addEventListener(process, 'exit', () => {
|
|
399
399
|
var _this$_throttledOutpu3;
|
|
400
|
-
(_this$_throttledOutpu3 = this._throttledOutputFile) === null || _this$_throttledOutpu3 === void 0
|
|
400
|
+
(_this$_throttledOutpu3 = this._throttledOutputFile) === null || _this$_throttledOutpu3 === void 0 ? void 0 : _this$_throttledOutpu3.flush();
|
|
401
401
|
}));
|
|
402
402
|
this._generator = generator;
|
|
403
403
|
}
|
|
@@ -409,7 +409,7 @@ class ContextRecorder extends _events.EventEmitter {
|
|
|
409
409
|
languages.delete(primaryLanguage);
|
|
410
410
|
this._orderedLanguages = [primaryLanguage, ...languages];
|
|
411
411
|
this._throttledOutputFile = outputFile ? new ThrottledFile(outputFile) : null;
|
|
412
|
-
(_this$_generator = this._generator) === null || _this$_generator === void 0
|
|
412
|
+
(_this$_generator = this._generator) === null || _this$_generator === void 0 ? void 0 : _this$_generator.restart();
|
|
413
413
|
}
|
|
414
414
|
languageName(id) {
|
|
415
415
|
for (const lang of this._orderedLanguages) {
|
|
@@ -690,7 +690,7 @@ async function findFrameSelector(frame) {
|
|
|
690
690
|
const utility = await parent._utilityContext();
|
|
691
691
|
const injected = await utility.injectedScript();
|
|
692
692
|
const selector = await injected.evaluate((injected, element) => {
|
|
693
|
-
return injected.
|
|
693
|
+
return injected.generateSelector(element, {
|
|
694
694
|
testIdAttributeName: '',
|
|
695
695
|
omitInternalEngines: true
|
|
696
696
|
});
|
|
@@ -10,7 +10,7 @@ var _os = _interopRequireDefault(require("os"));
|
|
|
10
10
|
var _path = _interopRequireDefault(require("path"));
|
|
11
11
|
var _child_process = _interopRequireDefault(require("child_process"));
|
|
12
12
|
var _fileUtils = require("../../utils/fileUtils");
|
|
13
|
-
var _debugLogger = require("../../
|
|
13
|
+
var _debugLogger = require("../../common/debugLogger");
|
|
14
14
|
var _manualPromise = require("../../utils/manualPromise");
|
|
15
15
|
var _utilsBundle = require("../../utilsBundle");
|
|
16
16
|
var _ = require(".");
|
|
@@ -126,6 +126,7 @@ function logPolitely(toBeLogged) {
|
|
|
126
126
|
const logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel || '') > -1;
|
|
127
127
|
if (!logLevelDisplay) console.log(toBeLogged); // eslint-disable-line no-console
|
|
128
128
|
}
|
|
129
|
+
|
|
129
130
|
function getDownloadProgress() {
|
|
130
131
|
if (process.stdout.isTTY) return getAnimatedDownloadProgress();
|
|
131
132
|
return getBasicDownloadProgress();
|
|
@@ -21,8 +21,8 @@ var _hostPlatform = require("../../utils/hostPlatform");
|
|
|
21
21
|
var _ = require(".");
|
|
22
22
|
var _nativeDeps = require("./nativeDeps");
|
|
23
23
|
var _userAgent = require("../../utils/userAgent");
|
|
24
|
-
function _getRequireWildcardCache(
|
|
25
|
-
function _interopRequireWildcard(
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
/**
|
|
28
28
|
* Copyright (c) Microsoft Corporation.
|
|
@@ -166,7 +166,7 @@ async function validateDependenciesWindows(windowsExeAndDllDirectories) {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
async function validateDependenciesLinux(sdkLanguage, linuxLddDirectories, dlOpenLibraries) {
|
|
169
|
-
var _deps$hostPlatform
|
|
169
|
+
var _deps$hostPlatform;
|
|
170
170
|
const directoryPaths = linuxLddDirectories;
|
|
171
171
|
const lddPaths = [];
|
|
172
172
|
for (const directoryPath of directoryPaths) lddPaths.push(...(await executablesOrSharedLibraries(directoryPath)));
|
|
@@ -192,7 +192,7 @@ async function validateDependenciesLinux(sdkLanguage, linuxLddDirectories, dlOpe
|
|
|
192
192
|
missingDeps.delete(missingDep);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
const maybeSudo =
|
|
195
|
+
const maybeSudo = process.getuid() !== 0 && os.platform() !== 'win32' ? 'sudo ' : '';
|
|
196
196
|
const dockerInfo = readDockerVersionSync();
|
|
197
197
|
const errorLines = [`Host system is missing dependencies to run browsers.`];
|
|
198
198
|
// Ignore patch versions when comparing docker container version and Playwright version:
|
|
@@ -202,7 +202,7 @@ async function validateDependenciesLinux(sdkLanguage, linuxLddDirectories, dlOpe
|
|
|
202
202
|
// In this case, we know how to install dependencies in it.
|
|
203
203
|
const pwVersion = (0, _userAgent.getPlaywrightVersion)();
|
|
204
204
|
const requiredDockerImage = dockerInfo.dockerImageName.replace(dockerInfo.driverVersion, pwVersion);
|
|
205
|
-
errorLines.push(...[`This is most likely due to
|
|
205
|
+
errorLines.push(...[`This is most likely due to docker image version not matching Playwright version:`, `- Playwright: ${pwVersion}`, `- Docker: ${dockerInfo.driverVersion}`, ``, `Either:`, `- (recommended) use docker image "${requiredDockerImage}"`, `- (alternative 1) run the following command inside docker to install missing dependencies:`, ``, ` ${maybeSudo}${(0, _.buildPlaywrightCLICommand)(sdkLanguage, 'install-deps')}`, ``, `- (alternative 2) use apt inside docker:`, ``, ` ${maybeSudo}apt-get install ${[...missingPackages].join('\\\n ')}`, ``, `<3 Playwright Team`]);
|
|
206
206
|
} else if (missingPackages.size && !missingDeps.size) {
|
|
207
207
|
// Only known dependencies are missing for browsers.
|
|
208
208
|
// Suggest installation with a Playwright CLI.
|
|
@@ -301,8 +301,7 @@ function quoteProcessArgs(args) {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
async function transformCommandsForRoot(commands) {
|
|
304
|
-
|
|
305
|
-
const isRoot = ((_process$getuid2 = (_process2 = process).getuid) === null || _process$getuid2 === void 0 ? void 0 : _process$getuid2.call(_process2)) === 0;
|
|
304
|
+
const isRoot = process.getuid() === 0;
|
|
306
305
|
if (isRoot) return {
|
|
307
306
|
command: 'sh',
|
|
308
307
|
args: ['-c', `${commands.join('&& ')}`],
|
|
@@ -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,10 +30,9 @@ 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
|
-
function _getRequireWildcardCache(
|
|
35
|
-
function _interopRequireWildcard(
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
36
36
|
/**
|
|
37
37
|
* Copyright 2017 Google Inc. All rights reserved.
|
|
38
38
|
* Modifications copyright (c) Microsoft Corporation.
|
|
@@ -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>'];
|
|
@@ -897,6 +879,7 @@ async function installBrowsersForNpmInstall(browsers) {
|
|
|
897
879
|
}
|
|
898
880
|
await registry.install(executables, false /* forceReinstall */);
|
|
899
881
|
}
|
|
882
|
+
|
|
900
883
|
function findChromiumChannel(sdkLanguage) {
|
|
901
884
|
// Fall back to the stable channels of popular vendors to work out of the box.
|
|
902
885
|
// Null means no installation and no channels found.
|
|
@@ -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'],
|
|
@@ -24,7 +24,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
24
24
|
|
|
25
25
|
function log(message) {
|
|
26
26
|
var _process$send, _process;
|
|
27
|
-
(_process$send = (_process = process).send) === null || _process$send === void 0
|
|
27
|
+
(_process$send = (_process = process).send) === null || _process$send === void 0 ? void 0 : _process$send.call(_process, {
|
|
28
28
|
method: 'log',
|
|
29
29
|
params: {
|
|
30
30
|
message
|
|
@@ -33,7 +33,7 @@ function log(message) {
|
|
|
33
33
|
}
|
|
34
34
|
function progress(done, total) {
|
|
35
35
|
var _process$send2, _process2;
|
|
36
|
-
(_process$send2 = (_process2 = process).send) === null || _process$send2 === void 0
|
|
36
|
+
(_process$send2 = (_process2 = process).send) === null || _process$send2 === void 0 ? void 0 : _process$send2.call(_process2, {
|
|
37
37
|
method: 'progress',
|
|
38
38
|
params: {
|
|
39
39
|
done,
|
|
@@ -200,6 +200,7 @@ class Screenshotter {
|
|
|
200
200
|
progress.throwIfAborted(); // Do not do extra work.
|
|
201
201
|
|
|
202
202
|
await handle._waitAndScrollIntoViewIfNeeded(progress, true /* waitForVisible */);
|
|
203
|
+
|
|
203
204
|
progress.throwIfAborted(); // Do not do extra work.
|
|
204
205
|
const boundingBox = await handle.boundingBox();
|
|
205
206
|
(0, _utils.assert)(boundingBox, 'Node is either not visible or not an HTMLElement');
|
|
@@ -8,8 +8,8 @@ var socks = _interopRequireWildcard(require("../common/socksProxy"));
|
|
|
8
8
|
var _events = _interopRequireDefault(require("events"));
|
|
9
9
|
var _validator = require("../protocol/validator");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
13
|
/**
|
|
14
14
|
* Copyright (c) Microsoft Corporation.
|
|
15
15
|
*
|
|
@@ -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");
|
|
@@ -83,7 +83,7 @@ class Snapshotter {
|
|
|
83
83
|
const expression = `window["${this._snapshotStreamer}"].captureSnapshot(${JSON.stringify(snapshotName)})`;
|
|
84
84
|
|
|
85
85
|
// In a best-effort manner, without waiting for it, mark target element.
|
|
86
|
-
element === null || element === void 0
|
|
86
|
+
element === null || element === void 0 ? void 0 : element.callFunctionNoReply((element, callId) => {
|
|
87
87
|
const customEvent = new CustomEvent('__playwright_target__', {
|
|
88
88
|
bubbles: true,
|
|
89
89
|
cancelable: true,
|