easytouch-linux 1.0.6 → 1.0.7
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/.playwright/node/LICENSE +2607 -0
- package/.playwright/node/linux-x64/node +0 -0
- package/.playwright/package/README.md +3 -0
- package/.playwright/package/ThirdPartyNotices.txt +1602 -0
- package/.playwright/package/api.json +1 -0
- package/.playwright/package/bin/install_media_pack.ps1 +5 -0
- package/.playwright/package/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/.playwright/package/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/.playwright/package/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/.playwright/package/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/.playwright/package/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/.playwright/package/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/.playwright/package/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/.playwright/package/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/.playwright/package/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/.playwright/package/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/.playwright/package/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/.playwright/package/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/.playwright/package/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/.playwright/package/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/.playwright/package/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/.playwright/package/browsers.json +66 -0
- package/.playwright/package/cli.js +18 -0
- package/.playwright/package/index.d.ts +17 -0
- package/.playwright/package/index.js +33 -0
- package/.playwright/package/index.mjs +28 -0
- package/.playwright/package/lib/androidServerImpl.js +69 -0
- package/.playwright/package/lib/browserServerImpl.js +92 -0
- package/.playwright/package/lib/cli/driver.js +95 -0
- package/.playwright/package/lib/cli/program.js +583 -0
- package/.playwright/package/lib/cli/programWithTestStub.js +67 -0
- package/.playwright/package/lib/client/accessibility.js +50 -0
- package/.playwright/package/lib/client/android.js +473 -0
- package/.playwright/package/lib/client/api.js +285 -0
- package/.playwright/package/lib/client/artifact.js +79 -0
- package/.playwright/package/lib/client/browser.js +145 -0
- package/.playwright/package/lib/client/browserContext.js +559 -0
- package/.playwright/package/lib/client/browserType.js +241 -0
- package/.playwright/package/lib/client/cdpSession.js +53 -0
- package/.playwright/package/lib/client/channelOwner.js +215 -0
- package/.playwright/package/lib/client/clientHelper.js +57 -0
- package/.playwright/package/lib/client/clientInstrumentation.js +52 -0
- package/.playwright/package/lib/client/clock.js +68 -0
- package/.playwright/package/lib/client/connection.js +333 -0
- package/.playwright/package/lib/client/consoleMessage.js +55 -0
- package/.playwright/package/lib/client/coverage.js +41 -0
- package/.playwright/package/lib/client/dialog.js +57 -0
- package/.playwright/package/lib/client/download.js +62 -0
- package/.playwright/package/lib/client/electron.js +135 -0
- package/.playwright/package/lib/client/elementHandle.js +321 -0
- package/.playwright/package/lib/client/errors.js +77 -0
- package/.playwright/package/lib/client/eventEmitter.js +314 -0
- package/.playwright/package/lib/client/events.js +94 -0
- package/.playwright/package/lib/client/fetch.js +391 -0
- package/.playwright/package/lib/client/fileChooser.js +45 -0
- package/.playwright/package/lib/client/frame.js +504 -0
- package/.playwright/package/lib/client/harRouter.js +99 -0
- package/.playwright/package/lib/client/input.js +111 -0
- package/.playwright/package/lib/client/jsHandle.js +121 -0
- package/.playwright/package/lib/client/jsonPipe.js +35 -0
- package/.playwright/package/lib/client/localUtils.js +36 -0
- package/.playwright/package/lib/client/locator.js +448 -0
- package/.playwright/package/lib/client/network.js +769 -0
- package/.playwright/package/lib/client/page.js +748 -0
- package/.playwright/package/lib/client/playwright.js +80 -0
- package/.playwright/package/lib/client/selectors.js +67 -0
- package/.playwright/package/lib/client/stream.js +54 -0
- package/.playwright/package/lib/client/tracing.js +147 -0
- package/.playwright/package/lib/client/types.js +24 -0
- package/.playwright/package/lib/client/video.js +51 -0
- package/.playwright/package/lib/client/waiter.js +162 -0
- package/.playwright/package/lib/client/webError.js +37 -0
- package/.playwright/package/lib/client/worker.js +71 -0
- package/.playwright/package/lib/client/writableStream.js +54 -0
- package/.playwright/package/lib/common/socksProxy.js +569 -0
- package/.playwright/package/lib/common/timeoutSettings.js +73 -0
- package/.playwright/package/lib/common/types.js +5 -0
- package/.playwright/package/lib/generated/clockSource.js +7 -0
- package/.playwright/package/lib/generated/consoleApiSource.js +7 -0
- package/.playwright/package/lib/generated/injectedScriptSource.js +7 -0
- package/.playwright/package/lib/generated/pollingRecorderSource.js +7 -0
- package/.playwright/package/lib/generated/utilityScriptSource.js +7 -0
- package/.playwright/package/lib/generated/webSocketMockSource.js +7 -0
- package/.playwright/package/lib/image_tools/colorUtils.js +98 -0
- package/.playwright/package/lib/image_tools/compare.js +108 -0
- package/.playwright/package/lib/image_tools/imageChannel.js +70 -0
- package/.playwright/package/lib/image_tools/stats.js +102 -0
- package/.playwright/package/lib/inProcessFactory.js +56 -0
- package/.playwright/package/lib/inprocess.js +20 -0
- package/.playwright/package/lib/outofprocess.js +67 -0
- package/.playwright/package/lib/protocol/debug.js +27 -0
- package/.playwright/package/lib/protocol/serializers.js +173 -0
- package/.playwright/package/lib/protocol/transport.js +82 -0
- package/.playwright/package/lib/protocol/validator.js +2780 -0
- package/.playwright/package/lib/protocol/validatorPrimitives.js +139 -0
- package/.playwright/package/lib/remote/playwrightConnection.js +275 -0
- package/.playwright/package/lib/remote/playwrightServer.js +111 -0
- package/.playwright/package/lib/server/accessibility.js +62 -0
- package/.playwright/package/lib/server/android/android.js +441 -0
- package/.playwright/package/lib/server/android/backendAdb.js +172 -0
- package/.playwright/package/lib/server/artifact.js +104 -0
- package/.playwright/package/lib/server/bidi/bidiBrowser.js +314 -0
- package/.playwright/package/lib/server/bidi/bidiChromium.js +124 -0
- package/.playwright/package/lib/server/bidi/bidiConnection.js +204 -0
- package/.playwright/package/lib/server/bidi/bidiExecutionContext.js +175 -0
- package/.playwright/package/lib/server/bidi/bidiFirefox.js +104 -0
- package/.playwright/package/lib/server/bidi/bidiInput.js +160 -0
- package/.playwright/package/lib/server/bidi/bidiNetworkManager.js +337 -0
- package/.playwright/package/lib/server/bidi/bidiOverCdp.js +103 -0
- package/.playwright/package/lib/server/bidi/bidiPage.js +518 -0
- package/.playwright/package/lib/server/bidi/bidiPdf.js +140 -0
- package/.playwright/package/lib/server/bidi/third_party/bidiDeserializer.js +93 -0
- package/.playwright/package/lib/server/bidi/third_party/bidiKeyboard.js +240 -0
- package/.playwright/package/lib/server/bidi/third_party/bidiProtocol.js +139 -0
- package/.playwright/package/lib/server/bidi/third_party/bidiSerializer.js +144 -0
- package/.playwright/package/lib/server/bidi/third_party/firefoxPrefs.js +221 -0
- package/.playwright/package/lib/server/browser.js +148 -0
- package/.playwright/package/lib/server/browserContext.js +675 -0
- package/.playwright/package/lib/server/browserType.js +338 -0
- package/.playwright/package/lib/server/chromium/appIcon.png +0 -0
- package/.playwright/package/lib/server/chromium/chromium.js +354 -0
- package/.playwright/package/lib/server/chromium/chromiumSwitches.js +46 -0
- package/.playwright/package/lib/server/chromium/crAccessibility.js +237 -0
- package/.playwright/package/lib/server/chromium/crBrowser.js +516 -0
- package/.playwright/package/lib/server/chromium/crConnection.js +228 -0
- package/.playwright/package/lib/server/chromium/crCoverage.js +246 -0
- package/.playwright/package/lib/server/chromium/crDevTools.js +104 -0
- package/.playwright/package/lib/server/chromium/crDragDrop.js +143 -0
- package/.playwright/package/lib/server/chromium/crExecutionContext.js +132 -0
- package/.playwright/package/lib/server/chromium/crInput.js +182 -0
- package/.playwright/package/lib/server/chromium/crNetworkManager.js +767 -0
- package/.playwright/package/lib/server/chromium/crPage.js +1122 -0
- package/.playwright/package/lib/server/chromium/crPdf.js +153 -0
- package/.playwright/package/lib/server/chromium/crProtocolHelper.js +133 -0
- package/.playwright/package/lib/server/chromium/crServiceWorker.js +112 -0
- package/.playwright/package/lib/server/chromium/defaultFontFamilies.js +145 -0
- package/.playwright/package/lib/server/chromium/videoRecorder.js +155 -0
- package/.playwright/package/lib/server/clock.js +125 -0
- package/.playwright/package/lib/server/codegen/csharp.js +304 -0
- package/.playwright/package/lib/server/codegen/java.js +243 -0
- package/.playwright/package/lib/server/codegen/javascript.js +253 -0
- package/.playwright/package/lib/server/codegen/jsonl.js +47 -0
- package/.playwright/package/lib/server/codegen/language.js +88 -0
- package/.playwright/package/lib/server/codegen/languages.js +30 -0
- package/.playwright/package/lib/server/codegen/python.js +262 -0
- package/.playwright/package/lib/server/codegen/types.js +5 -0
- package/.playwright/package/lib/server/console.js +57 -0
- package/.playwright/package/lib/server/cookieStore.js +185 -0
- package/.playwright/package/lib/server/debugController.js +212 -0
- package/.playwright/package/lib/server/debugger.js +132 -0
- package/.playwright/package/lib/server/deviceDescriptors.js +26 -0
- package/.playwright/package/lib/server/deviceDescriptorsSource.json +1669 -0
- package/.playwright/package/lib/server/dialog.js +71 -0
- package/.playwright/package/lib/server/dispatchers/androidDispatcher.js +204 -0
- package/.playwright/package/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/.playwright/package/lib/server/dispatchers/browserContextDispatcher.js +357 -0
- package/.playwright/package/lib/server/dispatchers/browserDispatcher.js +170 -0
- package/.playwright/package/lib/server/dispatchers/browserTypeDispatcher.js +55 -0
- package/.playwright/package/lib/server/dispatchers/cdpSessionDispatcher.js +48 -0
- package/.playwright/package/lib/server/dispatchers/debugControllerDispatcher.js +105 -0
- package/.playwright/package/lib/server/dispatchers/dialogDispatcher.js +44 -0
- package/.playwright/package/lib/server/dispatchers/dispatcher.js +395 -0
- package/.playwright/package/lib/server/dispatchers/electronDispatcher.js +93 -0
- package/.playwright/package/lib/server/dispatchers/elementHandlerDispatcher.js +228 -0
- package/.playwright/package/lib/server/dispatchers/frameDispatcher.js +294 -0
- package/.playwright/package/lib/server/dispatchers/jsHandleDispatcher.js +97 -0
- package/.playwright/package/lib/server/dispatchers/jsonPipeDispatcher.js +59 -0
- package/.playwright/package/lib/server/dispatchers/localUtilsDispatcher.js +413 -0
- package/.playwright/package/lib/server/dispatchers/networkDispatchers.js +221 -0
- package/.playwright/package/lib/server/dispatchers/pageDispatcher.js +367 -0
- package/.playwright/package/lib/server/dispatchers/playwrightDispatcher.js +107 -0
- package/.playwright/package/lib/server/dispatchers/selectorsDispatcher.js +36 -0
- package/.playwright/package/lib/server/dispatchers/streamDispatcher.js +62 -0
- package/.playwright/package/lib/server/dispatchers/tracingDispatcher.js +64 -0
- package/.playwright/package/lib/server/dispatchers/webSocketRouteDispatcher.js +188 -0
- package/.playwright/package/lib/server/dispatchers/writableStreamDispatcher.js +58 -0
- package/.playwright/package/lib/server/dom.js +893 -0
- package/.playwright/package/lib/server/download.js +60 -0
- package/.playwright/package/lib/server/electron/electron.js +296 -0
- package/.playwright/package/lib/server/electron/loader.js +57 -0
- package/.playwright/package/lib/server/errors.js +68 -0
- package/.playwright/package/lib/server/fetch.js +663 -0
- package/.playwright/package/lib/server/fileChooser.js +42 -0
- package/.playwright/package/lib/server/fileUploadUtils.js +75 -0
- package/.playwright/package/lib/server/firefox/ffAccessibility.js +216 -0
- package/.playwright/package/lib/server/firefox/ffBrowser.js +462 -0
- package/.playwright/package/lib/server/firefox/ffConnection.js +168 -0
- package/.playwright/package/lib/server/firefox/ffExecutionContext.js +123 -0
- package/.playwright/package/lib/server/firefox/ffInput.js +161 -0
- package/.playwright/package/lib/server/firefox/ffNetworkManager.js +233 -0
- package/.playwright/package/lib/server/firefox/ffPage.js +544 -0
- package/.playwright/package/lib/server/firefox/firefox.js +99 -0
- package/.playwright/package/lib/server/formData.js +75 -0
- package/.playwright/package/lib/server/frameSelectors.js +171 -0
- package/.playwright/package/lib/server/frames.js +1663 -0
- package/.playwright/package/lib/server/har/harRecorder.js +139 -0
- package/.playwright/package/lib/server/har/harTracer.js +542 -0
- package/.playwright/package/lib/server/helper.js +103 -0
- package/.playwright/package/lib/server/index.js +108 -0
- package/.playwright/package/lib/server/input.js +309 -0
- package/.playwright/package/lib/server/instrumentation.js +70 -0
- package/.playwright/package/lib/server/isomorphic/utilityScriptSerializers.js +226 -0
- package/.playwright/package/lib/server/javascript.js +293 -0
- package/.playwright/package/lib/server/launchApp.js +91 -0
- package/.playwright/package/lib/server/macEditingCommands.js +139 -0
- package/.playwright/package/lib/server/network.js +617 -0
- package/.playwright/package/lib/server/page.js +863 -0
- package/.playwright/package/lib/server/pipeTransport.js +85 -0
- package/.playwright/package/lib/server/playwright.js +88 -0
- package/.playwright/package/lib/server/progress.js +99 -0
- package/.playwright/package/lib/server/protocolError.js +49 -0
- package/.playwright/package/lib/server/recorder/chat.js +177 -0
- package/.playwright/package/lib/server/recorder/contextRecorder.js +290 -0
- package/.playwright/package/lib/server/recorder/recorderApp.js +187 -0
- package/.playwright/package/lib/server/recorder/recorderCollection.js +104 -0
- package/.playwright/package/lib/server/recorder/recorderFrontend.js +5 -0
- package/.playwright/package/lib/server/recorder/recorderRunner.js +159 -0
- package/.playwright/package/lib/server/recorder/recorderUtils.js +89 -0
- package/.playwright/package/lib/server/recorder/throttledFile.js +46 -0
- package/.playwright/package/lib/server/recorder.js +367 -0
- package/.playwright/package/lib/server/registry/browserFetcher.js +168 -0
- package/.playwright/package/lib/server/registry/dependencies.js +322 -0
- package/.playwright/package/lib/server/registry/index.js +1165 -0
- package/.playwright/package/lib/server/registry/nativeDeps.js +496 -0
- package/.playwright/package/lib/server/registry/oopDownloadBrowserMain.js +138 -0
- package/.playwright/package/lib/server/screenshotter.js +348 -0
- package/.playwright/package/lib/server/selectors.js +73 -0
- package/.playwright/package/lib/server/socksClientCertificatesInterceptor.js +340 -0
- package/.playwright/package/lib/server/socksInterceptor.js +100 -0
- package/.playwright/package/lib/server/trace/recorder/snapshotter.js +161 -0
- package/.playwright/package/lib/server/trace/recorder/snapshotterInjected.js +518 -0
- package/.playwright/package/lib/server/trace/recorder/tracing.js +596 -0
- package/.playwright/package/lib/server/trace/test/inMemorySnapshotter.js +93 -0
- package/.playwright/package/lib/server/trace/viewer/traceViewer.js +219 -0
- package/.playwright/package/lib/server/transport.js +192 -0
- package/.playwright/package/lib/server/types.js +24 -0
- package/.playwright/package/lib/server/usKeyboardLayout.js +555 -0
- package/.playwright/package/lib/server/webkit/webkit.js +87 -0
- package/.playwright/package/lib/server/webkit/wkAccessibility.js +194 -0
- package/.playwright/package/lib/server/webkit/wkBrowser.js +329 -0
- package/.playwright/package/lib/server/webkit/wkConnection.js +173 -0
- package/.playwright/package/lib/server/webkit/wkExecutionContext.js +131 -0
- package/.playwright/package/lib/server/webkit/wkInput.js +179 -0
- package/.playwright/package/lib/server/webkit/wkInterceptableRequest.js +162 -0
- package/.playwright/package/lib/server/webkit/wkPage.js +1207 -0
- package/.playwright/package/lib/server/webkit/wkProvisionalPage.js +94 -0
- package/.playwright/package/lib/server/webkit/wkWorkers.js +104 -0
- package/.playwright/package/lib/third_party/pixelmatch.js +255 -0
- package/.playwright/package/lib/utils/ascii.js +31 -0
- package/.playwright/package/lib/utils/comparators.js +159 -0
- package/.playwright/package/lib/utils/crypto.js +171 -0
- package/.playwright/package/lib/utils/debug.js +46 -0
- package/.playwright/package/lib/utils/debugLogger.js +93 -0
- package/.playwright/package/lib/utils/env.js +49 -0
- package/.playwright/package/lib/utils/eventsHelper.js +38 -0
- package/.playwright/package/lib/utils/expectUtils.js +33 -0
- package/.playwright/package/lib/utils/fileUtils.js +205 -0
- package/.playwright/package/lib/utils/happy-eyeballs.js +194 -0
- package/.playwright/package/lib/utils/headers.js +52 -0
- package/.playwright/package/lib/utils/hostPlatform.js +145 -0
- package/.playwright/package/lib/utils/httpServer.js +233 -0
- package/.playwright/package/lib/utils/index.js +368 -0
- package/.playwright/package/lib/utils/isomorphic/ariaSnapshot.js +391 -0
- package/.playwright/package/lib/utils/isomorphic/cssParser.js +250 -0
- package/.playwright/package/lib/utils/isomorphic/cssTokenizer.js +979 -0
- package/.playwright/package/lib/utils/isomorphic/locatorGenerators.js +660 -0
- package/.playwright/package/lib/utils/isomorphic/locatorParser.js +185 -0
- package/.playwright/package/lib/utils/isomorphic/locatorUtils.js +62 -0
- package/.playwright/package/lib/utils/isomorphic/mimeType.js +29 -0
- package/.playwright/package/lib/utils/isomorphic/selectorParser.js +397 -0
- package/.playwright/package/lib/utils/isomorphic/stringUtils.js +169 -0
- package/.playwright/package/lib/utils/isomorphic/traceUtils.js +39 -0
- package/.playwright/package/lib/utils/isomorphic/urlMatch.js +122 -0
- package/.playwright/package/lib/utils/linuxUtils.js +78 -0
- package/.playwright/package/lib/utils/manualPromise.js +109 -0
- package/.playwright/package/lib/utils/multimap.js +75 -0
- package/.playwright/package/lib/utils/network.js +160 -0
- package/.playwright/package/lib/utils/processLauncher.js +248 -0
- package/.playwright/package/lib/utils/profiler.js +53 -0
- package/.playwright/package/lib/utils/rtti.js +44 -0
- package/.playwright/package/lib/utils/semaphore.js +51 -0
- package/.playwright/package/lib/utils/sequence.js +64 -0
- package/.playwright/package/lib/utils/spawnAsync.js +45 -0
- package/.playwright/package/lib/utils/stackTrace.js +134 -0
- package/.playwright/package/lib/utils/task.js +58 -0
- package/.playwright/package/lib/utils/time.js +37 -0
- package/.playwright/package/lib/utils/timeoutRunner.js +66 -0
- package/.playwright/package/lib/utils/traceUtils.js +44 -0
- package/.playwright/package/lib/utils/userAgent.js +105 -0
- package/.playwright/package/lib/utils/wsServer.js +128 -0
- package/.playwright/package/lib/utils/zipFile.js +75 -0
- package/.playwright/package/lib/utils/zones.js +69 -0
- package/.playwright/package/lib/utilsBundle.js +81 -0
- package/.playwright/package/lib/utilsBundleImpl/index.js +210 -0
- package/.playwright/package/lib/utilsBundleImpl/xdg-open +1066 -0
- package/.playwright/package/lib/vite/htmlReport/index.html +69 -0
- package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
- package/.playwright/package/lib/vite/recorder/assets/codeMirrorModule-k-61wZCK.js +24 -0
- package/.playwright/package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/.playwright/package/lib/vite/recorder/assets/index-B70BEW3b.js +184 -0
- package/.playwright/package/lib/vite/recorder/assets/index-eHBmevrY.css +1 -0
- package/.playwright/package/lib/vite/recorder/index.html +29 -0
- package/.playwright/package/lib/vite/recorder/playwright-logo.svg +9 -0
- package/.playwright/package/lib/vite/traceViewer/assets/codeMirrorModule-CyuxU5C-.js +24 -0
- package/.playwright/package/lib/vite/traceViewer/assets/defaultSettingsView-5nVJRt0A.js +243 -0
- package/.playwright/package/lib/vite/traceViewer/assets/xtermModule-c-SNdYZy.js +9 -0
- package/.playwright/package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
- package/.playwright/package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/.playwright/package/lib/vite/traceViewer/defaultSettingsView.2xeEXCXv.css +1 -0
- package/.playwright/package/lib/vite/traceViewer/index.CFOW-Ezb.css +1 -0
- package/.playwright/package/lib/vite/traceViewer/index.html +43 -0
- package/.playwright/package/lib/vite/traceViewer/index.qVn2ZnpC.js +2 -0
- package/.playwright/package/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/.playwright/package/lib/vite/traceViewer/snapshot.html +21 -0
- package/.playwright/package/lib/vite/traceViewer/sw.bundle.js +3 -0
- package/.playwright/package/lib/vite/traceViewer/uiMode.BatfzHMG.css +1 -0
- package/.playwright/package/lib/vite/traceViewer/uiMode.html +17 -0
- package/.playwright/package/lib/vite/traceViewer/uiMode.m4IPRPOd.js +5 -0
- package/.playwright/package/lib/vite/traceViewer/xtermModule.Beg8tuEN.css +32 -0
- package/.playwright/package/lib/zipBundle.js +25 -0
- package/.playwright/package/lib/zipBundleImpl.js +5 -0
- package/.playwright/package/package.json +44 -0
- package/.playwright/package/protocol.yml +3758 -0
- package/.playwright/package/types/protocol.d.ts +21868 -0
- package/.playwright/package/types/structs.d.ts +45 -0
- package/.playwright/package/types/types.d.ts +22663 -0
- package/README.md +6 -6
- package/et +0 -0
- package/package.json +7 -2
- package/playwright.ps1 +7 -0
- package/scripts/playwright-bridge.js +560 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.performAction = performAction;
|
|
7
|
+
exports.toClickOptions = toClickOptions;
|
|
8
|
+
var _utils = require("../../utils");
|
|
9
|
+
var _language = require("../codegen/language");
|
|
10
|
+
var _instrumentation = require("../instrumentation");
|
|
11
|
+
var _recorderUtils = require("./recorderUtils");
|
|
12
|
+
/**
|
|
13
|
+
* Copyright (c) Microsoft Corporation.
|
|
14
|
+
*
|
|
15
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
* you may not use this file except in compliance with the License.
|
|
17
|
+
* You may obtain a copy of the License at
|
|
18
|
+
*
|
|
19
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
22
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
+
* See the License for the specific language governing permissions and
|
|
25
|
+
* limitations under the License.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
async function performAction(pageAliases, actionInContext) {
|
|
29
|
+
const callMetadata = (0, _instrumentation.serverSideCallMetadata)();
|
|
30
|
+
const mainFrame = (0, _recorderUtils.mainFrameForAction)(pageAliases, actionInContext);
|
|
31
|
+
const {
|
|
32
|
+
action
|
|
33
|
+
} = actionInContext;
|
|
34
|
+
const kActionTimeout = 5000;
|
|
35
|
+
if (action.name === 'navigate') {
|
|
36
|
+
await mainFrame.goto(callMetadata, action.url, {
|
|
37
|
+
timeout: kActionTimeout
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (action.name === 'openPage') throw Error('Not reached');
|
|
42
|
+
if (action.name === 'closePage') {
|
|
43
|
+
await mainFrame._page.close(callMetadata);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const selector = (0, _recorderUtils.buildFullSelector)(actionInContext.frame.framePath, action.selector);
|
|
47
|
+
if (action.name === 'click') {
|
|
48
|
+
const options = toClickOptions(action);
|
|
49
|
+
await mainFrame.click(callMetadata, selector, {
|
|
50
|
+
...options,
|
|
51
|
+
timeout: kActionTimeout,
|
|
52
|
+
strict: true
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (action.name === 'press') {
|
|
57
|
+
const modifiers = (0, _language.toKeyboardModifiers)(action.modifiers);
|
|
58
|
+
const shortcut = [...modifiers, action.key].join('+');
|
|
59
|
+
await mainFrame.press(callMetadata, selector, shortcut, {
|
|
60
|
+
timeout: kActionTimeout,
|
|
61
|
+
strict: true
|
|
62
|
+
});
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (action.name === 'fill') {
|
|
66
|
+
await mainFrame.fill(callMetadata, selector, action.text, {
|
|
67
|
+
timeout: kActionTimeout,
|
|
68
|
+
strict: true
|
|
69
|
+
});
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (action.name === 'setInputFiles') {
|
|
73
|
+
await mainFrame.setInputFiles(callMetadata, selector, {
|
|
74
|
+
selector,
|
|
75
|
+
payloads: [],
|
|
76
|
+
timeout: kActionTimeout,
|
|
77
|
+
strict: true
|
|
78
|
+
});
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (action.name === 'check') {
|
|
82
|
+
await mainFrame.check(callMetadata, selector, {
|
|
83
|
+
timeout: kActionTimeout,
|
|
84
|
+
strict: true
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (action.name === 'uncheck') {
|
|
89
|
+
await mainFrame.uncheck(callMetadata, selector, {
|
|
90
|
+
timeout: kActionTimeout,
|
|
91
|
+
strict: true
|
|
92
|
+
});
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (action.name === 'select') {
|
|
96
|
+
const values = action.options.map(value => ({
|
|
97
|
+
value
|
|
98
|
+
}));
|
|
99
|
+
await mainFrame.selectOption(callMetadata, selector, [], values, {
|
|
100
|
+
timeout: kActionTimeout,
|
|
101
|
+
strict: true
|
|
102
|
+
});
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (action.name === 'assertChecked') {
|
|
106
|
+
await mainFrame.expect(callMetadata, selector, {
|
|
107
|
+
selector,
|
|
108
|
+
expression: 'to.be.checked',
|
|
109
|
+
expectedValue: {
|
|
110
|
+
checked: action.checked
|
|
111
|
+
},
|
|
112
|
+
isNot: !action.checked,
|
|
113
|
+
timeout: kActionTimeout
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (action.name === 'assertText') {
|
|
118
|
+
await mainFrame.expect(callMetadata, selector, {
|
|
119
|
+
selector,
|
|
120
|
+
expression: 'to.have.text',
|
|
121
|
+
expectedText: (0, _utils.serializeExpectedTextValues)([action.text], {
|
|
122
|
+
matchSubstring: true,
|
|
123
|
+
normalizeWhiteSpace: true
|
|
124
|
+
}),
|
|
125
|
+
isNot: false,
|
|
126
|
+
timeout: kActionTimeout
|
|
127
|
+
});
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (action.name === 'assertValue') {
|
|
131
|
+
await mainFrame.expect(callMetadata, selector, {
|
|
132
|
+
selector,
|
|
133
|
+
expression: 'to.have.value',
|
|
134
|
+
expectedValue: action.value,
|
|
135
|
+
isNot: false,
|
|
136
|
+
timeout: kActionTimeout
|
|
137
|
+
});
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (action.name === 'assertVisible') {
|
|
141
|
+
await mainFrame.expect(callMetadata, selector, {
|
|
142
|
+
selector,
|
|
143
|
+
expression: 'to.be.visible',
|
|
144
|
+
isNot: false,
|
|
145
|
+
timeout: kActionTimeout
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
throw new Error('Internal error: unexpected action ' + action.name);
|
|
150
|
+
}
|
|
151
|
+
function toClickOptions(action) {
|
|
152
|
+
const modifiers = (0, _language.toKeyboardModifiers)(action.modifiers);
|
|
153
|
+
const options = {};
|
|
154
|
+
if (action.button !== 'left') options.button = action.button;
|
|
155
|
+
if (modifiers.length) options.modifiers = modifiers;
|
|
156
|
+
if (action.clickCount > 1) options.clickCount = action.clickCount;
|
|
157
|
+
if (action.position) options.position = action.position;
|
|
158
|
+
return options;
|
|
159
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildFullSelector = buildFullSelector;
|
|
7
|
+
exports.collapseActions = collapseActions;
|
|
8
|
+
exports.frameForAction = frameForAction;
|
|
9
|
+
exports.mainFrameForAction = mainFrameForAction;
|
|
10
|
+
exports.metadataToCallLog = metadataToCallLog;
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) Microsoft Corporation.
|
|
13
|
+
*
|
|
14
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License.
|
|
16
|
+
* You may obtain a copy of the License at
|
|
17
|
+
*
|
|
18
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
* See the License for the specific language governing permissions and
|
|
24
|
+
* limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
function buildFullSelector(framePath, selector) {
|
|
28
|
+
return [...framePath, selector].join(' >> internal:control=enter-frame >> ');
|
|
29
|
+
}
|
|
30
|
+
function metadataToCallLog(metadata, status) {
|
|
31
|
+
var _metadata$params, _metadata$params2, _metadata$error;
|
|
32
|
+
let title = metadata.apiName || metadata.method;
|
|
33
|
+
if (metadata.method === 'waitForEventInfo') title += `(${metadata.params.info.event})`;
|
|
34
|
+
title = title.replace('object.expect', 'expect');
|
|
35
|
+
if (metadata.error) status = 'error';
|
|
36
|
+
const params = {
|
|
37
|
+
url: (_metadata$params = metadata.params) === null || _metadata$params === void 0 ? void 0 : _metadata$params.url,
|
|
38
|
+
selector: (_metadata$params2 = metadata.params) === null || _metadata$params2 === void 0 ? void 0 : _metadata$params2.selector
|
|
39
|
+
};
|
|
40
|
+
let duration = metadata.endTime ? metadata.endTime - metadata.startTime : undefined;
|
|
41
|
+
if (typeof duration === 'number' && metadata.pauseStartTime && metadata.pauseEndTime) {
|
|
42
|
+
duration -= metadata.pauseEndTime - metadata.pauseStartTime;
|
|
43
|
+
duration = Math.max(duration, 0);
|
|
44
|
+
}
|
|
45
|
+
const callLog = {
|
|
46
|
+
id: metadata.id,
|
|
47
|
+
messages: metadata.log,
|
|
48
|
+
title,
|
|
49
|
+
status,
|
|
50
|
+
error: (_metadata$error = metadata.error) === null || _metadata$error === void 0 || (_metadata$error = _metadata$error.error) === null || _metadata$error === void 0 ? void 0 : _metadata$error.message,
|
|
51
|
+
params,
|
|
52
|
+
duration
|
|
53
|
+
};
|
|
54
|
+
return callLog;
|
|
55
|
+
}
|
|
56
|
+
function mainFrameForAction(pageAliases, actionInContext) {
|
|
57
|
+
var _find;
|
|
58
|
+
const pageAlias = actionInContext.frame.pageAlias;
|
|
59
|
+
const page = (_find = [...pageAliases.entries()].find(([, alias]) => pageAlias === alias)) === null || _find === void 0 ? void 0 : _find[0];
|
|
60
|
+
if (!page) throw new Error(`Internal error: page ${pageAlias} not found in [${[...pageAliases.values()]}]`);
|
|
61
|
+
return page.mainFrame();
|
|
62
|
+
}
|
|
63
|
+
async function frameForAction(pageAliases, actionInContext, action) {
|
|
64
|
+
var _find2;
|
|
65
|
+
const pageAlias = actionInContext.frame.pageAlias;
|
|
66
|
+
const page = (_find2 = [...pageAliases.entries()].find(([, alias]) => pageAlias === alias)) === null || _find2 === void 0 ? void 0 : _find2[0];
|
|
67
|
+
if (!page) throw new Error('Internal error: page not found');
|
|
68
|
+
const fullSelector = buildFullSelector(actionInContext.frame.framePath, action.selector);
|
|
69
|
+
const result = await page.mainFrame().selectors.resolveFrameForSelector(fullSelector);
|
|
70
|
+
if (!result) throw new Error('Internal error: frame not found');
|
|
71
|
+
return result.frame;
|
|
72
|
+
}
|
|
73
|
+
function collapseActions(actions) {
|
|
74
|
+
const result = [];
|
|
75
|
+
for (const action of actions) {
|
|
76
|
+
const lastAction = result[result.length - 1];
|
|
77
|
+
const isSameAction = lastAction && lastAction.action.name === action.action.name && lastAction.frame.pageAlias === action.frame.pageAlias && lastAction.frame.framePath.join('|') === action.frame.framePath.join('|');
|
|
78
|
+
const isSameSelector = lastAction && 'selector' in lastAction.action && 'selector' in action.action && action.action.selector === lastAction.action.selector;
|
|
79
|
+
const shouldMerge = isSameAction && (action.action.name === 'navigate' || action.action.name === 'fill' && isSameSelector);
|
|
80
|
+
if (!shouldMerge) {
|
|
81
|
+
result.push(action);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const startTime = result[result.length - 1].startTime;
|
|
85
|
+
result[result.length - 1] = action;
|
|
86
|
+
result[result.length - 1].startTime = startTime;
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ThrottledFile = void 0;
|
|
7
|
+
var fs = _interopRequireWildcard(require("fs"));
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
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
|
+
class ThrottledFile {
|
|
27
|
+
constructor(file) {
|
|
28
|
+
this._file = void 0;
|
|
29
|
+
this._timer = void 0;
|
|
30
|
+
this._text = void 0;
|
|
31
|
+
this._file = file;
|
|
32
|
+
}
|
|
33
|
+
setContent(text) {
|
|
34
|
+
this._text = text;
|
|
35
|
+
if (!this._timer) this._timer = setTimeout(() => this.flush(), 250);
|
|
36
|
+
}
|
|
37
|
+
flush() {
|
|
38
|
+
if (this._timer) {
|
|
39
|
+
clearTimeout(this._timer);
|
|
40
|
+
this._timer = undefined;
|
|
41
|
+
}
|
|
42
|
+
if (this._text) fs.writeFileSync(this._file, this._text);
|
|
43
|
+
this._text = undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ThrottledFile = ThrottledFile;
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Recorder = void 0;
|
|
7
|
+
var fs = _interopRequireWildcard(require("fs"));
|
|
8
|
+
var consoleApiSource = _interopRequireWildcard(require("../generated/consoleApiSource"));
|
|
9
|
+
var _utils = require("../utils");
|
|
10
|
+
var _locatorParser = require("../utils/isomorphic/locatorParser");
|
|
11
|
+
var _browserContext = require("./browserContext");
|
|
12
|
+
var _debugger = require("./debugger");
|
|
13
|
+
var _contextRecorder = require("./recorder/contextRecorder");
|
|
14
|
+
var _recorderUtils = require("./recorder/recorderUtils");
|
|
15
|
+
var _selectorParser = require("../utils/isomorphic/selectorParser");
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
/**
|
|
19
|
+
* Copyright (c) Microsoft Corporation.
|
|
20
|
+
*
|
|
21
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License.
|
|
23
|
+
* You may obtain a copy of the License at
|
|
24
|
+
*
|
|
25
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
+
* See the License for the specific language governing permissions and
|
|
31
|
+
* limitations under the License.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
const recorderSymbol = Symbol('recorderSymbol');
|
|
35
|
+
class Recorder {
|
|
36
|
+
static async showInspector(context, params, recorderAppFactory) {
|
|
37
|
+
if ((0, _utils.isUnderTest)()) params.language = process.env.TEST_INSPECTOR_LANGUAGE;
|
|
38
|
+
return await Recorder.show(context, recorderAppFactory, params);
|
|
39
|
+
}
|
|
40
|
+
static showInspectorNoReply(context, recorderAppFactory) {
|
|
41
|
+
Recorder.showInspector(context, {}, recorderAppFactory).catch(() => {});
|
|
42
|
+
}
|
|
43
|
+
static show(context, recorderAppFactory, params) {
|
|
44
|
+
let recorderPromise = context[recorderSymbol];
|
|
45
|
+
if (!recorderPromise) {
|
|
46
|
+
recorderPromise = Recorder._create(context, recorderAppFactory, params);
|
|
47
|
+
context[recorderSymbol] = recorderPromise;
|
|
48
|
+
}
|
|
49
|
+
return recorderPromise;
|
|
50
|
+
}
|
|
51
|
+
static async _create(context, recorderAppFactory, params = {}) {
|
|
52
|
+
const recorder = new Recorder(context, params);
|
|
53
|
+
const recorderApp = await recorderAppFactory(recorder);
|
|
54
|
+
await recorder._install(recorderApp);
|
|
55
|
+
return recorder;
|
|
56
|
+
}
|
|
57
|
+
constructor(context, params) {
|
|
58
|
+
this.handleSIGINT = void 0;
|
|
59
|
+
this._context = void 0;
|
|
60
|
+
this._mode = void 0;
|
|
61
|
+
this._highlightedElement = {};
|
|
62
|
+
this._overlayState = {
|
|
63
|
+
offsetX: 0
|
|
64
|
+
};
|
|
65
|
+
this._recorderApp = null;
|
|
66
|
+
this._currentCallsMetadata = new Map();
|
|
67
|
+
this._recorderSources = [];
|
|
68
|
+
this._userSources = new Map();
|
|
69
|
+
this._debugger = void 0;
|
|
70
|
+
this._contextRecorder = void 0;
|
|
71
|
+
this._omitCallTracking = false;
|
|
72
|
+
this._currentLanguage = void 0;
|
|
73
|
+
this._mode = params.mode || 'none';
|
|
74
|
+
this.handleSIGINT = params.handleSIGINT;
|
|
75
|
+
this._contextRecorder = new _contextRecorder.ContextRecorder(context, params, {});
|
|
76
|
+
this._context = context;
|
|
77
|
+
this._omitCallTracking = !!params.omitCallTracking;
|
|
78
|
+
this._debugger = context.debugger();
|
|
79
|
+
context.instrumentation.addListener(this, context);
|
|
80
|
+
this._currentLanguage = this._contextRecorder.languageName();
|
|
81
|
+
if ((0, _utils.isUnderTest)()) {
|
|
82
|
+
// Most of our tests put elements at the top left, so get out of the way.
|
|
83
|
+
this._overlayState.offsetX = 200;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async _install(recorderApp) {
|
|
87
|
+
this._recorderApp = recorderApp;
|
|
88
|
+
recorderApp.once('close', () => {
|
|
89
|
+
this._debugger.resume(false);
|
|
90
|
+
this._recorderApp = null;
|
|
91
|
+
});
|
|
92
|
+
recorderApp.on('event', data => {
|
|
93
|
+
if (data.event === 'setMode') {
|
|
94
|
+
this.setMode(data.params.mode);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (data.event === 'highlightRequested') {
|
|
98
|
+
if (data.params.selector) this.setHighlightedSelector(this._currentLanguage, data.params.selector);
|
|
99
|
+
if (data.params.ariaTemplate) this.setHighlightedAriaTemplate(data.params.ariaTemplate);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (data.event === 'step') {
|
|
103
|
+
this._debugger.resume(true);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (data.event === 'fileChanged') {
|
|
107
|
+
this._currentLanguage = this._contextRecorder.languageName(data.params.file);
|
|
108
|
+
this._refreshOverlay();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (data.event === 'resume') {
|
|
112
|
+
this._debugger.resume(false);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (data.event === 'pause') {
|
|
116
|
+
this._debugger.pauseOnNextStatement();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (data.event === 'clear') {
|
|
120
|
+
this._contextRecorder.clearScript();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (data.event === 'runTask') {
|
|
124
|
+
this._contextRecorder.runTask(data.params.task);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
await Promise.all([recorderApp.setMode(this._mode), recorderApp.setPaused(this._debugger.isPaused()), this._pushAllSources()]);
|
|
129
|
+
this._context.once(_browserContext.BrowserContext.Events.Close, () => {
|
|
130
|
+
var _this$_recorderApp;
|
|
131
|
+
this._contextRecorder.dispose();
|
|
132
|
+
this._context.instrumentation.removeListener(this);
|
|
133
|
+
(_this$_recorderApp = this._recorderApp) === null || _this$_recorderApp === void 0 || _this$_recorderApp.close().catch(() => {});
|
|
134
|
+
});
|
|
135
|
+
this._contextRecorder.on(_contextRecorder.ContextRecorder.Events.Change, data => {
|
|
136
|
+
this._recorderSources = data.sources;
|
|
137
|
+
recorderApp.setActions(data.actions, data.sources);
|
|
138
|
+
recorderApp.setRunningFile(undefined);
|
|
139
|
+
this._pushAllSources();
|
|
140
|
+
});
|
|
141
|
+
await this._context.exposeBinding('__pw_recorderState', false, async source => {
|
|
142
|
+
let actionSelector;
|
|
143
|
+
let actionPoint;
|
|
144
|
+
const hasActiveScreenshotCommand = [...this._currentCallsMetadata.keys()].some(isScreenshotCommand);
|
|
145
|
+
if (!hasActiveScreenshotCommand) {
|
|
146
|
+
actionSelector = await this._scopeHighlightedSelectorToFrame(source.frame);
|
|
147
|
+
for (const [metadata, sdkObject] of this._currentCallsMetadata) {
|
|
148
|
+
if (source.page === sdkObject.attribution.page) {
|
|
149
|
+
actionPoint = metadata.point || actionPoint;
|
|
150
|
+
actionSelector = actionSelector || metadata.params.selector;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const uiState = {
|
|
155
|
+
mode: this._mode,
|
|
156
|
+
actionPoint,
|
|
157
|
+
actionSelector,
|
|
158
|
+
ariaTemplate: this._highlightedElement.ariaTemplate,
|
|
159
|
+
language: this._currentLanguage,
|
|
160
|
+
testIdAttributeName: this._contextRecorder.testIdAttributeName(),
|
|
161
|
+
overlay: this._overlayState
|
|
162
|
+
};
|
|
163
|
+
return uiState;
|
|
164
|
+
});
|
|
165
|
+
await this._context.exposeBinding('__pw_recorderElementPicked', false, async ({
|
|
166
|
+
frame
|
|
167
|
+
}, elementInfo) => {
|
|
168
|
+
var _this$_recorderApp2;
|
|
169
|
+
const selectorChain = await (0, _contextRecorder.generateFrameSelector)(frame);
|
|
170
|
+
await ((_this$_recorderApp2 = this._recorderApp) === null || _this$_recorderApp2 === void 0 ? void 0 : _this$_recorderApp2.elementPicked({
|
|
171
|
+
selector: (0, _recorderUtils.buildFullSelector)(selectorChain, elementInfo.selector),
|
|
172
|
+
ariaSnapshot: elementInfo.ariaSnapshot
|
|
173
|
+
}, true));
|
|
174
|
+
});
|
|
175
|
+
await this._context.exposeBinding('__pw_recorderSetMode', false, async ({
|
|
176
|
+
frame
|
|
177
|
+
}, mode) => {
|
|
178
|
+
if (frame.parentFrame()) return;
|
|
179
|
+
this.setMode(mode);
|
|
180
|
+
});
|
|
181
|
+
await this._context.exposeBinding('__pw_recorderSetOverlayState', false, async ({
|
|
182
|
+
frame
|
|
183
|
+
}, state) => {
|
|
184
|
+
if (frame.parentFrame()) return;
|
|
185
|
+
this._overlayState = state;
|
|
186
|
+
});
|
|
187
|
+
await this._context.exposeBinding('__pw_resume', false, () => {
|
|
188
|
+
this._debugger.resume(false);
|
|
189
|
+
});
|
|
190
|
+
await this._context.extendInjectedScript(consoleApiSource.source);
|
|
191
|
+
await this._contextRecorder.install();
|
|
192
|
+
if (this._debugger.isPaused()) this._pausedStateChanged();
|
|
193
|
+
this._debugger.on(_debugger.Debugger.Events.PausedStateChanged, () => this._pausedStateChanged());
|
|
194
|
+
this._context.recorderAppForTest = this._recorderApp;
|
|
195
|
+
}
|
|
196
|
+
_pausedStateChanged() {
|
|
197
|
+
var _this$_recorderApp3;
|
|
198
|
+
// If we are called upon page.pause, we don't have metadatas, populate them.
|
|
199
|
+
for (const {
|
|
200
|
+
metadata,
|
|
201
|
+
sdkObject
|
|
202
|
+
} of this._debugger.pausedDetails()) {
|
|
203
|
+
if (!this._currentCallsMetadata.has(metadata)) this.onBeforeCall(sdkObject, metadata);
|
|
204
|
+
}
|
|
205
|
+
(_this$_recorderApp3 = this._recorderApp) === null || _this$_recorderApp3 === void 0 || _this$_recorderApp3.setPaused(this._debugger.isPaused());
|
|
206
|
+
this._updateUserSources();
|
|
207
|
+
this.updateCallLog([...this._currentCallsMetadata.keys()]);
|
|
208
|
+
}
|
|
209
|
+
setMode(mode) {
|
|
210
|
+
var _this$_recorderApp4;
|
|
211
|
+
if (this._mode === mode) return;
|
|
212
|
+
this._highlightedElement = {};
|
|
213
|
+
this._mode = mode;
|
|
214
|
+
(_this$_recorderApp4 = this._recorderApp) === null || _this$_recorderApp4 === void 0 || _this$_recorderApp4.setMode(this._mode);
|
|
215
|
+
this._contextRecorder.setEnabled(this._isRecording());
|
|
216
|
+
this._debugger.setMuted(this._isRecording());
|
|
217
|
+
if (this._mode !== 'none' && this._mode !== 'standby' && this._context.pages().length === 1) this._context.pages()[0].bringToFront().catch(() => {});
|
|
218
|
+
this._refreshOverlay();
|
|
219
|
+
}
|
|
220
|
+
resume() {
|
|
221
|
+
this._debugger.resume(false);
|
|
222
|
+
}
|
|
223
|
+
mode() {
|
|
224
|
+
return this._mode;
|
|
225
|
+
}
|
|
226
|
+
setHighlightedSelector(language, selector) {
|
|
227
|
+
this._highlightedElement = {
|
|
228
|
+
selector: (0, _locatorParser.locatorOrSelectorAsSelector)(language, selector, this._context.selectors().testIdAttributeName())
|
|
229
|
+
};
|
|
230
|
+
this._refreshOverlay();
|
|
231
|
+
}
|
|
232
|
+
setHighlightedAriaTemplate(ariaTemplate) {
|
|
233
|
+
this._highlightedElement = {
|
|
234
|
+
ariaTemplate
|
|
235
|
+
};
|
|
236
|
+
this._refreshOverlay();
|
|
237
|
+
}
|
|
238
|
+
hideHighlightedSelector() {
|
|
239
|
+
this._highlightedElement = {};
|
|
240
|
+
this._refreshOverlay();
|
|
241
|
+
}
|
|
242
|
+
async _scopeHighlightedSelectorToFrame(frame) {
|
|
243
|
+
if (!this._highlightedElement.selector) return;
|
|
244
|
+
try {
|
|
245
|
+
const mainFrame = frame._page.mainFrame();
|
|
246
|
+
const resolved = await mainFrame.selectors.resolveFrameForSelector(this._highlightedElement.selector);
|
|
247
|
+
// selector couldn't be found, don't highlight anything
|
|
248
|
+
if (!resolved) return '';
|
|
249
|
+
|
|
250
|
+
// selector points to no specific frame, highlight in all frames
|
|
251
|
+
if ((resolved === null || resolved === void 0 ? void 0 : resolved.frame) === mainFrame) return (0, _selectorParser.stringifySelector)(resolved.info.parsed);
|
|
252
|
+
|
|
253
|
+
// selector points to this frame, highlight it
|
|
254
|
+
if ((resolved === null || resolved === void 0 ? void 0 : resolved.frame) === frame) return (0, _selectorParser.stringifySelector)(resolved.info.parsed);
|
|
255
|
+
|
|
256
|
+
// selector points to a different frame, highlight nothing
|
|
257
|
+
return '';
|
|
258
|
+
} catch {
|
|
259
|
+
return '';
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
setOutput(codegenId, outputFile) {
|
|
263
|
+
this._contextRecorder.setOutput(codegenId, outputFile);
|
|
264
|
+
}
|
|
265
|
+
_refreshOverlay() {
|
|
266
|
+
for (const page of this._context.pages()) {
|
|
267
|
+
for (const frame of page.frames()) frame.evaluateExpression('window.__pw_refreshOverlay()').catch(() => {});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
async onBeforeCall(sdkObject, metadata) {
|
|
271
|
+
if (this._omitCallTracking || this._isRecording()) return;
|
|
272
|
+
this._currentCallsMetadata.set(metadata, sdkObject);
|
|
273
|
+
this._updateUserSources();
|
|
274
|
+
this.updateCallLog([metadata]);
|
|
275
|
+
if (isScreenshotCommand(metadata)) this.hideHighlightedSelector();else if (metadata.params && metadata.params.selector) this._highlightedElement = {
|
|
276
|
+
selector: metadata.params.selector
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
async onAfterCall(sdkObject, metadata) {
|
|
280
|
+
if (this._omitCallTracking || this._isRecording()) return;
|
|
281
|
+
if (!metadata.error) this._currentCallsMetadata.delete(metadata);
|
|
282
|
+
this._updateUserSources();
|
|
283
|
+
this.updateCallLog([metadata]);
|
|
284
|
+
}
|
|
285
|
+
_updateUserSources() {
|
|
286
|
+
var _this$_recorderApp5;
|
|
287
|
+
// Remove old decorations.
|
|
288
|
+
for (const source of this._userSources.values()) {
|
|
289
|
+
source.highlight = [];
|
|
290
|
+
source.revealLine = undefined;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Apply new decorations.
|
|
294
|
+
let fileToSelect = undefined;
|
|
295
|
+
for (const metadata of this._currentCallsMetadata.keys()) {
|
|
296
|
+
if (!metadata.location) continue;
|
|
297
|
+
const {
|
|
298
|
+
file,
|
|
299
|
+
line
|
|
300
|
+
} = metadata.location;
|
|
301
|
+
let source = this._userSources.get(file);
|
|
302
|
+
if (!source) {
|
|
303
|
+
source = {
|
|
304
|
+
isRecorded: false,
|
|
305
|
+
label: file,
|
|
306
|
+
id: file,
|
|
307
|
+
text: this._readSource(file),
|
|
308
|
+
highlight: [],
|
|
309
|
+
language: languageForFile(file)
|
|
310
|
+
};
|
|
311
|
+
this._userSources.set(file, source);
|
|
312
|
+
}
|
|
313
|
+
if (line) {
|
|
314
|
+
const paused = this._debugger.isPaused(metadata);
|
|
315
|
+
source.highlight.push({
|
|
316
|
+
line,
|
|
317
|
+
type: metadata.error ? 'error' : paused ? 'paused' : 'running'
|
|
318
|
+
});
|
|
319
|
+
source.revealLine = line;
|
|
320
|
+
fileToSelect = source.id;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
this._pushAllSources();
|
|
324
|
+
if (fileToSelect) (_this$_recorderApp5 = this._recorderApp) === null || _this$_recorderApp5 === void 0 || _this$_recorderApp5.setRunningFile(fileToSelect);
|
|
325
|
+
}
|
|
326
|
+
_pushAllSources() {
|
|
327
|
+
var _this$_recorderApp6;
|
|
328
|
+
(_this$_recorderApp6 = this._recorderApp) === null || _this$_recorderApp6 === void 0 || _this$_recorderApp6.setSources([...this._recorderSources, ...this._userSources.values()]);
|
|
329
|
+
}
|
|
330
|
+
async onBeforeInputAction(sdkObject, metadata) {}
|
|
331
|
+
async onCallLog(sdkObject, metadata, logName, message) {
|
|
332
|
+
this.updateCallLog([metadata]);
|
|
333
|
+
}
|
|
334
|
+
updateCallLog(metadatas) {
|
|
335
|
+
var _this$_recorderApp7;
|
|
336
|
+
if (this._isRecording()) return;
|
|
337
|
+
const logs = [];
|
|
338
|
+
for (const metadata of metadatas) {
|
|
339
|
+
if (!metadata.method || metadata.internal) continue;
|
|
340
|
+
let status = 'done';
|
|
341
|
+
if (this._currentCallsMetadata.has(metadata)) status = 'in-progress';
|
|
342
|
+
if (this._debugger.isPaused(metadata)) status = 'paused';
|
|
343
|
+
logs.push((0, _recorderUtils.metadataToCallLog)(metadata, status));
|
|
344
|
+
}
|
|
345
|
+
(_this$_recorderApp7 = this._recorderApp) === null || _this$_recorderApp7 === void 0 || _this$_recorderApp7.updateCallLogs(logs);
|
|
346
|
+
}
|
|
347
|
+
_isRecording() {
|
|
348
|
+
return ['recording', 'assertingText', 'assertingVisibility', 'assertingValue', 'assertingSnapshot'].includes(this._mode);
|
|
349
|
+
}
|
|
350
|
+
_readSource(fileName) {
|
|
351
|
+
try {
|
|
352
|
+
return fs.readFileSync(fileName, 'utf-8');
|
|
353
|
+
} catch (e) {
|
|
354
|
+
return '// No source available';
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
exports.Recorder = Recorder;
|
|
359
|
+
function isScreenshotCommand(metadata) {
|
|
360
|
+
return metadata.method.toLowerCase().includes('screenshot');
|
|
361
|
+
}
|
|
362
|
+
function languageForFile(file) {
|
|
363
|
+
if (file.endsWith('.py')) return 'python';
|
|
364
|
+
if (file.endsWith('.java')) return 'java';
|
|
365
|
+
if (file.endsWith('.cs')) return 'csharp';
|
|
366
|
+
return 'javascript';
|
|
367
|
+
}
|