@zohodesk/testinglibrary 3.2.13 → 3.2.14
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/.gitlab-ci.yml +13 -13
- package/build/common/data-generator/steps/DataGeneratorStepsHelper.js +3 -1
- package/build/core/dataGenerator/DataGenerator.js +0 -9
- package/build/core/playwright/helpers/auth/getUsers.js +2 -1
- package/build/test/Test.js +13 -0
- package/npm-shrinkwrap.json +140 -220
- package/package.json +1 -3
- package/playwright-mcp-test/node_modules/.package-lock.json +0 -54
- package/playwright-mcp-test/node_modules/@playwright/mcp/LICENSE +0 -202
- package/playwright-mcp-test/node_modules/@playwright/mcp/README.md +0 -907
- package/playwright-mcp-test/node_modules/@playwright/mcp/cli.js +0 -24
- package/playwright-mcp-test/node_modules/@playwright/mcp/config.d.ts +0 -174
- package/playwright-mcp-test/node_modules/@playwright/mcp/index.d.ts +0 -23
- package/playwright-mcp-test/node_modules/@playwright/mcp/index.js +0 -19
- package/playwright-mcp-test/node_modules/@playwright/mcp/package.json +0 -52
- package/playwright-mcp-test/node_modules/playwright/LICENSE +0 -202
- package/playwright-mcp-test/node_modules/playwright/NOTICE +0 -5
- package/playwright-mcp-test/node_modules/playwright/README.md +0 -168
- package/playwright-mcp-test/node_modules/playwright/ThirdPartyNotices.txt +0 -6277
- package/playwright-mcp-test/node_modules/playwright/cli.js +0 -19
- package/playwright-mcp-test/node_modules/playwright/index.d.ts +0 -17
- package/playwright-mcp-test/node_modules/playwright/index.js +0 -17
- package/playwright-mcp-test/node_modules/playwright/index.mjs +0 -18
- package/playwright-mcp-test/node_modules/playwright/jsx-runtime.js +0 -42
- package/playwright-mcp-test/node_modules/playwright/jsx-runtime.mjs +0 -21
- package/playwright-mcp-test/node_modules/playwright/lib/agents/generateAgents.js +0 -368
- package/playwright-mcp-test/node_modules/playwright/lib/agents/generator.agent.md +0 -101
- package/playwright-mcp-test/node_modules/playwright/lib/agents/healer.agent.md +0 -77
- package/playwright-mcp-test/node_modules/playwright/lib/agents/planner.agent.md +0 -138
- package/playwright-mcp-test/node_modules/playwright/lib/agents/test-coverage.prompt.md +0 -31
- package/playwright-mcp-test/node_modules/playwright/lib/agents/test-generate.prompt.md +0 -8
- package/playwright-mcp-test/node_modules/playwright/lib/agents/test-heal.prompt.md +0 -6
- package/playwright-mcp-test/node_modules/playwright/lib/agents/test-plan.prompt.md +0 -9
- package/playwright-mcp-test/node_modules/playwright/lib/common/config.js +0 -280
- package/playwright-mcp-test/node_modules/playwright/lib/common/configLoader.js +0 -344
- package/playwright-mcp-test/node_modules/playwright/lib/common/esmLoaderHost.js +0 -102
- package/playwright-mcp-test/node_modules/playwright/lib/common/expectBundle.js +0 -52
- package/playwright-mcp-test/node_modules/playwright/lib/common/expectBundleImpl.js +0 -389
- package/playwright-mcp-test/node_modules/playwright/lib/common/fixtures.js +0 -302
- package/playwright-mcp-test/node_modules/playwright/lib/common/globals.js +0 -58
- package/playwright-mcp-test/node_modules/playwright/lib/common/ipc.js +0 -60
- package/playwright-mcp-test/node_modules/playwright/lib/common/poolBuilder.js +0 -85
- package/playwright-mcp-test/node_modules/playwright/lib/common/process.js +0 -104
- package/playwright-mcp-test/node_modules/playwright/lib/common/suiteUtils.js +0 -140
- package/playwright-mcp-test/node_modules/playwright/lib/common/test.js +0 -321
- package/playwright-mcp-test/node_modules/playwright/lib/common/testLoader.js +0 -101
- package/playwright-mcp-test/node_modules/playwright/lib/common/testType.js +0 -298
- package/playwright-mcp-test/node_modules/playwright/lib/common/validators.js +0 -68
- package/playwright-mcp-test/node_modules/playwright/lib/fsWatcher.js +0 -67
- package/playwright-mcp-test/node_modules/playwright/lib/index.js +0 -682
- package/playwright-mcp-test/node_modules/playwright/lib/internalsForTest.js +0 -42
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/events.js +0 -77
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/folders.js +0 -30
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/stringInternPool.js +0 -69
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/teleReceiver.js +0 -508
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +0 -137
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/testServerConnection.js +0 -211
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/testServerInterface.js +0 -16
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/testTree.js +0 -334
- package/playwright-mcp-test/node_modules/playwright/lib/isomorphic/types.d.js +0 -16
- package/playwright-mcp-test/node_modules/playwright/lib/loader/loaderMain.js +0 -59
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/expect.js +0 -325
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/matcherHint.js +0 -87
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/matchers.js +0 -366
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/toBeTruthy.js +0 -73
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/toEqual.js +0 -99
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/toHaveURL.js +0 -102
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +0 -159
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/toMatchSnapshot.js +0 -341
- package/playwright-mcp-test/node_modules/playwright/lib/matchers/toMatchText.js +0 -99
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/actions.d.js +0 -16
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +0 -296
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +0 -76
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/codegen.js +0 -66
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/config.js +0 -385
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/context.js +0 -287
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/response.js +0 -228
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/sessionLog.js +0 -160
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tab.js +0 -280
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/common.js +0 -63
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/console.js +0 -44
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +0 -60
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +0 -69
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/files.js +0 -58
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/form.js +0 -73
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/install.js +0 -69
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +0 -84
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/mouse.js +0 -107
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/navigate.js +0 -62
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/network.js +0 -54
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/pdf.js +0 -59
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +0 -106
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +0 -181
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/tabs.js +0 -67
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/tool.js +0 -49
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/tracing.js +0 -74
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/utils.js +0 -89
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/verify.js +0 -153
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools/wait.js +0 -63
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/tools.js +0 -80
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/browser/watchdog.js +0 -44
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/config.d.js +0 -16
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/extension/cdpRelay.js +0 -351
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +0 -75
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/extension/protocol.js +0 -28
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/index.js +0 -61
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/log.js +0 -35
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/program.js +0 -96
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/bundle.js +0 -81
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/exports.js +0 -32
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/http.js +0 -187
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +0 -71
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/mdb.js +0 -206
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/proxyBackend.js +0 -128
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/server.js +0 -189
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/sdk/tool.js +0 -51
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/browserBackend.js +0 -98
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/generatorTools.js +0 -122
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/plannerTools.js +0 -46
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/seed.js +0 -82
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/streams.js +0 -39
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/testBackend.js +0 -97
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/testContext.js +0 -176
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/testTool.js +0 -30
- package/playwright-mcp-test/node_modules/playwright/lib/mcp/test/testTools.js +0 -115
- package/playwright-mcp-test/node_modules/playwright/lib/mcpBundleImpl.js +0 -41
- package/playwright-mcp-test/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +0 -198
- package/playwright-mcp-test/node_modules/playwright/lib/plugins/index.js +0 -28
- package/playwright-mcp-test/node_modules/playwright/lib/plugins/webServerPlugin.js +0 -209
- package/playwright-mcp-test/node_modules/playwright/lib/program.js +0 -411
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/base.js +0 -609
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/blob.js +0 -135
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/dot.js +0 -82
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/empty.js +0 -32
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/github.js +0 -128
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/html.js +0 -623
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/internalReporter.js +0 -130
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/json.js +0 -254
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/junit.js +0 -232
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/line.js +0 -113
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/list.js +0 -235
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/listModeReporter.js +0 -69
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/markdown.js +0 -144
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/merge.js +0 -541
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/multiplexer.js +0 -104
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/reporterV2.js +0 -102
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/teleEmitter.js +0 -298
- package/playwright-mcp-test/node_modules/playwright/lib/reporters/versions/blobV1.js +0 -16
- package/playwright-mcp-test/node_modules/playwright/lib/runner/dispatcher.js +0 -491
- package/playwright-mcp-test/node_modules/playwright/lib/runner/failureTracker.js +0 -72
- package/playwright-mcp-test/node_modules/playwright/lib/runner/lastRun.js +0 -77
- package/playwright-mcp-test/node_modules/playwright/lib/runner/loadUtils.js +0 -334
- package/playwright-mcp-test/node_modules/playwright/lib/runner/loaderHost.js +0 -89
- package/playwright-mcp-test/node_modules/playwright/lib/runner/processHost.js +0 -161
- package/playwright-mcp-test/node_modules/playwright/lib/runner/projectUtils.js +0 -241
- package/playwright-mcp-test/node_modules/playwright/lib/runner/rebase.js +0 -189
- package/playwright-mcp-test/node_modules/playwright/lib/runner/reporters.js +0 -139
- package/playwright-mcp-test/node_modules/playwright/lib/runner/sigIntWatcher.js +0 -96
- package/playwright-mcp-test/node_modules/playwright/lib/runner/taskRunner.js +0 -127
- package/playwright-mcp-test/node_modules/playwright/lib/runner/tasks.js +0 -410
- package/playwright-mcp-test/node_modules/playwright/lib/runner/testGroups.js +0 -117
- package/playwright-mcp-test/node_modules/playwright/lib/runner/testRunner.js +0 -390
- package/playwright-mcp-test/node_modules/playwright/lib/runner/testServer.js +0 -264
- package/playwright-mcp-test/node_modules/playwright/lib/runner/uiModeReporter.js +0 -30
- package/playwright-mcp-test/node_modules/playwright/lib/runner/vcs.js +0 -72
- package/playwright-mcp-test/node_modules/playwright/lib/runner/watchMode.js +0 -395
- package/playwright-mcp-test/node_modules/playwright/lib/runner/workerHost.js +0 -95
- package/playwright-mcp-test/node_modules/playwright/lib/third_party/pirates.js +0 -62
- package/playwright-mcp-test/node_modules/playwright/lib/third_party/tsconfig-loader.js +0 -103
- package/playwright-mcp-test/node_modules/playwright/lib/transform/babelBundle.js +0 -43
- package/playwright-mcp-test/node_modules/playwright/lib/transform/babelBundleImpl.js +0 -461
- package/playwright-mcp-test/node_modules/playwright/lib/transform/compilationCache.js +0 -272
- package/playwright-mcp-test/node_modules/playwright/lib/transform/esmLoader.js +0 -104
- package/playwright-mcp-test/node_modules/playwright/lib/transform/portTransport.js +0 -67
- package/playwright-mcp-test/node_modules/playwright/lib/transform/transform.js +0 -293
- package/playwright-mcp-test/node_modules/playwright/lib/util.js +0 -403
- package/playwright-mcp-test/node_modules/playwright/lib/utilsBundle.js +0 -43
- package/playwright-mcp-test/node_modules/playwright/lib/utilsBundleImpl.js +0 -100
- package/playwright-mcp-test/node_modules/playwright/lib/worker/fixtureRunner.js +0 -258
- package/playwright-mcp-test/node_modules/playwright/lib/worker/testInfo.js +0 -514
- package/playwright-mcp-test/node_modules/playwright/lib/worker/testTracing.js +0 -344
- package/playwright-mcp-test/node_modules/playwright/lib/worker/timeoutManager.js +0 -174
- package/playwright-mcp-test/node_modules/playwright/lib/worker/util.js +0 -31
- package/playwright-mcp-test/node_modules/playwright/lib/worker/workerMain.js +0 -520
- package/playwright-mcp-test/node_modules/playwright/package.json +0 -72
- package/playwright-mcp-test/node_modules/playwright/test.d.ts +0 -18
- package/playwright-mcp-test/node_modules/playwright/test.js +0 -24
- package/playwright-mcp-test/node_modules/playwright/test.mjs +0 -33
- package/playwright-mcp-test/node_modules/playwright/types/test.d.ts +0 -10185
- package/playwright-mcp-test/node_modules/playwright/types/testReporter.d.ts +0 -821
- package/playwright-mcp-test/node_modules/playwright-core/LICENSE +0 -202
- package/playwright-mcp-test/node_modules/playwright-core/NOTICE +0 -5
- package/playwright-mcp-test/node_modules/playwright-core/README.md +0 -3
- package/playwright-mcp-test/node_modules/playwright-core/ThirdPartyNotices.txt +0 -1161
- package/playwright-mcp-test/node_modules/playwright-core/bin/install_media_pack.ps1 +0 -5
- package/playwright-mcp-test/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +0 -35
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +0 -42
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +0 -13
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +0 -24
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +0 -42
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +0 -12
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +0 -24
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +0 -48
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +0 -11
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +0 -23
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +0 -48
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +0 -11
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +0 -23
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +0 -48
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +0 -11
- package/playwright-mcp-test/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +0 -24
- package/playwright-mcp-test/node_modules/playwright-core/browsers.json +0 -80
- package/playwright-mcp-test/node_modules/playwright-core/cli.js +0 -18
- package/playwright-mcp-test/node_modules/playwright-core/index.d.ts +0 -17
- package/playwright-mcp-test/node_modules/playwright-core/index.js +0 -32
- package/playwright-mcp-test/node_modules/playwright-core/index.mjs +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/androidServerImpl.js +0 -65
- package/playwright-mcp-test/node_modules/playwright-core/lib/browserServerImpl.js +0 -120
- package/playwright-mcp-test/node_modules/playwright-core/lib/cli/driver.js +0 -97
- package/playwright-mcp-test/node_modules/playwright-core/lib/cli/program.js +0 -634
- package/playwright-mcp-test/node_modules/playwright-core/lib/cli/programWithTestStub.js +0 -74
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/accessibility.js +0 -49
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/android.js +0 -361
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/api.js +0 -137
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/artifact.js +0 -79
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/browser.js +0 -163
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/browserContext.js +0 -529
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/browserType.js +0 -184
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/cdpSession.js +0 -51
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/channelOwner.js +0 -194
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/clientHelper.js +0 -64
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/clientInstrumentation.js +0 -55
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/clientStackTrace.js +0 -69
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/clock.js +0 -68
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/connection.js +0 -314
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/consoleMessage.js +0 -54
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/coverage.js +0 -44
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/dialog.js +0 -56
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/download.js +0 -62
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/electron.js +0 -138
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/elementHandle.js +0 -281
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/errors.js +0 -77
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/eventEmitter.js +0 -314
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/events.js +0 -99
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/fetch.js +0 -369
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/fileChooser.js +0 -46
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/fileUtils.js +0 -34
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/frame.js +0 -408
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/harRouter.js +0 -87
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/input.js +0 -84
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/jsHandle.js +0 -109
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/jsonPipe.js +0 -39
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/localUtils.js +0 -60
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/locator.js +0 -369
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/network.js +0 -747
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/page.js +0 -721
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/platform.js +0 -74
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/playwright.js +0 -71
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/selectors.js +0 -55
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/stream.js +0 -39
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/timeoutSettings.js +0 -79
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/tracing.js +0 -117
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/types.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/video.js +0 -59
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/waiter.js +0 -142
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/webError.js +0 -39
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/webSocket.js +0 -93
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/worker.js +0 -63
- package/playwright-mcp-test/node_modules/playwright-core/lib/client/writableStream.js +0 -39
- package/playwright-mcp-test/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/generated/clockSource.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/generated/injectedScriptSource.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/generated/storageScriptSource.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/generated/utilityScriptSource.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/generated/webSocketMockSource.js +0 -336
- package/playwright-mcp-test/node_modules/playwright-core/lib/inProcessFactory.js +0 -60
- package/playwright-mcp-test/node_modules/playwright-core/lib/inprocess.js +0 -3
- package/playwright-mcp-test/node_modules/playwright-core/lib/outofprocess.js +0 -76
- package/playwright-mcp-test/node_modules/playwright-core/lib/protocol/serializers.js +0 -192
- package/playwright-mcp-test/node_modules/playwright-core/lib/protocol/validator.js +0 -2912
- package/playwright-mcp-test/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +0 -193
- package/playwright-mcp-test/node_modules/playwright-core/lib/remote/playwrightConnection.js +0 -129
- package/playwright-mcp-test/node_modules/playwright-core/lib/remote/playwrightServer.js +0 -335
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/accessibility.js +0 -69
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/android/android.js +0 -465
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/android/backendAdb.js +0 -177
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/artifact.js +0 -127
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +0 -490
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +0 -153
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +0 -212
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +0 -221
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +0 -130
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiInput.js +0 -146
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +0 -383
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +0 -102
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiPage.js +0 -554
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +0 -106
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +0 -22
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js +0 -98
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +0 -256
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +0 -24
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +0 -179
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +0 -42
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +0 -148
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +0 -259
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/browser.js +0 -149
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/browserContext.js +0 -695
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/browserType.js +0 -328
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/callLog.js +0 -82
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/chromium.js +0 -402
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +0 -95
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crAccessibility.js +0 -263
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crBrowser.js +0 -502
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crConnection.js +0 -202
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crCoverage.js +0 -235
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crDevTools.js +0 -113
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +0 -131
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +0 -146
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crInput.js +0 -187
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +0 -666
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crPage.js +0 -1069
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crPdf.js +0 -121
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +0 -145
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +0 -123
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +0 -162
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/protocol.d.js +0 -16
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/chromium/videoRecorder.js +0 -113
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/clock.js +0 -149
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/csharp.js +0 -327
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/java.js +0 -274
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/javascript.js +0 -270
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/jsonl.js +0 -52
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/language.js +0 -132
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/languages.js +0 -68
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/python.js +0 -279
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/codegen/types.js +0 -16
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/console.js +0 -53
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/cookieStore.js +0 -206
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/debugController.js +0 -191
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/debugger.js +0 -119
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/deviceDescriptors.js +0 -39
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +0 -1779
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dialog.js +0 -116
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +0 -325
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +0 -118
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +0 -364
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +0 -118
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +0 -64
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +0 -44
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +0 -78
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +0 -47
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +0 -371
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +0 -89
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +0 -181
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +0 -227
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +0 -85
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +0 -58
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +0 -149
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +0 -213
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +0 -401
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +0 -108
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +0 -67
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +0 -68
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -165
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +0 -79
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/dom.js +0 -806
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/download.js +0 -70
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/electron/electron.js +0 -270
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/electron/loader.js +0 -29
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/errors.js +0 -69
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/fetch.js +0 -621
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/fileChooser.js +0 -43
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/fileUploadUtils.js +0 -84
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/ffAccessibility.js +0 -238
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +0 -428
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/ffConnection.js +0 -147
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +0 -150
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/ffInput.js +0 -159
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +0 -256
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/ffPage.js +0 -503
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/firefox.js +0 -116
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/firefox/protocol.d.js +0 -16
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/formData.js +0 -147
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/frameSelectors.js +0 -154
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/frames.js +0 -1455
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/har/harRecorder.js +0 -147
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/har/harTracer.js +0 -607
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/harBackend.js +0 -157
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/helper.js +0 -96
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/index.js +0 -58
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/input.js +0 -273
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/instrumentation.js +0 -69
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/javascript.js +0 -291
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/launchApp.js +0 -128
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/localUtils.js +0 -214
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/macEditingCommands.js +0 -143
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/network.js +0 -629
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/page.js +0 -867
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/pipeTransport.js +0 -89
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/playwright.js +0 -69
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/progress.js +0 -112
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/protocolError.js +0 -52
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/recorder/chat.js +0 -161
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/recorder/recorderApp.js +0 -387
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +0 -138
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +0 -83
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +0 -157
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/recorder/throttledFile.js +0 -57
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/recorder.js +0 -499
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/registry/browserFetcher.js +0 -175
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/registry/dependencies.js +0 -371
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/registry/index.js +0 -1361
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/registry/nativeDeps.js +0 -1280
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +0 -124
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/screenshotter.js +0 -333
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/selectors.js +0 -112
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +0 -383
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/socksInterceptor.js +0 -95
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +0 -147
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +0 -541
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +0 -602
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js +0 -87
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +0 -230
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/transport.js +0 -181
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/types.js +0 -28
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/usKeyboardLayout.js +0 -145
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/ascii.js +0 -44
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/comparators.js +0 -139
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/crypto.js +0 -216
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/debug.js +0 -42
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/debugLogger.js +0 -122
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/env.js +0 -73
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/eventsHelper.js +0 -39
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/expectUtils.js +0 -38
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/fileUtils.js +0 -191
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +0 -207
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/hostPlatform.js +0 -123
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/httpServer.js +0 -218
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/imageUtils.js +0 -146
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +0 -89
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +0 -109
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +0 -78
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +0 -102
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/linuxUtils.js +0 -71
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/network.js +0 -233
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/nodePlatform.js +0 -148
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/pipeTransport.js +0 -84
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/processLauncher.js +0 -241
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/profiler.js +0 -65
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/socksProxy.js +0 -511
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/spawnAsync.js +0 -41
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/task.js +0 -51
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/userAgent.js +0 -98
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/wsServer.js +0 -121
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/zipFile.js +0 -74
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/utils/zones.js +0 -57
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/protocol.d.js +0 -16
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/webkit.js +0 -119
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkAccessibility.js +0 -237
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +0 -339
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkConnection.js +0 -149
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +0 -154
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkInput.js +0 -181
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +0 -169
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkPage.js +0 -1134
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +0 -83
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +0 -104
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wsl/webkit-wsl-transport-client.js +0 -74
- package/playwright-mcp-test/node_modules/playwright-core/lib/server/webkit/wsl/webkit-wsl-transport-server.js +0 -113
- package/playwright-mcp-test/node_modules/playwright-core/lib/third_party/pixelmatch.js +0 -255
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +0 -392
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/assert.js +0 -31
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/colors.js +0 -72
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +0 -245
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +0 -1051
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/headers.js +0 -53
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +0 -689
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +0 -176
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +0 -81
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +0 -114
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +0 -459
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +0 -80
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +0 -81
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +0 -321
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +0 -43
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +0 -386
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +0 -54
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +0 -158
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +0 -155
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/time.js +0 -49
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +0 -66
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +0 -58
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/types.js +0 -16
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +0 -179
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +0 -251
- package/playwright-mcp-test/node_modules/playwright-core/lib/utils.js +0 -109
- package/playwright-mcp-test/node_modules/playwright-core/lib/utilsBundle.js +0 -112
- package/playwright-mcp-test/node_modules/playwright-core/lib/utilsBundleImpl/index.js +0 -218
- package/playwright-mcp-test/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +0 -1066
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/htmlReport/index.html +0 -84
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +0 -1
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DX585GyR.js +0 -25
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/recorder/assets/index-DjadjNw5.js +0 -193
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/recorder/assets/index-Ri0uHF7I.css +0 -1
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/recorder/index.html +0 -29
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +0 -9
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-Cw-6jrKz.js +0 -25
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-BZIhX7gh.js +0 -266
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +0 -9
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +0 -1
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BEjzWGz-.css +0 -1
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/index.Dk_obRs3.js +0 -2
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/index.I8N9v4jT.css +0 -1
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/index.html +0 -43
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +0 -16
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +0 -9
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +0 -21
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +0 -3
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Bai-qGIw.js +0 -5
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +0 -1
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +0 -17
- package/playwright-mcp-test/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +0 -32
- package/playwright-mcp-test/node_modules/playwright-core/lib/zipBundle.js +0 -34
- package/playwright-mcp-test/node_modules/playwright-core/lib/zipBundleImpl.js +0 -5
- package/playwright-mcp-test/node_modules/playwright-core/package.json +0 -42
- package/playwright-mcp-test/node_modules/playwright-core/types/protocol.d.ts +0 -23130
- package/playwright-mcp-test/node_modules/playwright-core/types/structs.d.ts +0 -45
- package/playwright-mcp-test/node_modules/playwright-core/types/types.d.ts +0 -22872
- package/playwright-mcp-test/package-lock.json +0 -76
|
@@ -1,1455 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var frames_exports = {};
|
|
30
|
-
__export(frames_exports, {
|
|
31
|
-
Frame: () => Frame,
|
|
32
|
-
FrameManager: () => FrameManager,
|
|
33
|
-
NavigationAbortedError: () => NavigationAbortedError
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(frames_exports);
|
|
36
|
-
var import_browserContext = require("./browserContext");
|
|
37
|
-
var dom = __toESM(require("./dom"));
|
|
38
|
-
var import_errors = require("./errors");
|
|
39
|
-
var import_fileUploadUtils = require("./fileUploadUtils");
|
|
40
|
-
var import_frameSelectors = require("./frameSelectors");
|
|
41
|
-
var import_helper = require("./helper");
|
|
42
|
-
var import_instrumentation = require("./instrumentation");
|
|
43
|
-
var js = __toESM(require("./javascript"));
|
|
44
|
-
var network = __toESM(require("./network"));
|
|
45
|
-
var import_page = require("./page");
|
|
46
|
-
var import_progress = require("./progress");
|
|
47
|
-
var types = __toESM(require("./types"));
|
|
48
|
-
var import_utils = require("../utils");
|
|
49
|
-
var import_protocolError = require("./protocolError");
|
|
50
|
-
var import_debugLogger = require("./utils/debugLogger");
|
|
51
|
-
var import_eventsHelper = require("./utils/eventsHelper");
|
|
52
|
-
var import_selectorParser = require("../utils/isomorphic/selectorParser");
|
|
53
|
-
var import_manualPromise = require("../utils/isomorphic/manualPromise");
|
|
54
|
-
var import_callLog = require("./callLog");
|
|
55
|
-
class NavigationAbortedError extends Error {
|
|
56
|
-
constructor(documentId, message) {
|
|
57
|
-
super(message);
|
|
58
|
-
this.documentId = documentId;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const kDummyFrameId = "<dummy>";
|
|
62
|
-
class FrameManager {
|
|
63
|
-
constructor(page) {
|
|
64
|
-
this._frames = /* @__PURE__ */ new Map();
|
|
65
|
-
this._consoleMessageTags = /* @__PURE__ */ new Map();
|
|
66
|
-
this._signalBarriers = /* @__PURE__ */ new Set();
|
|
67
|
-
this._webSockets = /* @__PURE__ */ new Map();
|
|
68
|
-
this._nextFrameSeq = 0;
|
|
69
|
-
this._page = page;
|
|
70
|
-
this._mainFrame = void 0;
|
|
71
|
-
}
|
|
72
|
-
nextFrameSeq() {
|
|
73
|
-
return this._nextFrameSeq++;
|
|
74
|
-
}
|
|
75
|
-
createDummyMainFrameIfNeeded() {
|
|
76
|
-
if (!this._mainFrame)
|
|
77
|
-
this.frameAttached(kDummyFrameId, null);
|
|
78
|
-
}
|
|
79
|
-
dispose() {
|
|
80
|
-
for (const frame of this._frames.values()) {
|
|
81
|
-
frame._stopNetworkIdleTimer();
|
|
82
|
-
frame._invalidateNonStallingEvaluations("Target crashed");
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
mainFrame() {
|
|
86
|
-
return this._mainFrame;
|
|
87
|
-
}
|
|
88
|
-
frames() {
|
|
89
|
-
const frames = [];
|
|
90
|
-
collect(this._mainFrame);
|
|
91
|
-
return frames;
|
|
92
|
-
function collect(frame) {
|
|
93
|
-
frames.push(frame);
|
|
94
|
-
for (const subframe of frame.childFrames())
|
|
95
|
-
collect(subframe);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
frame(frameId) {
|
|
99
|
-
return this._frames.get(frameId) || null;
|
|
100
|
-
}
|
|
101
|
-
frameAttached(frameId, parentFrameId) {
|
|
102
|
-
const parentFrame = parentFrameId ? this._frames.get(parentFrameId) : null;
|
|
103
|
-
if (!parentFrame) {
|
|
104
|
-
if (this._mainFrame) {
|
|
105
|
-
this._frames.delete(this._mainFrame._id);
|
|
106
|
-
this._mainFrame._id = frameId;
|
|
107
|
-
} else {
|
|
108
|
-
(0, import_utils.assert)(!this._frames.has(frameId));
|
|
109
|
-
this._mainFrame = new Frame(this._page, frameId, parentFrame);
|
|
110
|
-
}
|
|
111
|
-
this._frames.set(frameId, this._mainFrame);
|
|
112
|
-
return this._mainFrame;
|
|
113
|
-
} else {
|
|
114
|
-
(0, import_utils.assert)(!this._frames.has(frameId));
|
|
115
|
-
const frame = new Frame(this._page, frameId, parentFrame);
|
|
116
|
-
this._frames.set(frameId, frame);
|
|
117
|
-
this._page.emit(import_page.Page.Events.FrameAttached, frame);
|
|
118
|
-
return frame;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
async waitForSignalsCreatedBy(progress, waitAfter, action) {
|
|
122
|
-
if (!waitAfter)
|
|
123
|
-
return action();
|
|
124
|
-
const barrier = new SignalBarrier(progress);
|
|
125
|
-
this._signalBarriers.add(barrier);
|
|
126
|
-
try {
|
|
127
|
-
const result = await action();
|
|
128
|
-
await progress.race(this._page.delegate.inputActionEpilogue());
|
|
129
|
-
await barrier.waitFor();
|
|
130
|
-
await new Promise((0, import_utils.makeWaitForNextTask)());
|
|
131
|
-
return result;
|
|
132
|
-
} finally {
|
|
133
|
-
this._signalBarriers.delete(barrier);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
frameWillPotentiallyRequestNavigation() {
|
|
137
|
-
for (const barrier of this._signalBarriers)
|
|
138
|
-
barrier.retain();
|
|
139
|
-
}
|
|
140
|
-
frameDidPotentiallyRequestNavigation() {
|
|
141
|
-
for (const barrier of this._signalBarriers)
|
|
142
|
-
barrier.release();
|
|
143
|
-
}
|
|
144
|
-
frameRequestedNavigation(frameId, documentId) {
|
|
145
|
-
const frame = this._frames.get(frameId);
|
|
146
|
-
if (!frame)
|
|
147
|
-
return;
|
|
148
|
-
for (const barrier of this._signalBarriers)
|
|
149
|
-
barrier.addFrameNavigation(frame);
|
|
150
|
-
if (frame.pendingDocument() && frame.pendingDocument().documentId === documentId) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const request = documentId ? Array.from(frame._inflightRequests).find((request2) => request2._documentId === documentId) : void 0;
|
|
154
|
-
frame.setPendingDocument({ documentId, request });
|
|
155
|
-
}
|
|
156
|
-
frameCommittedNewDocumentNavigation(frameId, url, name, documentId, initial) {
|
|
157
|
-
const frame = this._frames.get(frameId);
|
|
158
|
-
this.removeChildFramesRecursively(frame);
|
|
159
|
-
this.clearWebSockets(frame);
|
|
160
|
-
frame._url = url;
|
|
161
|
-
frame._name = name;
|
|
162
|
-
let keepPending;
|
|
163
|
-
const pendingDocument = frame.pendingDocument();
|
|
164
|
-
if (pendingDocument) {
|
|
165
|
-
if (pendingDocument.documentId === void 0) {
|
|
166
|
-
pendingDocument.documentId = documentId;
|
|
167
|
-
}
|
|
168
|
-
if (pendingDocument.documentId === documentId) {
|
|
169
|
-
frame._currentDocument = pendingDocument;
|
|
170
|
-
} else {
|
|
171
|
-
keepPending = pendingDocument;
|
|
172
|
-
frame._currentDocument = { documentId, request: void 0 };
|
|
173
|
-
}
|
|
174
|
-
frame.setPendingDocument(void 0);
|
|
175
|
-
} else {
|
|
176
|
-
frame._currentDocument = { documentId, request: void 0 };
|
|
177
|
-
}
|
|
178
|
-
frame._onClearLifecycle();
|
|
179
|
-
const navigationEvent = { url, name, newDocument: frame._currentDocument, isPublic: true };
|
|
180
|
-
this._fireInternalFrameNavigation(frame, navigationEvent);
|
|
181
|
-
if (!initial) {
|
|
182
|
-
import_debugLogger.debugLogger.log("api", ` navigated to "${url}"`);
|
|
183
|
-
this._page.frameNavigatedToNewDocument(frame);
|
|
184
|
-
}
|
|
185
|
-
frame.setPendingDocument(keepPending);
|
|
186
|
-
}
|
|
187
|
-
frameCommittedSameDocumentNavigation(frameId, url) {
|
|
188
|
-
const frame = this._frames.get(frameId);
|
|
189
|
-
if (!frame)
|
|
190
|
-
return;
|
|
191
|
-
const pending = frame.pendingDocument();
|
|
192
|
-
if (pending && pending.documentId === void 0 && pending.request === void 0) {
|
|
193
|
-
frame.setPendingDocument(void 0);
|
|
194
|
-
}
|
|
195
|
-
frame._url = url;
|
|
196
|
-
const navigationEvent = { url, name: frame._name, isPublic: true };
|
|
197
|
-
this._fireInternalFrameNavigation(frame, navigationEvent);
|
|
198
|
-
import_debugLogger.debugLogger.log("api", ` navigated to "${url}"`);
|
|
199
|
-
}
|
|
200
|
-
frameAbortedNavigation(frameId, errorText, documentId) {
|
|
201
|
-
const frame = this._frames.get(frameId);
|
|
202
|
-
if (!frame || !frame.pendingDocument())
|
|
203
|
-
return;
|
|
204
|
-
if (documentId !== void 0 && frame.pendingDocument().documentId !== documentId)
|
|
205
|
-
return;
|
|
206
|
-
const navigationEvent = {
|
|
207
|
-
url: frame._url,
|
|
208
|
-
name: frame._name,
|
|
209
|
-
newDocument: frame.pendingDocument(),
|
|
210
|
-
error: new NavigationAbortedError(documentId, errorText),
|
|
211
|
-
isPublic: !(documentId && frame._redirectedNavigations.has(documentId))
|
|
212
|
-
};
|
|
213
|
-
frame.setPendingDocument(void 0);
|
|
214
|
-
this._fireInternalFrameNavigation(frame, navigationEvent);
|
|
215
|
-
}
|
|
216
|
-
frameDetached(frameId) {
|
|
217
|
-
const frame = this._frames.get(frameId);
|
|
218
|
-
if (frame) {
|
|
219
|
-
this._removeFramesRecursively(frame);
|
|
220
|
-
this._page.mainFrame()._recalculateNetworkIdle();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
frameLifecycleEvent(frameId, event) {
|
|
224
|
-
const frame = this._frames.get(frameId);
|
|
225
|
-
if (frame)
|
|
226
|
-
frame._onLifecycleEvent(event);
|
|
227
|
-
}
|
|
228
|
-
requestStarted(request, route) {
|
|
229
|
-
const frame = request.frame();
|
|
230
|
-
this._inflightRequestStarted(request);
|
|
231
|
-
if (request._documentId)
|
|
232
|
-
frame.setPendingDocument({ documentId: request._documentId, request });
|
|
233
|
-
if (request._isFavicon) {
|
|
234
|
-
route?.abort("aborted").catch(() => {
|
|
235
|
-
});
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
this._page.addNetworkRequest(request);
|
|
239
|
-
this._page.emitOnContext(import_browserContext.BrowserContext.Events.Request, request);
|
|
240
|
-
if (route)
|
|
241
|
-
new network.Route(request, route).handle([...this._page.requestInterceptors, ...this._page.browserContext.requestInterceptors]);
|
|
242
|
-
}
|
|
243
|
-
requestReceivedResponse(response) {
|
|
244
|
-
if (response.request()._isFavicon)
|
|
245
|
-
return;
|
|
246
|
-
this._page.emitOnContext(import_browserContext.BrowserContext.Events.Response, response);
|
|
247
|
-
}
|
|
248
|
-
reportRequestFinished(request, response) {
|
|
249
|
-
this._inflightRequestFinished(request);
|
|
250
|
-
if (request._isFavicon)
|
|
251
|
-
return;
|
|
252
|
-
this._page.emitOnContext(import_browserContext.BrowserContext.Events.RequestFinished, { request, response });
|
|
253
|
-
}
|
|
254
|
-
requestFailed(request, canceled) {
|
|
255
|
-
const frame = request.frame();
|
|
256
|
-
this._inflightRequestFinished(request);
|
|
257
|
-
if (frame.pendingDocument() && frame.pendingDocument().request === request) {
|
|
258
|
-
let errorText = request.failure().errorText;
|
|
259
|
-
if (canceled)
|
|
260
|
-
errorText += "; maybe frame was detached?";
|
|
261
|
-
this.frameAbortedNavigation(frame._id, errorText, frame.pendingDocument().documentId);
|
|
262
|
-
}
|
|
263
|
-
if (request._isFavicon)
|
|
264
|
-
return;
|
|
265
|
-
this._page.emitOnContext(import_browserContext.BrowserContext.Events.RequestFailed, request);
|
|
266
|
-
}
|
|
267
|
-
removeChildFramesRecursively(frame) {
|
|
268
|
-
for (const child of frame.childFrames())
|
|
269
|
-
this._removeFramesRecursively(child);
|
|
270
|
-
}
|
|
271
|
-
_removeFramesRecursively(frame) {
|
|
272
|
-
this.removeChildFramesRecursively(frame);
|
|
273
|
-
frame._onDetached();
|
|
274
|
-
this._frames.delete(frame._id);
|
|
275
|
-
if (!this._page.isClosed())
|
|
276
|
-
this._page.emit(import_page.Page.Events.FrameDetached, frame);
|
|
277
|
-
}
|
|
278
|
-
_inflightRequestFinished(request) {
|
|
279
|
-
const frame = request.frame();
|
|
280
|
-
if (request._isFavicon)
|
|
281
|
-
return;
|
|
282
|
-
if (!frame._inflightRequests.has(request))
|
|
283
|
-
return;
|
|
284
|
-
frame._inflightRequests.delete(request);
|
|
285
|
-
if (frame._inflightRequests.size === 0)
|
|
286
|
-
frame._startNetworkIdleTimer();
|
|
287
|
-
}
|
|
288
|
-
_inflightRequestStarted(request) {
|
|
289
|
-
const frame = request.frame();
|
|
290
|
-
if (request._isFavicon)
|
|
291
|
-
return;
|
|
292
|
-
frame._inflightRequests.add(request);
|
|
293
|
-
if (frame._inflightRequests.size === 1)
|
|
294
|
-
frame._stopNetworkIdleTimer();
|
|
295
|
-
}
|
|
296
|
-
interceptConsoleMessage(message) {
|
|
297
|
-
if (message.type() !== "debug")
|
|
298
|
-
return false;
|
|
299
|
-
const tag = message.text();
|
|
300
|
-
const handler = this._consoleMessageTags.get(tag);
|
|
301
|
-
if (!handler)
|
|
302
|
-
return false;
|
|
303
|
-
this._consoleMessageTags.delete(tag);
|
|
304
|
-
handler();
|
|
305
|
-
return true;
|
|
306
|
-
}
|
|
307
|
-
clearWebSockets(frame) {
|
|
308
|
-
if (frame.parentFrame())
|
|
309
|
-
return;
|
|
310
|
-
this._webSockets.clear();
|
|
311
|
-
}
|
|
312
|
-
onWebSocketCreated(requestId, url) {
|
|
313
|
-
const ws = new network.WebSocket(this._page, url);
|
|
314
|
-
this._webSockets.set(requestId, ws);
|
|
315
|
-
}
|
|
316
|
-
onWebSocketRequest(requestId) {
|
|
317
|
-
const ws = this._webSockets.get(requestId);
|
|
318
|
-
if (ws && ws.markAsNotified())
|
|
319
|
-
this._page.emit(import_page.Page.Events.WebSocket, ws);
|
|
320
|
-
}
|
|
321
|
-
onWebSocketResponse(requestId, status, statusText) {
|
|
322
|
-
const ws = this._webSockets.get(requestId);
|
|
323
|
-
if (status < 400)
|
|
324
|
-
return;
|
|
325
|
-
if (ws)
|
|
326
|
-
ws.error(`${statusText}: ${status}`);
|
|
327
|
-
}
|
|
328
|
-
onWebSocketFrameSent(requestId, opcode, data) {
|
|
329
|
-
const ws = this._webSockets.get(requestId);
|
|
330
|
-
if (ws)
|
|
331
|
-
ws.frameSent(opcode, data);
|
|
332
|
-
}
|
|
333
|
-
webSocketFrameReceived(requestId, opcode, data) {
|
|
334
|
-
const ws = this._webSockets.get(requestId);
|
|
335
|
-
if (ws)
|
|
336
|
-
ws.frameReceived(opcode, data);
|
|
337
|
-
}
|
|
338
|
-
webSocketClosed(requestId) {
|
|
339
|
-
const ws = this._webSockets.get(requestId);
|
|
340
|
-
if (ws)
|
|
341
|
-
ws.closed();
|
|
342
|
-
this._webSockets.delete(requestId);
|
|
343
|
-
}
|
|
344
|
-
webSocketError(requestId, errorMessage) {
|
|
345
|
-
const ws = this._webSockets.get(requestId);
|
|
346
|
-
if (ws)
|
|
347
|
-
ws.error(errorMessage);
|
|
348
|
-
}
|
|
349
|
-
_fireInternalFrameNavigation(frame, event) {
|
|
350
|
-
frame.emit(Frame.Events.InternalNavigation, event);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
class Frame extends import_instrumentation.SdkObject {
|
|
354
|
-
constructor(page, id, parentFrame) {
|
|
355
|
-
super(page, "frame");
|
|
356
|
-
this._firedLifecycleEvents = /* @__PURE__ */ new Set();
|
|
357
|
-
this._firedNetworkIdleSelf = false;
|
|
358
|
-
this._url = "";
|
|
359
|
-
this._contextData = /* @__PURE__ */ new Map();
|
|
360
|
-
this._childFrames = /* @__PURE__ */ new Set();
|
|
361
|
-
this._name = "";
|
|
362
|
-
this._inflightRequests = /* @__PURE__ */ new Set();
|
|
363
|
-
this._setContentCounter = 0;
|
|
364
|
-
this._detachedScope = new import_utils.LongStandingScope();
|
|
365
|
-
this._raceAgainstEvaluationStallingEventsPromises = /* @__PURE__ */ new Set();
|
|
366
|
-
this._redirectedNavigations = /* @__PURE__ */ new Map();
|
|
367
|
-
this.attribution.frame = this;
|
|
368
|
-
this.seq = page.frameManager.nextFrameSeq();
|
|
369
|
-
this._id = id;
|
|
370
|
-
this._page = page;
|
|
371
|
-
this._parentFrame = parentFrame;
|
|
372
|
-
this._currentDocument = { documentId: void 0, request: void 0 };
|
|
373
|
-
this.selectors = new import_frameSelectors.FrameSelectors(this);
|
|
374
|
-
this._contextData.set("main", { contextPromise: new import_manualPromise.ManualPromise(), context: null });
|
|
375
|
-
this._contextData.set("utility", { contextPromise: new import_manualPromise.ManualPromise(), context: null });
|
|
376
|
-
this._setContext("main", null);
|
|
377
|
-
this._setContext("utility", null);
|
|
378
|
-
if (this._parentFrame)
|
|
379
|
-
this._parentFrame._childFrames.add(this);
|
|
380
|
-
this._firedLifecycleEvents.add("commit");
|
|
381
|
-
if (id !== kDummyFrameId)
|
|
382
|
-
this._startNetworkIdleTimer();
|
|
383
|
-
}
|
|
384
|
-
static {
|
|
385
|
-
this.Events = {
|
|
386
|
-
InternalNavigation: "internalnavigation",
|
|
387
|
-
AddLifecycle: "addlifecycle",
|
|
388
|
-
RemoveLifecycle: "removelifecycle"
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
isDetached() {
|
|
392
|
-
return this._detachedScope.isClosed();
|
|
393
|
-
}
|
|
394
|
-
_onLifecycleEvent(event) {
|
|
395
|
-
if (this._firedLifecycleEvents.has(event))
|
|
396
|
-
return;
|
|
397
|
-
this._firedLifecycleEvents.add(event);
|
|
398
|
-
this.emit(Frame.Events.AddLifecycle, event);
|
|
399
|
-
if (this === this._page.mainFrame() && this._url !== "about:blank")
|
|
400
|
-
import_debugLogger.debugLogger.log("api", ` "${event}" event fired`);
|
|
401
|
-
this._page.mainFrame()._recalculateNetworkIdle();
|
|
402
|
-
}
|
|
403
|
-
_onClearLifecycle() {
|
|
404
|
-
for (const event of this._firedLifecycleEvents)
|
|
405
|
-
this.emit(Frame.Events.RemoveLifecycle, event);
|
|
406
|
-
this._firedLifecycleEvents.clear();
|
|
407
|
-
this._inflightRequests = new Set(Array.from(this._inflightRequests).filter((request) => request === this._currentDocument.request));
|
|
408
|
-
this._stopNetworkIdleTimer();
|
|
409
|
-
if (this._inflightRequests.size === 0)
|
|
410
|
-
this._startNetworkIdleTimer();
|
|
411
|
-
this._page.mainFrame()._recalculateNetworkIdle(this);
|
|
412
|
-
this._onLifecycleEvent("commit");
|
|
413
|
-
}
|
|
414
|
-
setPendingDocument(documentInfo) {
|
|
415
|
-
this._pendingDocument = documentInfo;
|
|
416
|
-
if (documentInfo)
|
|
417
|
-
this._invalidateNonStallingEvaluations("Navigation interrupted the evaluation");
|
|
418
|
-
}
|
|
419
|
-
pendingDocument() {
|
|
420
|
-
return this._pendingDocument;
|
|
421
|
-
}
|
|
422
|
-
_invalidateNonStallingEvaluations(message) {
|
|
423
|
-
if (!this._raceAgainstEvaluationStallingEventsPromises.size)
|
|
424
|
-
return;
|
|
425
|
-
const error = new Error(message);
|
|
426
|
-
for (const promise of this._raceAgainstEvaluationStallingEventsPromises)
|
|
427
|
-
promise.reject(error);
|
|
428
|
-
}
|
|
429
|
-
async raceAgainstEvaluationStallingEvents(cb) {
|
|
430
|
-
if (this._pendingDocument)
|
|
431
|
-
throw new Error("Frame is currently attempting a navigation");
|
|
432
|
-
if (this._page.browserContext.dialogManager.hasOpenDialogsForPage(this._page))
|
|
433
|
-
throw new Error("Open JavaScript dialog prevents evaluation");
|
|
434
|
-
const promise = new import_manualPromise.ManualPromise();
|
|
435
|
-
this._raceAgainstEvaluationStallingEventsPromises.add(promise);
|
|
436
|
-
try {
|
|
437
|
-
return await Promise.race([
|
|
438
|
-
cb(),
|
|
439
|
-
promise
|
|
440
|
-
]);
|
|
441
|
-
} finally {
|
|
442
|
-
this._raceAgainstEvaluationStallingEventsPromises.delete(promise);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
nonStallingRawEvaluateInExistingMainContext(expression) {
|
|
446
|
-
return this.raceAgainstEvaluationStallingEvents(() => {
|
|
447
|
-
const context = this._existingMainContext();
|
|
448
|
-
if (!context)
|
|
449
|
-
throw new Error("Frame does not yet have a main execution context");
|
|
450
|
-
return context.rawEvaluateJSON(expression);
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
nonStallingEvaluateInExistingContext(expression, world) {
|
|
454
|
-
return this.raceAgainstEvaluationStallingEvents(() => {
|
|
455
|
-
const context = this._contextData.get(world)?.context;
|
|
456
|
-
if (!context)
|
|
457
|
-
throw new Error("Frame does not yet have the execution context");
|
|
458
|
-
return context.evaluateExpression(expression, { isFunction: false });
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
_recalculateNetworkIdle(frameThatAllowsRemovingNetworkIdle) {
|
|
462
|
-
let isNetworkIdle = this._firedNetworkIdleSelf;
|
|
463
|
-
for (const child of this._childFrames) {
|
|
464
|
-
child._recalculateNetworkIdle(frameThatAllowsRemovingNetworkIdle);
|
|
465
|
-
if (!child._firedLifecycleEvents.has("networkidle"))
|
|
466
|
-
isNetworkIdle = false;
|
|
467
|
-
}
|
|
468
|
-
if (isNetworkIdle && !this._firedLifecycleEvents.has("networkidle")) {
|
|
469
|
-
this._firedLifecycleEvents.add("networkidle");
|
|
470
|
-
this.emit(Frame.Events.AddLifecycle, "networkidle");
|
|
471
|
-
if (this === this._page.mainFrame() && this._url !== "about:blank")
|
|
472
|
-
import_debugLogger.debugLogger.log("api", ` "networkidle" event fired`);
|
|
473
|
-
}
|
|
474
|
-
if (frameThatAllowsRemovingNetworkIdle !== this && this._firedLifecycleEvents.has("networkidle") && !isNetworkIdle) {
|
|
475
|
-
this._firedLifecycleEvents.delete("networkidle");
|
|
476
|
-
this.emit(Frame.Events.RemoveLifecycle, "networkidle");
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
async raceNavigationAction(progress, action) {
|
|
480
|
-
return import_utils.LongStandingScope.raceMultiple([
|
|
481
|
-
this._detachedScope,
|
|
482
|
-
this._page.openScope
|
|
483
|
-
], action().catch((e) => {
|
|
484
|
-
if (e instanceof NavigationAbortedError && e.documentId) {
|
|
485
|
-
const data = this._redirectedNavigations.get(e.documentId);
|
|
486
|
-
if (data) {
|
|
487
|
-
progress.log(`waiting for redirected navigation to "${data.url}"`);
|
|
488
|
-
return progress.race(data.gotoPromise);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
throw e;
|
|
492
|
-
}));
|
|
493
|
-
}
|
|
494
|
-
redirectNavigation(url, documentId, referer) {
|
|
495
|
-
const controller = new import_progress.ProgressController();
|
|
496
|
-
const data = {
|
|
497
|
-
url,
|
|
498
|
-
gotoPromise: controller.run((progress) => this.gotoImpl(progress, url, { referer }), 0)
|
|
499
|
-
};
|
|
500
|
-
this._redirectedNavigations.set(documentId, data);
|
|
501
|
-
data.gotoPromise.finally(() => this._redirectedNavigations.delete(documentId));
|
|
502
|
-
}
|
|
503
|
-
async goto(progress, url, options = {}) {
|
|
504
|
-
const constructedNavigationURL = (0, import_utils.constructURLBasedOnBaseURL)(this._page.browserContext._options.baseURL, url);
|
|
505
|
-
return this.raceNavigationAction(progress, async () => this.gotoImpl(progress, constructedNavigationURL, options));
|
|
506
|
-
}
|
|
507
|
-
async gotoImpl(progress, url, options) {
|
|
508
|
-
const waitUntil = verifyLifecycle("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
|
509
|
-
progress.log(`navigating to "${url}", waiting until "${waitUntil}"`);
|
|
510
|
-
const headers = this._page.extraHTTPHeaders() || [];
|
|
511
|
-
const refererHeader = headers.find((h) => h.name.toLowerCase() === "referer");
|
|
512
|
-
let referer = refererHeader ? refererHeader.value : void 0;
|
|
513
|
-
if (options.referer !== void 0) {
|
|
514
|
-
if (referer !== void 0 && referer !== options.referer)
|
|
515
|
-
throw new Error('"referer" is already specified as extra HTTP header');
|
|
516
|
-
referer = options.referer;
|
|
517
|
-
}
|
|
518
|
-
url = import_helper.helper.completeUserURL(url);
|
|
519
|
-
const navigationEvents = [];
|
|
520
|
-
const collectNavigations = (arg) => navigationEvents.push(arg);
|
|
521
|
-
this.on(Frame.Events.InternalNavigation, collectNavigations);
|
|
522
|
-
const navigateResult = await progress.race(this._page.delegate.navigateFrame(this, url, referer)).finally(
|
|
523
|
-
() => this.off(Frame.Events.InternalNavigation, collectNavigations)
|
|
524
|
-
);
|
|
525
|
-
let event;
|
|
526
|
-
if (navigateResult.newDocumentId) {
|
|
527
|
-
const predicate = (event2) => {
|
|
528
|
-
return event2.newDocument && (event2.newDocument.documentId === navigateResult.newDocumentId || !event2.error);
|
|
529
|
-
};
|
|
530
|
-
const events = navigationEvents.filter(predicate);
|
|
531
|
-
if (events.length)
|
|
532
|
-
event = events[0];
|
|
533
|
-
else
|
|
534
|
-
event = await import_helper.helper.waitForEvent(progress, this, Frame.Events.InternalNavigation, predicate).promise;
|
|
535
|
-
if (event.newDocument.documentId !== navigateResult.newDocumentId) {
|
|
536
|
-
throw new NavigationAbortedError(navigateResult.newDocumentId, `Navigation to "${url}" is interrupted by another navigation to "${event.url}"`);
|
|
537
|
-
}
|
|
538
|
-
if (event.error)
|
|
539
|
-
throw event.error;
|
|
540
|
-
} else {
|
|
541
|
-
const predicate = (e) => !e.newDocument;
|
|
542
|
-
const events = navigationEvents.filter(predicate);
|
|
543
|
-
if (events.length)
|
|
544
|
-
event = events[0];
|
|
545
|
-
else
|
|
546
|
-
event = await import_helper.helper.waitForEvent(progress, this, Frame.Events.InternalNavigation, predicate).promise;
|
|
547
|
-
}
|
|
548
|
-
if (!this._firedLifecycleEvents.has(waitUntil))
|
|
549
|
-
await import_helper.helper.waitForEvent(progress, this, Frame.Events.AddLifecycle, (e) => e === waitUntil).promise;
|
|
550
|
-
const request = event.newDocument ? event.newDocument.request : void 0;
|
|
551
|
-
const response = request ? progress.race(request._finalRequest().response()) : null;
|
|
552
|
-
return response;
|
|
553
|
-
}
|
|
554
|
-
async _waitForNavigation(progress, requiresNewDocument, options) {
|
|
555
|
-
const waitUntil = verifyLifecycle("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
|
556
|
-
progress.log(`waiting for navigation until "${waitUntil}"`);
|
|
557
|
-
const navigationEvent = await import_helper.helper.waitForEvent(progress, this, Frame.Events.InternalNavigation, (event) => {
|
|
558
|
-
if (event.error)
|
|
559
|
-
return true;
|
|
560
|
-
if (requiresNewDocument && !event.newDocument)
|
|
561
|
-
return false;
|
|
562
|
-
progress.log(` navigated to "${this._url}"`);
|
|
563
|
-
return true;
|
|
564
|
-
}).promise;
|
|
565
|
-
if (navigationEvent.error)
|
|
566
|
-
throw navigationEvent.error;
|
|
567
|
-
if (!this._firedLifecycleEvents.has(waitUntil))
|
|
568
|
-
await import_helper.helper.waitForEvent(progress, this, Frame.Events.AddLifecycle, (e) => e === waitUntil).promise;
|
|
569
|
-
const request = navigationEvent.newDocument ? navigationEvent.newDocument.request : void 0;
|
|
570
|
-
return request ? progress.race(request._finalRequest().response()) : null;
|
|
571
|
-
}
|
|
572
|
-
async _waitForLoadState(progress, state) {
|
|
573
|
-
const waitUntil = verifyLifecycle("state", state);
|
|
574
|
-
if (!this._firedLifecycleEvents.has(waitUntil))
|
|
575
|
-
await import_helper.helper.waitForEvent(progress, this, Frame.Events.AddLifecycle, (e) => e === waitUntil).promise;
|
|
576
|
-
}
|
|
577
|
-
async frameElement() {
|
|
578
|
-
return this._page.delegate.getFrameElement(this);
|
|
579
|
-
}
|
|
580
|
-
_context(world) {
|
|
581
|
-
return this._contextData.get(world).contextPromise.then((contextOrDestroyedReason) => {
|
|
582
|
-
if (contextOrDestroyedReason instanceof js.ExecutionContext)
|
|
583
|
-
return contextOrDestroyedReason;
|
|
584
|
-
throw new Error(contextOrDestroyedReason.destroyedReason);
|
|
585
|
-
});
|
|
586
|
-
}
|
|
587
|
-
_mainContext() {
|
|
588
|
-
return this._context("main");
|
|
589
|
-
}
|
|
590
|
-
_existingMainContext() {
|
|
591
|
-
return this._contextData.get("main")?.context || null;
|
|
592
|
-
}
|
|
593
|
-
_utilityContext() {
|
|
594
|
-
return this._context("utility");
|
|
595
|
-
}
|
|
596
|
-
async evaluateExpression(expression, options = {}, arg) {
|
|
597
|
-
const context = await this._context(options.world ?? "main");
|
|
598
|
-
const value = await context.evaluateExpression(expression, options, arg);
|
|
599
|
-
return value;
|
|
600
|
-
}
|
|
601
|
-
async evaluateExpressionHandle(expression, options = {}, arg) {
|
|
602
|
-
const context = await this._context(options.world ?? "main");
|
|
603
|
-
const value = await context.evaluateExpressionHandle(expression, options, arg);
|
|
604
|
-
return value;
|
|
605
|
-
}
|
|
606
|
-
async querySelector(selector, options) {
|
|
607
|
-
import_debugLogger.debugLogger.log("api", ` finding element using the selector "${selector}"`);
|
|
608
|
-
return this.selectors.query(selector, options);
|
|
609
|
-
}
|
|
610
|
-
async waitForSelector(progress, selector, performActionPreChecksAndLog, options, scope) {
|
|
611
|
-
if (options.visibility)
|
|
612
|
-
throw new Error("options.visibility is not supported, did you mean options.state?");
|
|
613
|
-
if (options.waitFor && options.waitFor !== "visible")
|
|
614
|
-
throw new Error("options.waitFor is not supported, did you mean options.state?");
|
|
615
|
-
const { state = "visible" } = options;
|
|
616
|
-
if (!["attached", "detached", "visible", "hidden"].includes(state))
|
|
617
|
-
throw new Error(`state: expected one of (attached|detached|visible|hidden)`);
|
|
618
|
-
if (performActionPreChecksAndLog)
|
|
619
|
-
progress.log(`waiting for ${this._asLocator(selector)}${state === "attached" ? "" : " to be " + state}`);
|
|
620
|
-
const promise = this.retryWithProgressAndTimeouts(progress, [0, 20, 50, 100, 100, 500], async (continuePolling) => {
|
|
621
|
-
if (performActionPreChecksAndLog)
|
|
622
|
-
await this._page.performActionPreChecks(progress);
|
|
623
|
-
const resolved = await progress.race(this.selectors.resolveInjectedForSelector(selector, options, scope));
|
|
624
|
-
if (!resolved) {
|
|
625
|
-
if (state === "hidden" || state === "detached")
|
|
626
|
-
return null;
|
|
627
|
-
return continuePolling;
|
|
628
|
-
}
|
|
629
|
-
const result = await progress.race(resolved.injected.evaluateHandle((injected, { info, root }) => {
|
|
630
|
-
if (root && !root.isConnected)
|
|
631
|
-
throw injected.createStacklessError("Element is not attached to the DOM");
|
|
632
|
-
const elements = injected.querySelectorAll(info.parsed, root || document);
|
|
633
|
-
const element2 = elements[0];
|
|
634
|
-
const visible2 = element2 ? injected.utils.isElementVisible(element2) : false;
|
|
635
|
-
let log2 = "";
|
|
636
|
-
if (elements.length > 1) {
|
|
637
|
-
if (info.strict)
|
|
638
|
-
throw injected.strictModeViolationError(info.parsed, elements);
|
|
639
|
-
log2 = ` locator resolved to ${elements.length} elements. Proceeding with the first one: ${injected.previewNode(elements[0])}`;
|
|
640
|
-
} else if (element2) {
|
|
641
|
-
log2 = ` locator resolved to ${visible2 ? "visible" : "hidden"} ${injected.previewNode(element2)}`;
|
|
642
|
-
}
|
|
643
|
-
return { log: log2, element: element2, visible: visible2, attached: !!element2 };
|
|
644
|
-
}, { info: resolved.info, root: resolved.frame === this ? scope : void 0 }));
|
|
645
|
-
const { log, visible, attached } = await progress.race(result.evaluate((r) => ({ log: r.log, visible: r.visible, attached: r.attached })));
|
|
646
|
-
if (log)
|
|
647
|
-
progress.log(log);
|
|
648
|
-
const success = { attached, detached: !attached, visible, hidden: !visible }[state];
|
|
649
|
-
if (!success) {
|
|
650
|
-
result.dispose();
|
|
651
|
-
return continuePolling;
|
|
652
|
-
}
|
|
653
|
-
if (options.omitReturnValue) {
|
|
654
|
-
result.dispose();
|
|
655
|
-
return null;
|
|
656
|
-
}
|
|
657
|
-
const element = state === "attached" || state === "visible" ? await progress.race(result.evaluateHandle((r) => r.element)) : null;
|
|
658
|
-
result.dispose();
|
|
659
|
-
if (!element)
|
|
660
|
-
return null;
|
|
661
|
-
if (options.__testHookBeforeAdoptNode)
|
|
662
|
-
await progress.race(options.__testHookBeforeAdoptNode());
|
|
663
|
-
try {
|
|
664
|
-
const mainContext = await progress.race(resolved.frame._mainContext());
|
|
665
|
-
return await progress.race(element._adoptTo(mainContext));
|
|
666
|
-
} catch (e) {
|
|
667
|
-
return continuePolling;
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
return scope ? scope._context._raceAgainstContextDestroyed(promise) : promise;
|
|
671
|
-
}
|
|
672
|
-
async dispatchEvent(progress, selector, type, eventInit = {}, options, scope) {
|
|
673
|
-
await this._callOnElementOnceMatches(progress, selector, (injectedScript, element, data) => {
|
|
674
|
-
injectedScript.dispatchEvent(element, data.type, data.eventInit);
|
|
675
|
-
}, { type, eventInit }, { mainWorld: true, ...options }, scope);
|
|
676
|
-
}
|
|
677
|
-
async evalOnSelector(selector, strict, expression, isFunction, arg, scope) {
|
|
678
|
-
const handle = await this.selectors.query(selector, { strict }, scope);
|
|
679
|
-
if (!handle)
|
|
680
|
-
throw new Error(`Failed to find element matching selector "${selector}"`);
|
|
681
|
-
const result = await handle.evaluateExpression(expression, { isFunction }, arg);
|
|
682
|
-
handle.dispose();
|
|
683
|
-
return result;
|
|
684
|
-
}
|
|
685
|
-
async evalOnSelectorAll(selector, expression, isFunction, arg, scope) {
|
|
686
|
-
const arrayHandle = await this.selectors.queryArrayInMainWorld(selector, scope);
|
|
687
|
-
const result = await arrayHandle.evaluateExpression(expression, { isFunction }, arg);
|
|
688
|
-
arrayHandle.dispose();
|
|
689
|
-
return result;
|
|
690
|
-
}
|
|
691
|
-
async maskSelectors(selectors, color) {
|
|
692
|
-
const context = await this._utilityContext();
|
|
693
|
-
const injectedScript = await context.injectedScript();
|
|
694
|
-
await injectedScript.evaluate((injected, { parsed, color: color2 }) => {
|
|
695
|
-
injected.maskSelectors(parsed, color2);
|
|
696
|
-
}, { parsed: selectors, color });
|
|
697
|
-
}
|
|
698
|
-
async querySelectorAll(selector) {
|
|
699
|
-
return this.selectors.queryAll(selector);
|
|
700
|
-
}
|
|
701
|
-
async queryCount(selector, options) {
|
|
702
|
-
try {
|
|
703
|
-
return await this.selectors.queryCount(selector, options);
|
|
704
|
-
} catch (e) {
|
|
705
|
-
if (this.isNonRetriableError(e))
|
|
706
|
-
throw e;
|
|
707
|
-
return 0;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
async content() {
|
|
711
|
-
try {
|
|
712
|
-
const context = await this._utilityContext();
|
|
713
|
-
return await context.evaluate(() => {
|
|
714
|
-
let retVal = "";
|
|
715
|
-
if (document.doctype)
|
|
716
|
-
retVal = new XMLSerializer().serializeToString(document.doctype);
|
|
717
|
-
if (document.documentElement)
|
|
718
|
-
retVal += document.documentElement.outerHTML;
|
|
719
|
-
return retVal;
|
|
720
|
-
});
|
|
721
|
-
} catch (e) {
|
|
722
|
-
if (this.isNonRetriableError(e))
|
|
723
|
-
throw e;
|
|
724
|
-
throw new Error(`Unable to retrieve content because the page is navigating and changing the content.`);
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
async setContent(progress, html, options) {
|
|
728
|
-
const tag = `--playwright--set--content--${this._id}--${++this._setContentCounter}--`;
|
|
729
|
-
await this.raceNavigationAction(progress, async () => {
|
|
730
|
-
const waitUntil = options.waitUntil === void 0 ? "load" : options.waitUntil;
|
|
731
|
-
progress.log(`setting frame content, waiting until "${waitUntil}"`);
|
|
732
|
-
const context = await progress.race(this._utilityContext());
|
|
733
|
-
const tagPromise = new import_manualPromise.ManualPromise();
|
|
734
|
-
this._page.frameManager._consoleMessageTags.set(tag, () => {
|
|
735
|
-
this._onClearLifecycle();
|
|
736
|
-
tagPromise.resolve();
|
|
737
|
-
});
|
|
738
|
-
const lifecyclePromise = progress.race(tagPromise).then(() => this._waitForLoadState(progress, waitUntil));
|
|
739
|
-
const contentPromise = progress.race(context.evaluate(({ html: html2, tag: tag2 }) => {
|
|
740
|
-
document.open();
|
|
741
|
-
console.debug(tag2);
|
|
742
|
-
document.write(html2);
|
|
743
|
-
document.close();
|
|
744
|
-
}, { html, tag }));
|
|
745
|
-
await Promise.all([contentPromise, lifecyclePromise]);
|
|
746
|
-
return null;
|
|
747
|
-
}).finally(() => {
|
|
748
|
-
this._page.frameManager._consoleMessageTags.delete(tag);
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
name() {
|
|
752
|
-
return this._name || "";
|
|
753
|
-
}
|
|
754
|
-
url() {
|
|
755
|
-
return this._url;
|
|
756
|
-
}
|
|
757
|
-
origin() {
|
|
758
|
-
if (!this._url.startsWith("http"))
|
|
759
|
-
return;
|
|
760
|
-
return network.parseURL(this._url)?.origin;
|
|
761
|
-
}
|
|
762
|
-
parentFrame() {
|
|
763
|
-
return this._parentFrame;
|
|
764
|
-
}
|
|
765
|
-
childFrames() {
|
|
766
|
-
return Array.from(this._childFrames);
|
|
767
|
-
}
|
|
768
|
-
async addScriptTag(params) {
|
|
769
|
-
const {
|
|
770
|
-
url = null,
|
|
771
|
-
content = null,
|
|
772
|
-
type = ""
|
|
773
|
-
} = params;
|
|
774
|
-
if (!url && !content)
|
|
775
|
-
throw new Error("Provide an object with a `url`, `path` or `content` property");
|
|
776
|
-
const context = await this._mainContext();
|
|
777
|
-
return this._raceWithCSPError(async () => {
|
|
778
|
-
if (url !== null)
|
|
779
|
-
return (await context.evaluateHandle(addScriptUrl, { url, type })).asElement();
|
|
780
|
-
const result = (await context.evaluateHandle(addScriptContent, { content, type })).asElement();
|
|
781
|
-
if (this._page.delegate.cspErrorsAsynchronousForInlineScripts)
|
|
782
|
-
await context.evaluate(() => true);
|
|
783
|
-
return result;
|
|
784
|
-
});
|
|
785
|
-
async function addScriptUrl(params2) {
|
|
786
|
-
const script = document.createElement("script");
|
|
787
|
-
script.src = params2.url;
|
|
788
|
-
if (params2.type)
|
|
789
|
-
script.type = params2.type;
|
|
790
|
-
const promise = new Promise((res, rej) => {
|
|
791
|
-
script.onload = res;
|
|
792
|
-
script.onerror = (e) => rej(typeof e === "string" ? new Error(e) : new Error(`Failed to load script at ${script.src}`));
|
|
793
|
-
});
|
|
794
|
-
document.head.appendChild(script);
|
|
795
|
-
await promise;
|
|
796
|
-
return script;
|
|
797
|
-
}
|
|
798
|
-
function addScriptContent(params2) {
|
|
799
|
-
const script = document.createElement("script");
|
|
800
|
-
script.type = params2.type || "text/javascript";
|
|
801
|
-
script.text = params2.content;
|
|
802
|
-
let error = null;
|
|
803
|
-
script.onerror = (e) => error = e;
|
|
804
|
-
document.head.appendChild(script);
|
|
805
|
-
if (error)
|
|
806
|
-
throw error;
|
|
807
|
-
return script;
|
|
808
|
-
}
|
|
809
|
-
}
|
|
810
|
-
async addStyleTag(params) {
|
|
811
|
-
const {
|
|
812
|
-
url = null,
|
|
813
|
-
content = null
|
|
814
|
-
} = params;
|
|
815
|
-
if (!url && !content)
|
|
816
|
-
throw new Error("Provide an object with a `url`, `path` or `content` property");
|
|
817
|
-
const context = await this._mainContext();
|
|
818
|
-
return this._raceWithCSPError(async () => {
|
|
819
|
-
if (url !== null)
|
|
820
|
-
return (await context.evaluateHandle(addStyleUrl, url)).asElement();
|
|
821
|
-
return (await context.evaluateHandle(addStyleContent, content)).asElement();
|
|
822
|
-
});
|
|
823
|
-
async function addStyleUrl(url2) {
|
|
824
|
-
const link = document.createElement("link");
|
|
825
|
-
link.rel = "stylesheet";
|
|
826
|
-
link.href = url2;
|
|
827
|
-
const promise = new Promise((res, rej) => {
|
|
828
|
-
link.onload = res;
|
|
829
|
-
link.onerror = rej;
|
|
830
|
-
});
|
|
831
|
-
document.head.appendChild(link);
|
|
832
|
-
await promise;
|
|
833
|
-
return link;
|
|
834
|
-
}
|
|
835
|
-
async function addStyleContent(content2) {
|
|
836
|
-
const style = document.createElement("style");
|
|
837
|
-
style.type = "text/css";
|
|
838
|
-
style.appendChild(document.createTextNode(content2));
|
|
839
|
-
const promise = new Promise((res, rej) => {
|
|
840
|
-
style.onload = res;
|
|
841
|
-
style.onerror = rej;
|
|
842
|
-
});
|
|
843
|
-
document.head.appendChild(style);
|
|
844
|
-
await promise;
|
|
845
|
-
return style;
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
async _raceWithCSPError(func) {
|
|
849
|
-
const listeners = [];
|
|
850
|
-
let result;
|
|
851
|
-
let error;
|
|
852
|
-
let cspMessage;
|
|
853
|
-
const actionPromise = func().then((r) => result = r).catch((e) => error = e);
|
|
854
|
-
const errorPromise = new Promise((resolve) => {
|
|
855
|
-
listeners.push(import_eventsHelper.eventsHelper.addEventListener(this._page.browserContext, import_browserContext.BrowserContext.Events.Console, (message) => {
|
|
856
|
-
if (message.page() !== this._page || message.type() !== "error")
|
|
857
|
-
return;
|
|
858
|
-
if (message.text().includes("Content-Security-Policy") || message.text().includes("Content Security Policy")) {
|
|
859
|
-
cspMessage = message;
|
|
860
|
-
resolve();
|
|
861
|
-
}
|
|
862
|
-
}));
|
|
863
|
-
});
|
|
864
|
-
await Promise.race([actionPromise, errorPromise]);
|
|
865
|
-
import_eventsHelper.eventsHelper.removeEventListeners(listeners);
|
|
866
|
-
if (cspMessage)
|
|
867
|
-
throw new Error(cspMessage.text());
|
|
868
|
-
if (error)
|
|
869
|
-
throw error;
|
|
870
|
-
return result;
|
|
871
|
-
}
|
|
872
|
-
async retryWithProgressAndTimeouts(progress, timeouts, action) {
|
|
873
|
-
const continuePolling = Symbol("continuePolling");
|
|
874
|
-
timeouts = [0, ...timeouts];
|
|
875
|
-
let timeoutIndex = 0;
|
|
876
|
-
while (true) {
|
|
877
|
-
const timeout = timeouts[Math.min(timeoutIndex++, timeouts.length - 1)];
|
|
878
|
-
if (timeout) {
|
|
879
|
-
const actionPromise = new Promise((f) => setTimeout(f, timeout));
|
|
880
|
-
await progress.race(import_utils.LongStandingScope.raceMultiple([
|
|
881
|
-
this._page.openScope,
|
|
882
|
-
this._detachedScope
|
|
883
|
-
], actionPromise));
|
|
884
|
-
}
|
|
885
|
-
try {
|
|
886
|
-
const result = await action(continuePolling);
|
|
887
|
-
if (result === continuePolling)
|
|
888
|
-
continue;
|
|
889
|
-
return result;
|
|
890
|
-
} catch (e) {
|
|
891
|
-
if (this.isNonRetriableError(e))
|
|
892
|
-
throw e;
|
|
893
|
-
continue;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
isNonRetriableError(e) {
|
|
898
|
-
if ((0, import_progress.isAbortError)(e))
|
|
899
|
-
return true;
|
|
900
|
-
if (js.isJavaScriptErrorInEvaluate(e) || (0, import_protocolError.isSessionClosedError)(e))
|
|
901
|
-
return true;
|
|
902
|
-
if (dom.isNonRecoverableDOMError(e) || (0, import_selectorParser.isInvalidSelectorError)(e))
|
|
903
|
-
return true;
|
|
904
|
-
if (this.isDetached())
|
|
905
|
-
return true;
|
|
906
|
-
return false;
|
|
907
|
-
}
|
|
908
|
-
async _retryWithProgressIfNotConnected(progress, selector, strict, performActionPreChecks, action) {
|
|
909
|
-
progress.log(`waiting for ${this._asLocator(selector)}`);
|
|
910
|
-
return this.retryWithProgressAndTimeouts(progress, [0, 20, 50, 100, 100, 500], async (continuePolling) => {
|
|
911
|
-
if (performActionPreChecks)
|
|
912
|
-
await this._page.performActionPreChecks(progress);
|
|
913
|
-
const resolved = await progress.race(this.selectors.resolveInjectedForSelector(selector, { strict }));
|
|
914
|
-
if (!resolved)
|
|
915
|
-
return continuePolling;
|
|
916
|
-
const result = await progress.race(resolved.injected.evaluateHandle((injected, { info, callId }) => {
|
|
917
|
-
const elements = injected.querySelectorAll(info.parsed, document);
|
|
918
|
-
if (callId)
|
|
919
|
-
injected.markTargetElements(new Set(elements), callId);
|
|
920
|
-
const element2 = elements[0];
|
|
921
|
-
let log2 = "";
|
|
922
|
-
if (elements.length > 1) {
|
|
923
|
-
if (info.strict)
|
|
924
|
-
throw injected.strictModeViolationError(info.parsed, elements);
|
|
925
|
-
log2 = ` locator resolved to ${elements.length} elements. Proceeding with the first one: ${injected.previewNode(elements[0])}`;
|
|
926
|
-
} else if (element2) {
|
|
927
|
-
log2 = ` locator resolved to ${injected.previewNode(element2)}`;
|
|
928
|
-
}
|
|
929
|
-
return { log: log2, success: !!element2, element: element2 };
|
|
930
|
-
}, { info: resolved.info, callId: progress.metadata.id }));
|
|
931
|
-
const { log, success } = await progress.race(result.evaluate((r) => ({ log: r.log, success: r.success })));
|
|
932
|
-
if (log)
|
|
933
|
-
progress.log(log);
|
|
934
|
-
if (!success) {
|
|
935
|
-
result.dispose();
|
|
936
|
-
return continuePolling;
|
|
937
|
-
}
|
|
938
|
-
const element = await progress.race(result.evaluateHandle((r) => r.element));
|
|
939
|
-
result.dispose();
|
|
940
|
-
try {
|
|
941
|
-
const result2 = await action(element);
|
|
942
|
-
if (result2 === "error:notconnected") {
|
|
943
|
-
progress.log("element was detached from the DOM, retrying");
|
|
944
|
-
return continuePolling;
|
|
945
|
-
}
|
|
946
|
-
return result2;
|
|
947
|
-
} finally {
|
|
948
|
-
element?.dispose();
|
|
949
|
-
}
|
|
950
|
-
});
|
|
951
|
-
}
|
|
952
|
-
async rafrafTimeoutScreenshotElementWithProgress(progress, selector, timeout, options) {
|
|
953
|
-
return await this._retryWithProgressIfNotConnected(progress, selector, true, true, async (handle) => {
|
|
954
|
-
await handle._frame.rafrafTimeout(progress, timeout);
|
|
955
|
-
return await this._page.screenshotter.screenshotElement(progress, handle, options);
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
async click(progress, selector, options) {
|
|
959
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._click(progress, { ...options, waitAfter: !options.noWaitAfter })));
|
|
960
|
-
}
|
|
961
|
-
async dblclick(progress, selector, options) {
|
|
962
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._dblclick(progress, options)));
|
|
963
|
-
}
|
|
964
|
-
async dragAndDrop(progress, source, target, options) {
|
|
965
|
-
dom.assertDone(await this._retryWithProgressIfNotConnected(progress, source, options.strict, !options.force, async (handle) => {
|
|
966
|
-
return handle._retryPointerAction(progress, "move and down", false, async (point) => {
|
|
967
|
-
await this._page.mouse.move(progress, point.x, point.y);
|
|
968
|
-
await this._page.mouse.down(progress);
|
|
969
|
-
}, {
|
|
970
|
-
...options,
|
|
971
|
-
waitAfter: "disabled",
|
|
972
|
-
position: options.sourcePosition
|
|
973
|
-
});
|
|
974
|
-
}));
|
|
975
|
-
dom.assertDone(await this._retryWithProgressIfNotConnected(progress, target, options.strict, false, async (handle) => {
|
|
976
|
-
return handle._retryPointerAction(progress, "move and up", false, async (point) => {
|
|
977
|
-
await this._page.mouse.move(progress, point.x, point.y);
|
|
978
|
-
await this._page.mouse.up(progress);
|
|
979
|
-
}, {
|
|
980
|
-
...options,
|
|
981
|
-
waitAfter: "disabled",
|
|
982
|
-
position: options.targetPosition
|
|
983
|
-
});
|
|
984
|
-
}));
|
|
985
|
-
}
|
|
986
|
-
async tap(progress, selector, options) {
|
|
987
|
-
if (!this._page.browserContext._options.hasTouch)
|
|
988
|
-
throw new Error("The page does not support tap. Use hasTouch context option to enable touch support.");
|
|
989
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._tap(progress, options)));
|
|
990
|
-
}
|
|
991
|
-
async fill(progress, selector, value, options) {
|
|
992
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._fill(progress, value, options)));
|
|
993
|
-
}
|
|
994
|
-
async focus(progress, selector, options) {
|
|
995
|
-
dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, true, (handle) => handle._focus(progress)));
|
|
996
|
-
}
|
|
997
|
-
async blur(progress, selector, options) {
|
|
998
|
-
dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, true, (handle) => handle._blur(progress)));
|
|
999
|
-
}
|
|
1000
|
-
async resolveSelector(progress, selector, options = {}) {
|
|
1001
|
-
const element = await progress.race(this.selectors.query(selector, options));
|
|
1002
|
-
if (!element)
|
|
1003
|
-
throw new Error(`No element matching ${selector}`);
|
|
1004
|
-
const generated = await progress.race(element.evaluateInUtility(async ([injected, node]) => {
|
|
1005
|
-
return injected.generateSelectorSimple(node);
|
|
1006
|
-
}, {}));
|
|
1007
|
-
if (!generated)
|
|
1008
|
-
throw new Error(`Unable to generate locator for ${selector}`);
|
|
1009
|
-
let frame = element._frame;
|
|
1010
|
-
const result = [generated];
|
|
1011
|
-
while (frame?.parentFrame()) {
|
|
1012
|
-
const frameElement = await progress.race(frame.frameElement());
|
|
1013
|
-
if (frameElement) {
|
|
1014
|
-
const generated2 = await progress.race(frameElement.evaluateInUtility(async ([injected, node]) => {
|
|
1015
|
-
return injected.generateSelectorSimple(node);
|
|
1016
|
-
}, {}));
|
|
1017
|
-
frameElement.dispose();
|
|
1018
|
-
if (generated2 === "error:notconnected" || !generated2)
|
|
1019
|
-
throw new Error(`Unable to generate locator for ${selector}`);
|
|
1020
|
-
result.push(generated2);
|
|
1021
|
-
}
|
|
1022
|
-
frame = frame.parentFrame();
|
|
1023
|
-
}
|
|
1024
|
-
const resolvedSelector = result.reverse().join(" >> internal:control=enter-frame >> ");
|
|
1025
|
-
return { resolvedSelector };
|
|
1026
|
-
}
|
|
1027
|
-
async textContent(progress, selector, options, scope) {
|
|
1028
|
-
return this._callOnElementOnceMatches(progress, selector, (injected, element) => element.textContent, void 0, options, scope);
|
|
1029
|
-
}
|
|
1030
|
-
async innerText(progress, selector, options, scope) {
|
|
1031
|
-
return this._callOnElementOnceMatches(progress, selector, (injectedScript, element) => {
|
|
1032
|
-
if (element.namespaceURI !== "http://www.w3.org/1999/xhtml")
|
|
1033
|
-
throw injectedScript.createStacklessError("Node is not an HTMLElement");
|
|
1034
|
-
return element.innerText;
|
|
1035
|
-
}, void 0, options, scope);
|
|
1036
|
-
}
|
|
1037
|
-
async innerHTML(progress, selector, options, scope) {
|
|
1038
|
-
return this._callOnElementOnceMatches(progress, selector, (injected, element) => element.innerHTML, void 0, options, scope);
|
|
1039
|
-
}
|
|
1040
|
-
async getAttribute(progress, selector, name, options, scope) {
|
|
1041
|
-
return this._callOnElementOnceMatches(progress, selector, (injected, element, data) => element.getAttribute(data.name), { name }, options, scope);
|
|
1042
|
-
}
|
|
1043
|
-
async inputValue(progress, selector, options, scope) {
|
|
1044
|
-
return this._callOnElementOnceMatches(progress, selector, (injectedScript, node) => {
|
|
1045
|
-
const element = injectedScript.retarget(node, "follow-label");
|
|
1046
|
-
if (!element || element.nodeName !== "INPUT" && element.nodeName !== "TEXTAREA" && element.nodeName !== "SELECT")
|
|
1047
|
-
throw injectedScript.createStacklessError("Node is not an <input>, <textarea> or <select> element");
|
|
1048
|
-
return element.value;
|
|
1049
|
-
}, void 0, options, scope);
|
|
1050
|
-
}
|
|
1051
|
-
async highlight(progress, selector) {
|
|
1052
|
-
const resolved = await progress.race(this.selectors.resolveInjectedForSelector(selector));
|
|
1053
|
-
if (!resolved)
|
|
1054
|
-
return;
|
|
1055
|
-
return await progress.race(resolved.injected.evaluate((injected, { info }) => {
|
|
1056
|
-
return injected.highlight(info.parsed);
|
|
1057
|
-
}, { info: resolved.info }));
|
|
1058
|
-
}
|
|
1059
|
-
async hideHighlight() {
|
|
1060
|
-
return this.raceAgainstEvaluationStallingEvents(async () => {
|
|
1061
|
-
const context = await this._utilityContext();
|
|
1062
|
-
const injectedScript = await context.injectedScript();
|
|
1063
|
-
return await injectedScript.evaluate((injected) => {
|
|
1064
|
-
return injected.hideHighlight();
|
|
1065
|
-
});
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
async _elementState(progress, selector, state, options, scope) {
|
|
1069
|
-
const result = await this._callOnElementOnceMatches(progress, selector, (injected, element, data) => {
|
|
1070
|
-
return injected.elementState(element, data.state);
|
|
1071
|
-
}, { state }, options, scope);
|
|
1072
|
-
if (result.received === "error:notconnected")
|
|
1073
|
-
dom.throwElementIsNotAttached();
|
|
1074
|
-
return result.matches;
|
|
1075
|
-
}
|
|
1076
|
-
async isVisible(progress, selector, options = {}, scope) {
|
|
1077
|
-
progress.log(` checking visibility of ${this._asLocator(selector)}`);
|
|
1078
|
-
return await this.isVisibleInternal(progress, selector, options, scope);
|
|
1079
|
-
}
|
|
1080
|
-
async isVisibleInternal(progress, selector, options = {}, scope) {
|
|
1081
|
-
try {
|
|
1082
|
-
const resolved = await progress.race(this.selectors.resolveInjectedForSelector(selector, options, scope));
|
|
1083
|
-
if (!resolved)
|
|
1084
|
-
return false;
|
|
1085
|
-
return await progress.race(resolved.injected.evaluate((injected, { info, root }) => {
|
|
1086
|
-
const element = injected.querySelector(info.parsed, root || document, info.strict);
|
|
1087
|
-
const state = element ? injected.elementState(element, "visible") : { matches: false, received: "error:notconnected" };
|
|
1088
|
-
return state.matches;
|
|
1089
|
-
}, { info: resolved.info, root: resolved.frame === this ? scope : void 0 }));
|
|
1090
|
-
} catch (e) {
|
|
1091
|
-
if (this.isNonRetriableError(e))
|
|
1092
|
-
throw e;
|
|
1093
|
-
return false;
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
async isHidden(progress, selector, options = {}, scope) {
|
|
1097
|
-
return !await this.isVisible(progress, selector, options, scope);
|
|
1098
|
-
}
|
|
1099
|
-
async isDisabled(progress, selector, options, scope) {
|
|
1100
|
-
return this._elementState(progress, selector, "disabled", options, scope);
|
|
1101
|
-
}
|
|
1102
|
-
async isEnabled(progress, selector, options, scope) {
|
|
1103
|
-
return this._elementState(progress, selector, "enabled", options, scope);
|
|
1104
|
-
}
|
|
1105
|
-
async isEditable(progress, selector, options, scope) {
|
|
1106
|
-
return this._elementState(progress, selector, "editable", options, scope);
|
|
1107
|
-
}
|
|
1108
|
-
async isChecked(progress, selector, options, scope) {
|
|
1109
|
-
return this._elementState(progress, selector, "checked", options, scope);
|
|
1110
|
-
}
|
|
1111
|
-
async hover(progress, selector, options) {
|
|
1112
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._hover(progress, options)));
|
|
1113
|
-
}
|
|
1114
|
-
async selectOption(progress, selector, elements, values, options) {
|
|
1115
|
-
return await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._selectOption(progress, elements, values, options));
|
|
1116
|
-
}
|
|
1117
|
-
async setInputFiles(progress, selector, params) {
|
|
1118
|
-
const inputFileItems = await (0, import_fileUploadUtils.prepareFilesForUpload)(this, params);
|
|
1119
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, params.strict, true, (handle) => handle._setInputFiles(progress, inputFileItems)));
|
|
1120
|
-
}
|
|
1121
|
-
async type(progress, selector, text, options) {
|
|
1122
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, true, (handle) => handle._type(progress, text, options)));
|
|
1123
|
-
}
|
|
1124
|
-
async press(progress, selector, key, options) {
|
|
1125
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, true, (handle) => handle._press(progress, key, options)));
|
|
1126
|
-
}
|
|
1127
|
-
async check(progress, selector, options) {
|
|
1128
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._setChecked(progress, true, options)));
|
|
1129
|
-
}
|
|
1130
|
-
async uncheck(progress, selector, options) {
|
|
1131
|
-
return dom.assertDone(await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force, (handle) => handle._setChecked(progress, false, options)));
|
|
1132
|
-
}
|
|
1133
|
-
async waitForTimeout(progress, timeout) {
|
|
1134
|
-
return progress.wait(timeout);
|
|
1135
|
-
}
|
|
1136
|
-
async ariaSnapshot(progress, selector) {
|
|
1137
|
-
return await this._retryWithProgressIfNotConnected(progress, selector, true, true, (handle) => progress.race(handle.ariaSnapshot()));
|
|
1138
|
-
}
|
|
1139
|
-
async expect(progress, selector, options, timeout) {
|
|
1140
|
-
progress.log(`${(0, import_utils.renderTitleForCall)(progress.metadata)}${timeout ? ` with timeout ${timeout}ms` : ""}`);
|
|
1141
|
-
const lastIntermediateResult = { isSet: false };
|
|
1142
|
-
const fixupMetadataError = (result) => {
|
|
1143
|
-
if (result.matches === options.isNot)
|
|
1144
|
-
progress.metadata.error = { error: { name: "Expect", message: "Expect failed" } };
|
|
1145
|
-
};
|
|
1146
|
-
try {
|
|
1147
|
-
if (selector)
|
|
1148
|
-
progress.log(`waiting for ${this._asLocator(selector)}`);
|
|
1149
|
-
await this._page.performActionPreChecks(progress);
|
|
1150
|
-
try {
|
|
1151
|
-
const resultOneShot = await this._expectInternal(progress, selector, options, lastIntermediateResult, true);
|
|
1152
|
-
if (resultOneShot.matches !== options.isNot)
|
|
1153
|
-
return resultOneShot;
|
|
1154
|
-
} catch (e) {
|
|
1155
|
-
if (this.isNonRetriableError(e))
|
|
1156
|
-
throw e;
|
|
1157
|
-
}
|
|
1158
|
-
const result = await this.retryWithProgressAndTimeouts(progress, [100, 250, 500, 1e3], async (continuePolling) => {
|
|
1159
|
-
await this._page.performActionPreChecks(progress);
|
|
1160
|
-
const { matches, received } = await this._expectInternal(progress, selector, options, lastIntermediateResult, false);
|
|
1161
|
-
if (matches === options.isNot) {
|
|
1162
|
-
return continuePolling;
|
|
1163
|
-
}
|
|
1164
|
-
return { matches, received };
|
|
1165
|
-
});
|
|
1166
|
-
fixupMetadataError(result);
|
|
1167
|
-
return result;
|
|
1168
|
-
} catch (e) {
|
|
1169
|
-
const result = { matches: options.isNot, log: (0, import_callLog.compressCallLog)(progress.metadata.log) };
|
|
1170
|
-
if ((0, import_selectorParser.isInvalidSelectorError)(e)) {
|
|
1171
|
-
result.errorMessage = "Error: " + e.message;
|
|
1172
|
-
} else if (js.isJavaScriptErrorInEvaluate(e)) {
|
|
1173
|
-
result.errorMessage = e.message;
|
|
1174
|
-
} else if (lastIntermediateResult.isSet) {
|
|
1175
|
-
result.received = lastIntermediateResult.received;
|
|
1176
|
-
result.errorMessage = lastIntermediateResult.errorMessage;
|
|
1177
|
-
}
|
|
1178
|
-
if (e instanceof import_errors.TimeoutError)
|
|
1179
|
-
result.timedOut = true;
|
|
1180
|
-
fixupMetadataError(result);
|
|
1181
|
-
return result;
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
async _expectInternal(progress, selector, options, lastIntermediateResult, noAbort) {
|
|
1185
|
-
const race = (p) => noAbort ? p : progress.race(p);
|
|
1186
|
-
const selectorInFrame = selector ? await race(this.selectors.resolveFrameForSelector(selector, { strict: true })) : void 0;
|
|
1187
|
-
const { frame, info } = selectorInFrame || { frame: this, info: void 0 };
|
|
1188
|
-
const world = options.expression === "to.have.property" ? "main" : info?.world ?? "utility";
|
|
1189
|
-
const context = await race(frame._context(world));
|
|
1190
|
-
const injected = await race(context.injectedScript());
|
|
1191
|
-
const { log, matches, received, missingReceived } = await race(injected.evaluate(async (injected2, { info: info2, options: options2, callId }) => {
|
|
1192
|
-
const elements = info2 ? injected2.querySelectorAll(info2.parsed, document) : [];
|
|
1193
|
-
if (callId)
|
|
1194
|
-
injected2.markTargetElements(new Set(elements), callId);
|
|
1195
|
-
const isArray = options2.expression === "to.have.count" || options2.expression.endsWith(".array");
|
|
1196
|
-
let log2 = "";
|
|
1197
|
-
if (isArray)
|
|
1198
|
-
log2 = ` locator resolved to ${elements.length} element${elements.length === 1 ? "" : "s"}`;
|
|
1199
|
-
else if (elements.length > 1)
|
|
1200
|
-
throw injected2.strictModeViolationError(info2.parsed, elements);
|
|
1201
|
-
else if (elements.length)
|
|
1202
|
-
log2 = ` locator resolved to ${injected2.previewNode(elements[0])}`;
|
|
1203
|
-
return { log: log2, ...await injected2.expect(elements[0], options2, elements) };
|
|
1204
|
-
}, { info, options, callId: progress.metadata.id }));
|
|
1205
|
-
if (log)
|
|
1206
|
-
progress.log(log);
|
|
1207
|
-
if (matches === options.isNot) {
|
|
1208
|
-
if (missingReceived) {
|
|
1209
|
-
lastIntermediateResult.errorMessage = "Error: element(s) not found";
|
|
1210
|
-
} else {
|
|
1211
|
-
lastIntermediateResult.errorMessage = void 0;
|
|
1212
|
-
lastIntermediateResult.received = received;
|
|
1213
|
-
}
|
|
1214
|
-
lastIntermediateResult.isSet = true;
|
|
1215
|
-
if (!missingReceived && !Array.isArray(received))
|
|
1216
|
-
progress.log(` unexpected value "${renderUnexpectedValue(options.expression, received)}"`);
|
|
1217
|
-
}
|
|
1218
|
-
return { matches, received };
|
|
1219
|
-
}
|
|
1220
|
-
async waitForFunctionExpression(progress, expression, isFunction, arg, options, world = "main") {
|
|
1221
|
-
if (typeof options.pollingInterval === "number")
|
|
1222
|
-
(0, import_utils.assert)(options.pollingInterval > 0, "Cannot poll with non-positive interval: " + options.pollingInterval);
|
|
1223
|
-
expression = js.normalizeEvaluationExpression(expression, isFunction);
|
|
1224
|
-
return this.retryWithProgressAndTimeouts(progress, [100], async () => {
|
|
1225
|
-
const context = world === "main" ? await progress.race(this._mainContext()) : await progress.race(this._utilityContext());
|
|
1226
|
-
const injectedScript = await progress.race(context.injectedScript());
|
|
1227
|
-
const handle = await progress.race(injectedScript.evaluateHandle((injected, { expression: expression2, isFunction: isFunction2, polling, arg: arg2 }) => {
|
|
1228
|
-
let evaledExpression;
|
|
1229
|
-
const predicate = () => {
|
|
1230
|
-
let result2 = evaledExpression ?? globalThis.eval(expression2);
|
|
1231
|
-
if (isFunction2 === true) {
|
|
1232
|
-
evaledExpression = result2;
|
|
1233
|
-
result2 = result2(arg2);
|
|
1234
|
-
} else if (isFunction2 === false) {
|
|
1235
|
-
result2 = result2;
|
|
1236
|
-
} else {
|
|
1237
|
-
if (typeof result2 === "function") {
|
|
1238
|
-
evaledExpression = result2;
|
|
1239
|
-
result2 = result2(arg2);
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
return result2;
|
|
1243
|
-
};
|
|
1244
|
-
let fulfill;
|
|
1245
|
-
let reject;
|
|
1246
|
-
let aborted = false;
|
|
1247
|
-
const result = new Promise((f, r) => {
|
|
1248
|
-
fulfill = f;
|
|
1249
|
-
reject = r;
|
|
1250
|
-
});
|
|
1251
|
-
const next = () => {
|
|
1252
|
-
if (aborted)
|
|
1253
|
-
return;
|
|
1254
|
-
try {
|
|
1255
|
-
const success = predicate();
|
|
1256
|
-
if (success) {
|
|
1257
|
-
fulfill(success);
|
|
1258
|
-
return;
|
|
1259
|
-
}
|
|
1260
|
-
if (typeof polling !== "number")
|
|
1261
|
-
injected.utils.builtins.requestAnimationFrame(next);
|
|
1262
|
-
else
|
|
1263
|
-
injected.utils.builtins.setTimeout(next, polling);
|
|
1264
|
-
} catch (e) {
|
|
1265
|
-
reject(e);
|
|
1266
|
-
}
|
|
1267
|
-
};
|
|
1268
|
-
next();
|
|
1269
|
-
return { result, abort: () => aborted = true };
|
|
1270
|
-
}, { expression, isFunction, polling: options.pollingInterval, arg }));
|
|
1271
|
-
try {
|
|
1272
|
-
return await progress.race(handle.evaluateHandle((h) => h.result));
|
|
1273
|
-
} catch (error) {
|
|
1274
|
-
await handle.evaluate((h) => h.abort()).catch(() => {
|
|
1275
|
-
});
|
|
1276
|
-
throw error;
|
|
1277
|
-
} finally {
|
|
1278
|
-
handle.dispose();
|
|
1279
|
-
}
|
|
1280
|
-
});
|
|
1281
|
-
}
|
|
1282
|
-
async waitForFunctionValueInUtility(progress, pageFunction) {
|
|
1283
|
-
const expression = `() => {
|
|
1284
|
-
const result = (${pageFunction})();
|
|
1285
|
-
if (!result)
|
|
1286
|
-
return result;
|
|
1287
|
-
return JSON.stringify(result);
|
|
1288
|
-
}`;
|
|
1289
|
-
const handle = await this.waitForFunctionExpression(progress, expression, true, void 0, {}, "utility");
|
|
1290
|
-
return JSON.parse(handle.rawValue());
|
|
1291
|
-
}
|
|
1292
|
-
async title() {
|
|
1293
|
-
const context = await this._utilityContext();
|
|
1294
|
-
return context.evaluate(() => document.title);
|
|
1295
|
-
}
|
|
1296
|
-
async rafrafTimeout(progress, timeout) {
|
|
1297
|
-
if (timeout === 0)
|
|
1298
|
-
return;
|
|
1299
|
-
const context = await progress.race(this._utilityContext());
|
|
1300
|
-
await Promise.all([
|
|
1301
|
-
// wait for double raf
|
|
1302
|
-
progress.race(context.evaluate(() => new Promise((x) => {
|
|
1303
|
-
requestAnimationFrame(() => {
|
|
1304
|
-
requestAnimationFrame(x);
|
|
1305
|
-
});
|
|
1306
|
-
}))),
|
|
1307
|
-
progress.wait(timeout)
|
|
1308
|
-
]);
|
|
1309
|
-
}
|
|
1310
|
-
_onDetached() {
|
|
1311
|
-
this._stopNetworkIdleTimer();
|
|
1312
|
-
this._detachedScope.close(new Error("Frame was detached"));
|
|
1313
|
-
for (const data of this._contextData.values()) {
|
|
1314
|
-
if (data.context)
|
|
1315
|
-
data.context.contextDestroyed("Frame was detached");
|
|
1316
|
-
data.contextPromise.resolve({ destroyedReason: "Frame was detached" });
|
|
1317
|
-
}
|
|
1318
|
-
if (this._parentFrame)
|
|
1319
|
-
this._parentFrame._childFrames.delete(this);
|
|
1320
|
-
this._parentFrame = null;
|
|
1321
|
-
}
|
|
1322
|
-
async _callOnElementOnceMatches(progress, selector, body, taskData, options, scope) {
|
|
1323
|
-
const callbackText = body.toString();
|
|
1324
|
-
progress.log(`waiting for ${this._asLocator(selector)}`);
|
|
1325
|
-
const promise = this.retryWithProgressAndTimeouts(progress, [0, 20, 50, 100, 100, 500], async (continuePolling) => {
|
|
1326
|
-
const resolved = await progress.race(this.selectors.resolveInjectedForSelector(selector, options, scope));
|
|
1327
|
-
if (!resolved)
|
|
1328
|
-
return continuePolling;
|
|
1329
|
-
const { log, success, value } = await progress.race(resolved.injected.evaluate((injected, { info, callbackText: callbackText2, taskData: taskData2, callId, root }) => {
|
|
1330
|
-
const callback = injected.eval(callbackText2);
|
|
1331
|
-
const element = injected.querySelector(info.parsed, root || document, info.strict);
|
|
1332
|
-
if (!element)
|
|
1333
|
-
return { success: false };
|
|
1334
|
-
const log2 = ` locator resolved to ${injected.previewNode(element)}`;
|
|
1335
|
-
if (callId)
|
|
1336
|
-
injected.markTargetElements(/* @__PURE__ */ new Set([element]), callId);
|
|
1337
|
-
return { log: log2, success: true, value: callback(injected, element, taskData2) };
|
|
1338
|
-
}, { info: resolved.info, callbackText, taskData, callId: progress.metadata.id, root: resolved.frame === this ? scope : void 0 }));
|
|
1339
|
-
if (log)
|
|
1340
|
-
progress.log(log);
|
|
1341
|
-
if (!success)
|
|
1342
|
-
return continuePolling;
|
|
1343
|
-
return value;
|
|
1344
|
-
});
|
|
1345
|
-
return scope ? scope._context._raceAgainstContextDestroyed(promise) : promise;
|
|
1346
|
-
}
|
|
1347
|
-
_setContext(world, context) {
|
|
1348
|
-
const data = this._contextData.get(world);
|
|
1349
|
-
data.context = context;
|
|
1350
|
-
if (context)
|
|
1351
|
-
data.contextPromise.resolve(context);
|
|
1352
|
-
else
|
|
1353
|
-
data.contextPromise = new import_manualPromise.ManualPromise();
|
|
1354
|
-
}
|
|
1355
|
-
_contextCreated(world, context) {
|
|
1356
|
-
const data = this._contextData.get(world);
|
|
1357
|
-
if (data.context) {
|
|
1358
|
-
data.context.contextDestroyed("Execution context was destroyed, most likely because of a navigation");
|
|
1359
|
-
this._setContext(world, null);
|
|
1360
|
-
}
|
|
1361
|
-
this._setContext(world, context);
|
|
1362
|
-
}
|
|
1363
|
-
_contextDestroyed(context) {
|
|
1364
|
-
if (this._detachedScope.isClosed())
|
|
1365
|
-
return;
|
|
1366
|
-
context.contextDestroyed("Execution context was destroyed, most likely because of a navigation");
|
|
1367
|
-
for (const [world, data] of this._contextData) {
|
|
1368
|
-
if (data.context === context)
|
|
1369
|
-
this._setContext(world, null);
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
_startNetworkIdleTimer() {
|
|
1373
|
-
(0, import_utils.assert)(!this._networkIdleTimer);
|
|
1374
|
-
if (this._firedLifecycleEvents.has("networkidle") || this._detachedScope.isClosed())
|
|
1375
|
-
return;
|
|
1376
|
-
this._networkIdleTimer = setTimeout(() => {
|
|
1377
|
-
this._firedNetworkIdleSelf = true;
|
|
1378
|
-
this._page.mainFrame()._recalculateNetworkIdle();
|
|
1379
|
-
}, 500);
|
|
1380
|
-
}
|
|
1381
|
-
_stopNetworkIdleTimer() {
|
|
1382
|
-
if (this._networkIdleTimer)
|
|
1383
|
-
clearTimeout(this._networkIdleTimer);
|
|
1384
|
-
this._networkIdleTimer = void 0;
|
|
1385
|
-
this._firedNetworkIdleSelf = false;
|
|
1386
|
-
}
|
|
1387
|
-
async extendInjectedScript(source, arg) {
|
|
1388
|
-
const context = await this._context("main");
|
|
1389
|
-
const injectedScriptHandle = await context.injectedScript();
|
|
1390
|
-
await injectedScriptHandle.evaluate((injectedScript, { source: source2, arg: arg2 }) => {
|
|
1391
|
-
injectedScript.extend(source2, arg2);
|
|
1392
|
-
}, { source, arg });
|
|
1393
|
-
}
|
|
1394
|
-
_asLocator(selector) {
|
|
1395
|
-
return (0, import_utils.asLocator)(this._page.browserContext._browser.sdkLanguage(), selector);
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
class SignalBarrier {
|
|
1399
|
-
constructor(progress) {
|
|
1400
|
-
this._protectCount = 0;
|
|
1401
|
-
this._promise = new import_manualPromise.ManualPromise();
|
|
1402
|
-
this._progress = progress;
|
|
1403
|
-
this.retain();
|
|
1404
|
-
}
|
|
1405
|
-
waitFor() {
|
|
1406
|
-
this.release();
|
|
1407
|
-
return this._progress.race(this._promise);
|
|
1408
|
-
}
|
|
1409
|
-
addFrameNavigation(frame) {
|
|
1410
|
-
if (frame.parentFrame())
|
|
1411
|
-
return;
|
|
1412
|
-
this.retain();
|
|
1413
|
-
const waiter = import_helper.helper.waitForEvent(this._progress, frame, Frame.Events.InternalNavigation, (e) => {
|
|
1414
|
-
if (!e.isPublic)
|
|
1415
|
-
return false;
|
|
1416
|
-
if (!e.error && this._progress)
|
|
1417
|
-
this._progress.log(` navigated to "${frame._url}"`);
|
|
1418
|
-
return true;
|
|
1419
|
-
});
|
|
1420
|
-
import_utils.LongStandingScope.raceMultiple([
|
|
1421
|
-
frame._page.openScope,
|
|
1422
|
-
frame._detachedScope
|
|
1423
|
-
], waiter.promise).catch(() => {
|
|
1424
|
-
}).finally(() => {
|
|
1425
|
-
waiter.dispose();
|
|
1426
|
-
this.release();
|
|
1427
|
-
});
|
|
1428
|
-
}
|
|
1429
|
-
retain() {
|
|
1430
|
-
++this._protectCount;
|
|
1431
|
-
}
|
|
1432
|
-
release() {
|
|
1433
|
-
--this._protectCount;
|
|
1434
|
-
if (!this._protectCount)
|
|
1435
|
-
this._promise.resolve();
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
function verifyLifecycle(name, waitUntil) {
|
|
1439
|
-
if (waitUntil === "networkidle0")
|
|
1440
|
-
waitUntil = "networkidle";
|
|
1441
|
-
if (!types.kLifecycleEvents.has(waitUntil))
|
|
1442
|
-
throw new Error(`${name}: expected one of (load|domcontentloaded|networkidle|commit)`);
|
|
1443
|
-
return waitUntil;
|
|
1444
|
-
}
|
|
1445
|
-
function renderUnexpectedValue(expression, received) {
|
|
1446
|
-
if (expression === "to.match.aria")
|
|
1447
|
-
return received ? received.raw : received;
|
|
1448
|
-
return received;
|
|
1449
|
-
}
|
|
1450
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
1451
|
-
0 && (module.exports = {
|
|
1452
|
-
Frame,
|
|
1453
|
-
FrameManager,
|
|
1454
|
-
NavigationAbortedError
|
|
1455
|
-
});
|