@withbuddi/buddi 0.1.0-pre.51 → 0.1.0-pre.52
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/extension/background.js +1604 -847
- package/extension/manifest.json +3 -3
- package/extension/popup.css +91 -3
- package/extension/popup.html +49 -32
- package/extension/popup.js +215 -123
- package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.d.ts +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/plugin/index.js.map +1 -1
- package/node_modules/@buddi/core/dist/questions/store.d.ts +3 -1
- package/node_modules/@buddi/core/dist/questions/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/questions/store.js +3 -3
- package/node_modules/@buddi/core/dist/questions/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/questions/types.d.ts +46 -1
- package/node_modules/@buddi/core/dist/questions/types.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/questions/types.js +2 -1
- package/node_modules/@buddi/core/dist/questions/types.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/approval.d.ts +54 -0
- package/node_modules/@buddi/core/dist/secrets/approval.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/approval.js +58 -1
- package/node_modules/@buddi/core/dist/secrets/approval.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/settings.d.ts +178 -0
- package/node_modules/@buddi/core/dist/secrets/settings.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/settings.js +63 -6
- package/node_modules/@buddi/core/dist/secrets/settings.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/store.d.ts +31 -0
- package/node_modules/@buddi/core/dist/secrets/store.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/store.js +75 -0
- package/node_modules/@buddi/core/dist/secrets/store.js.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/use.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/secrets/use.js +68 -3
- package/node_modules/@buddi/core/dist/secrets/use.js.map +1 -1
- package/node_modules/@buddi/core/dist/tools.d.ts +22 -0
- package/node_modules/@buddi/core/dist/tools.d.ts.map +1 -1
- package/node_modules/@buddi/core/dist/tools.js.map +1 -1
- package/node_modules/@buddi/core/migrations/080_secret_requests.sql +14 -0
- package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/gateway/dist/chat/session.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/chat/session.js +2 -1
- package/node_modules/@buddi/gateway/dist/chat/session.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js +3 -1
- package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.d.ts +15 -3
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.js +34 -7
- package/node_modules/@buddi/gateway/dist/surfaces/browser-cards.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.js +8 -2
- package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/pending-question.d.ts +3 -1
- package/node_modules/@buddi/gateway/dist/surfaces/pending-question.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/pending-question.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/surfaces/secret-request.d.ts +173 -0
- package/node_modules/@buddi/gateway/dist/surfaces/secret-request.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/surfaces/secret-request.js +332 -0
- package/node_modules/@buddi/gateway/dist/surfaces/secret-request.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/system-context.js +1 -1
- package/node_modules/@buddi/gateway/dist/system-context.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/main.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/main.js +14 -3
- package/node_modules/@buddi/gateway/dist/telegram/main.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.js +4 -1
- package/node_modules/@buddi/gateway/dist/telegram/surface.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.js +9 -1
- package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/approval-ask.js +2 -2
- package/node_modules/@buddi/gateway/dist/web/approval-ask.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/browser-capture.d.ts +13 -0
- package/node_modules/@buddi/gateway/dist/web/browser-capture.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/browser-capture.js +24 -0
- package/node_modules/@buddi/gateway/dist/web/browser-capture.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/chat.d.ts +26 -0
- package/node_modules/@buddi/gateway/dist/web/chat.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/chat.js +87 -2
- package/node_modules/@buddi/gateway/dist/web/chat.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts +30 -0
- package/node_modules/@buddi/gateway/dist/web/extension.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/extension.js +86 -6
- package/node_modules/@buddi/gateway/dist/web/extension.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js +1 -1
- package/node_modules/@buddi/gateway/dist/web/onboarding.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/remote-hand.d.ts +26 -2
- package/node_modules/@buddi/gateway/dist/web/remote-hand.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/remote-hand.js +89 -28
- package/node_modules/@buddi/gateway/dist/web/remote-hand.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/secret-request.d.ts +54 -0
- package/node_modules/@buddi/gateway/dist/web/secret-request.d.ts.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/secret-request.js +264 -0
- package/node_modules/@buddi/gateway/dist/web/secret-request.js.map +1 -0
- package/node_modules/@buddi/gateway/dist/web/secrets.d.ts +1 -0
- package/node_modules/@buddi/gateway/dist/web/secrets.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/secrets.js +1 -1
- package/node_modules/@buddi/gateway/dist/web/secrets.js.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
- package/node_modules/@buddi/gateway/dist/web/server.js +72 -3
- package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
- package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts +7 -0
- package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
- package/node_modules/@buddi/runtime/dist/anthropic.js +19 -1
- package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
- package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts +16 -1
- package/node_modules/@buddi/tool-browser/dist/controller.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/controller.js +59 -5
- package/node_modules/@buddi/tool-browser/dist/controller.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/driver.d.ts +12 -0
- package/node_modules/@buddi/tool-browser/dist/driver.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/driver.js +41 -2
- package/node_modules/@buddi/tool-browser/dist/driver.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts +49 -9
- package/node_modules/@buddi/tool-browser/dist/extension.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/extension.js +145 -21
- package/node_modules/@buddi/tool-browser/dist/extension.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.d.ts +10 -6
- package/node_modules/@buddi/tool-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/index.js +22 -8
- package/node_modules/@buddi/tool-browser/dist/index.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts +10 -1
- package/node_modules/@buddi/tool-browser/dist/routes.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/routes.js +24 -0
- package/node_modules/@buddi/tool-browser/dist/routes.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts +48 -1
- package/node_modules/@buddi/tool-browser/dist/service.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/service.js +114 -11
- package/node_modules/@buddi/tool-browser/dist/service.js.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.d.ts +54 -3
- package/node_modules/@buddi/tool-browser/dist/types.d.ts.map +1 -1
- package/node_modules/@buddi/tool-browser/dist/types.js +17 -1
- package/node_modules/@buddi/tool-browser/dist/types.js.map +1 -1
- package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-mcp/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
- package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
- package/node_modules/imapflow/CHANGELOG.md +15 -0
- package/node_modules/imapflow/dist/cjs/commands/select.d.ts +3 -14
- package/node_modules/imapflow/dist/cjs/commands/select.js +1 -4
- package/node_modules/imapflow/dist/cjs/imap-flow.js +30 -6
- package/node_modules/imapflow/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/cjs/package-info.js +1 -1
- package/node_modules/imapflow/dist/cjs/tools.d.ts +10 -0
- package/node_modules/imapflow/dist/cjs/tools.js +29 -0
- package/node_modules/imapflow/dist/cjs/types.d.ts +9 -1
- package/node_modules/imapflow/dist/esm/commands/select.d.ts +3 -14
- package/node_modules/imapflow/dist/esm/commands/select.js +1 -4
- package/node_modules/imapflow/dist/esm/imap-flow.js +31 -7
- package/node_modules/imapflow/dist/esm/package-info.d.ts +1 -1
- package/node_modules/imapflow/dist/esm/package-info.js +1 -1
- package/node_modules/imapflow/dist/esm/tools.d.ts +10 -0
- package/node_modules/imapflow/dist/esm/tools.js +28 -0
- package/node_modules/imapflow/dist/esm/types.d.ts +9 -1
- package/node_modules/imapflow/package.json +2 -2
- package/node_modules/playwright/README.md +4 -4
- package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +1 -1
- package/node_modules/playwright/lib/cli/testActions.js +8 -5
- package/node_modules/playwright/lib/common/index.js +37 -23
- package/node_modules/playwright/lib/common/index.js.txt +8 -9
- package/node_modules/playwright/lib/index.js +16 -4
- package/node_modules/playwright/lib/matchers/expect.js +13 -7
- package/node_modules/playwright/lib/matchers/expect.js.txt +4 -4
- package/node_modules/playwright/lib/program.js +2 -1
- package/node_modules/playwright/lib/runner/index.js +438 -244
- package/node_modules/playwright/lib/runner/index.js.txt +12 -11
- package/node_modules/playwright/lib/transform/babelBundle.js +2612 -2396
- package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +15 -15
- package/node_modules/playwright/lib/transform/babelBundle.js.txt +14 -11
- package/node_modules/playwright/lib/transform/esmLoader.js +17 -5
- package/node_modules/playwright/lib/transform/esmLoader.js.txt +3 -3
- package/node_modules/playwright/lib/worker/workerProcessEntry.js +17 -18
- package/node_modules/playwright/package.json +2 -7
- package/node_modules/playwright/types/test.d.ts +156 -39
- package/node_modules/playwright-core/browsers.json +9 -9
- package/node_modules/playwright-core/cli.js +1 -0
- package/node_modules/playwright-core/lib/bootstrap.js +61 -0
- package/node_modules/playwright-core/lib/coreBundle.js +6393 -4170
- package/node_modules/playwright-core/lib/server/electron/loader.js +4 -0
- package/node_modules/playwright-core/lib/tools/cli-client/cli.js +2 -1
- package/node_modules/playwright-core/lib/tools/cli-client/help.json +99 -12
- package/node_modules/playwright-core/lib/tools/cli-client/output.js +17 -16
- package/node_modules/playwright-core/lib/tools/cli-client/program.js +8 -4
- package/node_modules/playwright-core/lib/tools/cli-client/session.js +2 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +71 -3
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/pr-attachments.md +60 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +4 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +2 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +1 -1
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +76 -3
- package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +1 -1
- package/node_modules/playwright-core/lib/utilsBundle.js +948 -227
- package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +6 -6
- package/node_modules/playwright-core/lib/vite/htmlReport/report.js +1 -1
- package/node_modules/playwright-core/lib/vite/recorder/assets/{codeMirrorModule-CVQWJZAA.js → codeMirrorModule-DK72OMRi.js} +1 -1
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-Cn0mmDuv.js +129 -0
- package/node_modules/playwright-core/lib/vite/recorder/index.html +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/{codeMirrorModule-BbkfBe3n.js → codeMirrorModule-BEB2e8M3.js} +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-D-g2vrvf.js +184 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/{xtermModule-DywYcAf8.js → xtermModule-B794rD2Z.js} +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/{defaultSettingsView.Bqk9acqE.css → defaultSettingsView.C8BeHuxd.css} +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/{index.B4cLoZK3.js → index.7-c5LSTW.js} +1 -1
- package/node_modules/playwright-core/lib/vite/traceViewer/index.html +3 -3
- package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +3 -3
- package/node_modules/playwright-core/lib/vite/traceViewer/{uiMode.CU5KtEkS.js → uiMode.CYwC_gH1.js} +4 -4
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +3 -3
- package/node_modules/playwright-core/package.json +1 -1
- package/node_modules/playwright-core/types/protocol.d.ts +468 -337
- package/node_modules/playwright-core/types/types.d.ts +572 -37
- package/package.json +2 -2
- package/packages/cli/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/.tsbuildinfo +1 -1
- package/packages/core/dist/plugin/index.d.ts +1 -1
- package/packages/core/dist/plugin/index.d.ts.map +1 -1
- package/packages/core/dist/plugin/index.js.map +1 -1
- package/packages/core/dist/questions/store.d.ts +3 -1
- package/packages/core/dist/questions/store.d.ts.map +1 -1
- package/packages/core/dist/questions/store.js +3 -3
- package/packages/core/dist/questions/store.js.map +1 -1
- package/packages/core/dist/questions/types.d.ts +46 -1
- package/packages/core/dist/questions/types.d.ts.map +1 -1
- package/packages/core/dist/questions/types.js +2 -1
- package/packages/core/dist/questions/types.js.map +1 -1
- package/packages/core/dist/secrets/approval.d.ts +54 -0
- package/packages/core/dist/secrets/approval.d.ts.map +1 -1
- package/packages/core/dist/secrets/approval.js +58 -1
- package/packages/core/dist/secrets/approval.js.map +1 -1
- package/packages/core/dist/secrets/settings.d.ts +178 -0
- package/packages/core/dist/secrets/settings.d.ts.map +1 -1
- package/packages/core/dist/secrets/settings.js +63 -6
- package/packages/core/dist/secrets/settings.js.map +1 -1
- package/packages/core/dist/secrets/store.d.ts +31 -0
- package/packages/core/dist/secrets/store.d.ts.map +1 -1
- package/packages/core/dist/secrets/store.js +75 -0
- package/packages/core/dist/secrets/store.js.map +1 -1
- package/packages/core/dist/secrets/use.d.ts.map +1 -1
- package/packages/core/dist/secrets/use.js +68 -3
- package/packages/core/dist/secrets/use.js.map +1 -1
- package/packages/core/dist/tools.d.ts +22 -0
- package/packages/core/dist/tools.d.ts.map +1 -1
- package/packages/core/dist/tools.js.map +1 -1
- package/packages/core/migrations/080_secret_requests.sql +14 -0
- package/packages/gateway/dist/.tsbuildinfo +1 -1
- package/packages/gateway/dist/chat/session.d.ts.map +1 -1
- package/packages/gateway/dist/chat/session.js +2 -1
- package/packages/gateway/dist/chat/session.js.map +1 -1
- package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
- package/packages/gateway/dist/missions/execute.js +3 -1
- package/packages/gateway/dist/missions/execute.js.map +1 -1
- package/packages/gateway/dist/surfaces/browser-cards.d.ts +15 -3
- package/packages/gateway/dist/surfaces/browser-cards.d.ts.map +1 -1
- package/packages/gateway/dist/surfaces/browser-cards.js +34 -7
- package/packages/gateway/dist/surfaces/browser-cards.js.map +1 -1
- package/packages/gateway/dist/surfaces/offered-actions.d.ts.map +1 -1
- package/packages/gateway/dist/surfaces/offered-actions.js +8 -2
- package/packages/gateway/dist/surfaces/offered-actions.js.map +1 -1
- package/packages/gateway/dist/surfaces/pending-question.d.ts +3 -1
- package/packages/gateway/dist/surfaces/pending-question.d.ts.map +1 -1
- package/packages/gateway/dist/surfaces/pending-question.js.map +1 -1
- package/packages/gateway/dist/surfaces/secret-request.d.ts +173 -0
- package/packages/gateway/dist/surfaces/secret-request.d.ts.map +1 -0
- package/packages/gateway/dist/surfaces/secret-request.js +332 -0
- package/packages/gateway/dist/surfaces/secret-request.js.map +1 -0
- package/packages/gateway/dist/system-context.js +1 -1
- package/packages/gateway/dist/system-context.js.map +1 -1
- package/packages/gateway/dist/telegram/main.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/main.js +14 -3
- package/packages/gateway/dist/telegram/main.js.map +1 -1
- package/packages/gateway/dist/telegram/surface.d.ts.map +1 -1
- package/packages/gateway/dist/telegram/surface.js +4 -1
- package/packages/gateway/dist/telegram/surface.js.map +1 -1
- package/packages/gateway/dist/web/api-routes.d.ts.map +1 -1
- package/packages/gateway/dist/web/api-routes.js +9 -1
- package/packages/gateway/dist/web/api-routes.js.map +1 -1
- package/packages/gateway/dist/web/approval-ask.js +2 -2
- package/packages/gateway/dist/web/approval-ask.js.map +1 -1
- package/packages/gateway/dist/web/browser-capture.d.ts +13 -0
- package/packages/gateway/dist/web/browser-capture.d.ts.map +1 -0
- package/packages/gateway/dist/web/browser-capture.js +24 -0
- package/packages/gateway/dist/web/browser-capture.js.map +1 -0
- package/packages/gateway/dist/web/chat.d.ts +26 -0
- package/packages/gateway/dist/web/chat.d.ts.map +1 -1
- package/packages/gateway/dist/web/chat.js +87 -2
- package/packages/gateway/dist/web/chat.js.map +1 -1
- package/packages/gateway/dist/web/extension.d.ts +30 -0
- package/packages/gateway/dist/web/extension.d.ts.map +1 -1
- package/packages/gateway/dist/web/extension.js +86 -6
- package/packages/gateway/dist/web/extension.js.map +1 -1
- package/packages/gateway/dist/web/onboarding.js +1 -1
- package/packages/gateway/dist/web/onboarding.js.map +1 -1
- package/packages/gateway/dist/web/remote-hand.d.ts +26 -2
- package/packages/gateway/dist/web/remote-hand.d.ts.map +1 -1
- package/packages/gateway/dist/web/remote-hand.js +89 -28
- package/packages/gateway/dist/web/remote-hand.js.map +1 -1
- package/packages/gateway/dist/web/secret-request.d.ts +54 -0
- package/packages/gateway/dist/web/secret-request.d.ts.map +1 -0
- package/packages/gateway/dist/web/secret-request.js +264 -0
- package/packages/gateway/dist/web/secret-request.js.map +1 -0
- package/packages/gateway/dist/web/secrets.d.ts +1 -0
- package/packages/gateway/dist/web/secrets.d.ts.map +1 -1
- package/packages/gateway/dist/web/secrets.js +1 -1
- package/packages/gateway/dist/web/secrets.js.map +1 -1
- package/packages/gateway/dist/web/server.d.ts.map +1 -1
- package/packages/gateway/dist/web/server.js +72 -3
- package/packages/gateway/dist/web/server.js.map +1 -1
- package/packages/install/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/.tsbuildinfo +1 -1
- package/packages/runtime/dist/anthropic.d.ts +7 -0
- package/packages/runtime/dist/anthropic.d.ts.map +1 -1
- package/packages/runtime/dist/anthropic.js +19 -1
- package/packages/runtime/dist/anthropic.js.map +1 -1
- package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/.tsbuildinfo +1 -1
- package/packages/tools/browser/dist/controller.d.ts +16 -1
- package/packages/tools/browser/dist/controller.d.ts.map +1 -1
- package/packages/tools/browser/dist/controller.js +59 -5
- package/packages/tools/browser/dist/controller.js.map +1 -1
- package/packages/tools/browser/dist/driver.d.ts +12 -0
- package/packages/tools/browser/dist/driver.d.ts.map +1 -1
- package/packages/tools/browser/dist/driver.js +41 -2
- package/packages/tools/browser/dist/driver.js.map +1 -1
- package/packages/tools/browser/dist/extension.d.ts +49 -9
- package/packages/tools/browser/dist/extension.d.ts.map +1 -1
- package/packages/tools/browser/dist/extension.js +145 -21
- package/packages/tools/browser/dist/extension.js.map +1 -1
- package/packages/tools/browser/dist/index.d.ts +10 -6
- package/packages/tools/browser/dist/index.d.ts.map +1 -1
- package/packages/tools/browser/dist/index.js +22 -8
- package/packages/tools/browser/dist/index.js.map +1 -1
- package/packages/tools/browser/dist/routes.d.ts +10 -1
- package/packages/tools/browser/dist/routes.d.ts.map +1 -1
- package/packages/tools/browser/dist/routes.js +24 -0
- package/packages/tools/browser/dist/routes.js.map +1 -1
- package/packages/tools/browser/dist/service.d.ts +48 -1
- package/packages/tools/browser/dist/service.d.ts.map +1 -1
- package/packages/tools/browser/dist/service.js +114 -11
- package/packages/tools/browser/dist/service.js.map +1 -1
- package/packages/tools/browser/dist/types.d.ts +54 -3
- package/packages/tools/browser/dist/types.d.ts.map +1 -1
- package/packages/tools/browser/dist/types.js +17 -1
- package/packages/tools/browser/dist/types.js.map +1 -1
- package/packages/tools/email/dist/.tsbuildinfo +1 -1
- package/packages/tools/host/dist/.tsbuildinfo +1 -1
- package/packages/tools/mcp/dist/.tsbuildinfo +1 -1
- package/packages/tools/memory/dist/.tsbuildinfo +1 -1
- package/packages/tools/web/dist/.tsbuildinfo +1 -1
- package/packages/web/dist/assets/index-oxmxR39o.js +155 -0
- package/packages/web/dist/assets/index-rMRjibNI.css +1 -0
- package/packages/web/dist/assets/{lottie_light-D7CS-IeP.js → lottie_light-DROBTM6Y.js} +1 -1
- package/packages/web/dist/build.json +1 -1
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/precache.json +4 -4
- package/node_modules/playwright/jsx-runtime.js +0 -42
- package/node_modules/playwright/jsx-runtime.mjs +0 -21
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-hrlLqLtq.js +0 -129
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-Ds6CBOo0.js +0 -182
- package/packages/web/dist/assets/index-BibqUZwt.js +0 -155
- package/packages/web/dist/assets/index-DBVZzTau.css +0 -1
|
@@ -52,7 +52,7 @@ __export(testRunner_exports, {
|
|
|
52
52
|
TestRunnerEvent: () => TestRunnerEvent,
|
|
53
53
|
runAllTestsWithConfig: () => runAllTestsWithConfig
|
|
54
54
|
});
|
|
55
|
-
var
|
|
55
|
+
var import_events3 = __toESM(require("events"));
|
|
56
56
|
var import_coreBundle3 = require("playwright-core/lib/coreBundle");
|
|
57
57
|
var import_common10 = require("../common");
|
|
58
58
|
|
|
@@ -569,6 +569,7 @@ var baseFullConfig = {
|
|
|
569
569
|
metadata: {},
|
|
570
570
|
preserveOutput: "always",
|
|
571
571
|
projects: [],
|
|
572
|
+
filteredProjects: [],
|
|
572
573
|
reporter: [[process.env.CI ? "dot" : "list"]],
|
|
573
574
|
reportSlowTests: {
|
|
574
575
|
max: 5,
|
|
@@ -580,7 +581,7 @@ var baseFullConfig = {
|
|
|
580
581
|
quiet: false,
|
|
581
582
|
shard: null,
|
|
582
583
|
tags: [],
|
|
583
|
-
updateSnapshots: "
|
|
584
|
+
updateSnapshots: "default",
|
|
584
585
|
updateSourceMethod: "patch",
|
|
585
586
|
version: "",
|
|
586
587
|
workers: 0,
|
|
@@ -642,7 +643,6 @@ function asFullConfig(config2) {
|
|
|
642
643
|
|
|
643
644
|
// packages/playwright/src/plugins/gitCommitInfoPlugin.ts
|
|
644
645
|
var fs = __toESM(require("fs"));
|
|
645
|
-
var { monotonicTime } = require("playwright-core/lib/coreBundle").iso;
|
|
646
646
|
var { spawnAsync } = require("playwright-core/lib/coreBundle").utils;
|
|
647
647
|
var GIT_OPERATIONS_TIMEOUT_MS = 3e3;
|
|
648
648
|
var addGitCommitInfoPlugin = (fullConfig) => {
|
|
@@ -791,13 +791,13 @@ async function gitDiff(gitDir, ci) {
|
|
|
791
791
|
}
|
|
792
792
|
async function runGit(args, cwd) {
|
|
793
793
|
debug(`running "git ${args.join(" ")}"`);
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
);
|
|
800
|
-
if (
|
|
794
|
+
const result = await spawnAsync("git", ["-c", "credential.interactive=false", ...args], {
|
|
795
|
+
stdio: "pipe",
|
|
796
|
+
cwd,
|
|
797
|
+
timeout: GIT_OPERATIONS_TIMEOUT_MS,
|
|
798
|
+
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" }
|
|
799
|
+
});
|
|
800
|
+
if (result.timedOut) {
|
|
801
801
|
print(`timeout of ${GIT_OPERATIONS_TIMEOUT_MS}ms exceeded while running "git ${args.join(" ")}"`);
|
|
802
802
|
return;
|
|
803
803
|
}
|
|
@@ -817,7 +817,7 @@ var import_util = require("util");
|
|
|
817
817
|
var colors = require("playwright-core/lib/utilsBundle").colors;
|
|
818
818
|
var debug2 = require("playwright-core/lib/utilsBundle").debug;
|
|
819
819
|
var { ManualPromise } = require("playwright-core/lib/coreBundle").iso;
|
|
820
|
-
var { monotonicTime
|
|
820
|
+
var { monotonicTime } = require("playwright-core/lib/coreBundle").iso;
|
|
821
821
|
var { raceAgainstDeadline } = require("playwright-core/lib/coreBundle").iso;
|
|
822
822
|
var { isURLAvailable } = require("playwright-core/lib/coreBundle").utils;
|
|
823
823
|
var { launchProcess } = require("playwright-core/lib/coreBundle").utils;
|
|
@@ -942,7 +942,7 @@ var WebServerPlugin = class {
|
|
|
942
942
|
debugWebServer(`Waiting for availability...`);
|
|
943
943
|
const launchTimeout = this._options.timeout || 60 * 1e3;
|
|
944
944
|
const cancellationToken = { canceled: false };
|
|
945
|
-
const deadline =
|
|
945
|
+
const deadline = monotonicTime() + launchTimeout;
|
|
946
946
|
const racingPromises = [this._processExitedPromise];
|
|
947
947
|
if (this._isAvailableCallback)
|
|
948
948
|
racingPromises.push(raceAgainstDeadline(() => waitFor(this._isAvailableCallback, cancellationToken), deadline));
|
|
@@ -1181,9 +1181,10 @@ var TerminalReporter = class {
|
|
|
1181
1181
|
generateStartingMessage() {
|
|
1182
1182
|
const jobs = this.config.metadata.actualWorkers ?? this.config.workers;
|
|
1183
1183
|
const shardDetails = this.config.shard ? `, shard ${this.config.shard.current} of ${this.config.shard.total}` : "";
|
|
1184
|
+
const shuffleDetails = this.config.metadata.shuffleSeed ? `, shuffle seed ${this.config.metadata.shuffleSeed}` : "";
|
|
1184
1185
|
if (!this.totalTestCount)
|
|
1185
1186
|
return "";
|
|
1186
|
-
return "\n" + this.screen.colors.dim("Running ") + this.totalTestCount + this.screen.colors.dim(` test${this.totalTestCount !== 1 ? "s" : ""} using `) + jobs + this.screen.colors.dim(` worker${jobs !== 1 ? "s" : ""}${shardDetails}`);
|
|
1187
|
+
return "\n" + this.screen.colors.dim("Running ") + this.totalTestCount + this.screen.colors.dim(` test${this.totalTestCount !== 1 ? "s" : ""} using `) + jobs + this.screen.colors.dim(` worker${jobs !== 1 ? "s" : ""}${shardDetails}${shuffleDetails}`);
|
|
1187
1188
|
}
|
|
1188
1189
|
getSlowTests() {
|
|
1189
1190
|
if (!this.config.reportSlowTests)
|
|
@@ -1328,7 +1329,8 @@ function formatResultErrors(screen, test, result) {
|
|
|
1328
1329
|
function formatFailure(screen, config2, test, index, options) {
|
|
1329
1330
|
const lines = [];
|
|
1330
1331
|
let printedHeader = false;
|
|
1331
|
-
|
|
1332
|
+
const results = options?.lastResult ? test.results.slice(-1) : test.results;
|
|
1333
|
+
for (const result of results) {
|
|
1332
1334
|
const resultLines = [];
|
|
1333
1335
|
const errors = formatResultFailure(screen, test, result, " ");
|
|
1334
1336
|
if (!errors.length)
|
|
@@ -1407,10 +1409,10 @@ function formatRetry(screen, result) {
|
|
|
1407
1409
|
}
|
|
1408
1410
|
return retryLines;
|
|
1409
1411
|
}
|
|
1410
|
-
function quotePathIfNeeded(
|
|
1411
|
-
if (/\s/.test(
|
|
1412
|
-
return `"${
|
|
1413
|
-
return
|
|
1412
|
+
function quotePathIfNeeded(path21) {
|
|
1413
|
+
if (/\s/.test(path21))
|
|
1414
|
+
return `"${path21}"`;
|
|
1415
|
+
return path21;
|
|
1414
1416
|
}
|
|
1415
1417
|
var kReportedSymbol = /* @__PURE__ */ Symbol("reported");
|
|
1416
1418
|
function markErrorsAsReported(result) {
|
|
@@ -1774,7 +1776,7 @@ var ReporterV2Wrapper = class {
|
|
|
1774
1776
|
};
|
|
1775
1777
|
|
|
1776
1778
|
// packages/playwright/src/reporters/internalReporter.ts
|
|
1777
|
-
var { monotonicTime:
|
|
1779
|
+
var { monotonicTime: monotonicTime2 } = require("playwright-core/lib/coreBundle").iso;
|
|
1778
1780
|
var InternalReporter = class {
|
|
1779
1781
|
constructor(reporters) {
|
|
1780
1782
|
this._didBegin = false;
|
|
@@ -1789,7 +1791,7 @@ var InternalReporter = class {
|
|
|
1789
1791
|
onConfigure(config2) {
|
|
1790
1792
|
this._config = config2;
|
|
1791
1793
|
this._startTime = /* @__PURE__ */ new Date();
|
|
1792
|
-
this._monotonicStartTime =
|
|
1794
|
+
this._monotonicStartTime = monotonicTime2();
|
|
1793
1795
|
this._reporter.onConfigure?.(config2);
|
|
1794
1796
|
}
|
|
1795
1797
|
async preprocess(params) {
|
|
@@ -1823,7 +1825,7 @@ var InternalReporter = class {
|
|
|
1823
1825
|
return await this._reporter.onEnd?.({
|
|
1824
1826
|
...result,
|
|
1825
1827
|
startTime: this._startTime,
|
|
1826
|
-
duration:
|
|
1828
|
+
duration: monotonicTime2() - this._monotonicStartTime
|
|
1827
1829
|
});
|
|
1828
1830
|
}
|
|
1829
1831
|
async onExit() {
|
|
@@ -1875,7 +1877,7 @@ function addLocationAndSnippetToError(config2, error, file) {
|
|
|
1875
1877
|
}
|
|
1876
1878
|
|
|
1877
1879
|
// packages/playwright/src/runner/testRunner.ts
|
|
1878
|
-
var
|
|
1880
|
+
var import_util17 = require("../util");
|
|
1879
1881
|
|
|
1880
1882
|
// packages/playwright/src/runner/reporters.ts
|
|
1881
1883
|
var reporters_exports = {};
|
|
@@ -1883,7 +1885,7 @@ __export(reporters_exports, {
|
|
|
1883
1885
|
createErrorCollectingReporter: () => createErrorCollectingReporter,
|
|
1884
1886
|
createReporters: () => createReporters
|
|
1885
1887
|
});
|
|
1886
|
-
var
|
|
1888
|
+
var import_fs10 = __toESM(require("fs"));
|
|
1887
1889
|
|
|
1888
1890
|
// packages/playwright/src/runner/loadUtils.ts
|
|
1889
1891
|
var import_path4 = __toESM(require("path"));
|
|
@@ -1894,8 +1896,9 @@ var import_child_process = __toESM(require("child_process"));
|
|
|
1894
1896
|
var import_events = require("events");
|
|
1895
1897
|
var debug3 = require("playwright-core/lib/utilsBundle").debug;
|
|
1896
1898
|
var { assert } = require("playwright-core/lib/coreBundle").iso;
|
|
1897
|
-
var { monotonicTime:
|
|
1899
|
+
var { monotonicTime: monotonicTime3, timeOrigin } = require("playwright-core/lib/coreBundle").iso;
|
|
1898
1900
|
var { raceAgainstDeadline: raceAgainstDeadline2 } = require("playwright-core/lib/coreBundle").iso;
|
|
1901
|
+
var { killProcessTree } = require("playwright-core/lib/coreBundle").utils;
|
|
1899
1902
|
var ProcessHost = class extends import_events.EventEmitter {
|
|
1900
1903
|
constructor(entryScript, processName, env) {
|
|
1901
1904
|
super();
|
|
@@ -1984,7 +1987,6 @@ var ProcessHost = class extends import_events.EventEmitter {
|
|
|
1984
1987
|
if (error)
|
|
1985
1988
|
return error;
|
|
1986
1989
|
const processParams = {
|
|
1987
|
-
processName: this._processName,
|
|
1988
1990
|
timeOrigin: timeOrigin()
|
|
1989
1991
|
};
|
|
1990
1992
|
this.send({
|
|
@@ -2023,15 +2025,15 @@ var ProcessHost = class extends import_events.EventEmitter {
|
|
|
2023
2025
|
return;
|
|
2024
2026
|
const exitPromise = new Promise((f) => this.once("exit", () => f()));
|
|
2025
2027
|
const timeout = +(process.env.PWTEST_CHILD_PROCESS_TIMEOUT || 5 * 60 * 1e3);
|
|
2026
|
-
let lastHeartbeat =
|
|
2027
|
-
const onHeartbeat = () => lastHeartbeat =
|
|
2028
|
+
let lastHeartbeat = monotonicTime3();
|
|
2029
|
+
const onHeartbeat = () => lastHeartbeat = monotonicTime3();
|
|
2028
2030
|
this.on("__heartbeat__", onHeartbeat);
|
|
2029
2031
|
try {
|
|
2030
2032
|
while (true) {
|
|
2031
2033
|
const result = await raceAgainstDeadline2(() => exitPromise, lastHeartbeat + timeout);
|
|
2032
2034
|
if (!result.timedOut)
|
|
2033
2035
|
return;
|
|
2034
|
-
if (
|
|
2036
|
+
if (monotonicTime3() < lastHeartbeat + timeout)
|
|
2035
2037
|
continue;
|
|
2036
2038
|
this.emit("processError", { message: `Error: ${this._processName} process did not exit within ${timeout}ms after stop, force-killed it` });
|
|
2037
2039
|
this._forceKill();
|
|
@@ -2043,16 +2045,8 @@ var ProcessHost = class extends import_events.EventEmitter {
|
|
|
2043
2045
|
}
|
|
2044
2046
|
}
|
|
2045
2047
|
_forceKill() {
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
return;
|
|
2049
|
-
try {
|
|
2050
|
-
if (process.platform === "win32")
|
|
2051
|
-
import_child_process.default.spawnSync(`taskkill /pid ${pid} /T /F`, { shell: true });
|
|
2052
|
-
else
|
|
2053
|
-
process.kill(pid, "SIGKILL");
|
|
2054
|
-
} catch {
|
|
2055
|
-
}
|
|
2048
|
+
if (this.process?.pid)
|
|
2049
|
+
killProcessTree(this.process.pid);
|
|
2056
2050
|
}
|
|
2057
2051
|
didSendStop() {
|
|
2058
2052
|
return this._didSendStop;
|
|
@@ -2137,9 +2131,9 @@ var readDirAsync = (0, import_util4.promisify)(import_fs2.default.readdir);
|
|
|
2137
2131
|
function wildcardPatternToRegExp(pattern) {
|
|
2138
2132
|
return new RegExp("^" + pattern.split("*").map(escapeRegExp).join(".*") + "$", "ig");
|
|
2139
2133
|
}
|
|
2140
|
-
function filterProjects(projects, projectNames) {
|
|
2134
|
+
function filterProjects(projects, projectNames, includeNonDefault) {
|
|
2141
2135
|
if (!projectNames)
|
|
2142
|
-
return
|
|
2136
|
+
return projects.filter((project) => includeNonDefault || project.default);
|
|
2143
2137
|
const projectNamesToFind = /* @__PURE__ */ new Set();
|
|
2144
2138
|
const unmatchedProjectNames = /* @__PURE__ */ new Map();
|
|
2145
2139
|
const patterns = /* @__PURE__ */ new Set();
|
|
@@ -2381,6 +2375,7 @@ var ReporterTestRunImpl = class {
|
|
|
2381
2375
|
};
|
|
2382
2376
|
|
|
2383
2377
|
// packages/playwright/src/runner/testGroups.ts
|
|
2378
|
+
var { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
|
|
2384
2379
|
function createTestGroups(projectSuite, expectedParallelism) {
|
|
2385
2380
|
const groups = /* @__PURE__ */ new Map();
|
|
2386
2381
|
const createGroup = (test) => {
|
|
@@ -2460,14 +2455,18 @@ function createTestGroups(projectSuite, expectedParallelism) {
|
|
|
2460
2455
|
}
|
|
2461
2456
|
return result;
|
|
2462
2457
|
}
|
|
2458
|
+
function shuffleTestGroups(testGroups, seed) {
|
|
2459
|
+
const keys = new Map(testGroups.map((group) => [group, calculateSha1(seed + "" + group.tests[0].id)]));
|
|
2460
|
+
testGroups.sort((a, b) => keys.get(a).localeCompare(keys.get(b)));
|
|
2461
|
+
}
|
|
2463
2462
|
function filterForShard(shard, weights, testGroups) {
|
|
2464
2463
|
weights ??= Array.from({ length: shard.total }, () => 1);
|
|
2465
2464
|
if (weights.length !== shard.total)
|
|
2466
2465
|
throw new Error(`PWTEST_SHARD_WEIGHTS number of weights must match the shard total of ${shard.total}`);
|
|
2467
2466
|
const totalWeight = weights.reduce((a, b) => a + b, 0);
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2467
|
+
const activeSizes = testGroups.map((group) => group.tests.filter((test) => test.expectedStatus !== "skipped").length);
|
|
2468
|
+
const groupSizes = activeSizes.some(Boolean) ? activeSizes : testGroups.map((group) => group.tests.length);
|
|
2469
|
+
const shardableTotal = groupSizes.reduce((a, b) => a + b, 0);
|
|
2471
2470
|
const shardSizes = weights.map((w) => Math.floor(w * shardableTotal / totalWeight));
|
|
2472
2471
|
const remainder = shardableTotal - shardSizes.reduce((a, b) => a + b, 0);
|
|
2473
2472
|
for (let i = 0; i < remainder; i++) {
|
|
@@ -2479,11 +2478,12 @@ function filterForShard(shard, weights, testGroups) {
|
|
|
2479
2478
|
const to = from + shardSizes[shard.current - 1];
|
|
2480
2479
|
let current = 0;
|
|
2481
2480
|
const result = /* @__PURE__ */ new Set();
|
|
2482
|
-
|
|
2483
|
-
|
|
2481
|
+
testGroups.forEach((group, index) => {
|
|
2482
|
+
const position = groupSizes[index] ? current : Math.max(current - 1, 0);
|
|
2483
|
+
if (position >= from && position < to)
|
|
2484
2484
|
result.add(group);
|
|
2485
|
-
current +=
|
|
2486
|
-
}
|
|
2485
|
+
current += groupSizes[index];
|
|
2486
|
+
});
|
|
2487
2487
|
return result;
|
|
2488
2488
|
}
|
|
2489
2489
|
|
|
@@ -3081,7 +3081,7 @@ var TeleReporterEmitter = class {
|
|
|
3081
3081
|
var mime = require("playwright-core/lib/utilsBundle").mime;
|
|
3082
3082
|
var yazl = require("playwright-core/lib/utilsBundle").yazl;
|
|
3083
3083
|
var { ManualPromise: ManualPromise2 } = require("playwright-core/lib/coreBundle").iso;
|
|
3084
|
-
var { calculateSha1, createGuid: createGuid2 } = require("playwright-core/lib/coreBundle").utils;
|
|
3084
|
+
var { calculateSha1: calculateSha12, createGuid: createGuid2 } = require("playwright-core/lib/coreBundle").utils;
|
|
3085
3085
|
var { removeFolders, sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
|
|
3086
3086
|
var currentBlobReportVersion = 2;
|
|
3087
3087
|
var BlobReporter = class extends TeleReporterEmitter {
|
|
@@ -3162,7 +3162,7 @@ var BlobReporter = class extends TeleReporterEmitter {
|
|
|
3162
3162
|
return super._serializeAttachments(attachments).map((attachment) => {
|
|
3163
3163
|
if (!attachment.path)
|
|
3164
3164
|
return attachment;
|
|
3165
|
-
const sha1 =
|
|
3165
|
+
const sha1 = calculateSha12(attachment.path + this._salt);
|
|
3166
3166
|
const extension = mime.getExtension(attachment.contentType) || "dat";
|
|
3167
3167
|
const newPath = `resources/${sha1}.${extension}`;
|
|
3168
3168
|
this._attachments.push({ originalPath: attachment.path, zipEntryPath: newPath });
|
|
@@ -3174,6 +3174,181 @@ var BlobReporter = class extends TeleReporterEmitter {
|
|
|
3174
3174
|
}
|
|
3175
3175
|
};
|
|
3176
3176
|
|
|
3177
|
+
// packages/playwright/src/reporters/coverage.ts
|
|
3178
|
+
var import_fs5 = __toESM(require("fs"));
|
|
3179
|
+
var import_path7 = __toESM(require("path"));
|
|
3180
|
+
var import_util7 = require("../util");
|
|
3181
|
+
var { mergeIstanbulCoverage, sortedIstanbulCoverage } = require("playwright-core/lib/coreBundle").iso;
|
|
3182
|
+
var { ZipFile } = require("playwright-core/lib/coreBundle").utils;
|
|
3183
|
+
var CoverageReporter = class {
|
|
3184
|
+
constructor(options) {
|
|
3185
|
+
this._traceFiles = /* @__PURE__ */ new Set();
|
|
3186
|
+
this._options = options;
|
|
3187
|
+
}
|
|
3188
|
+
version() {
|
|
3189
|
+
return "v2";
|
|
3190
|
+
}
|
|
3191
|
+
printsToStdio() {
|
|
3192
|
+
return false;
|
|
3193
|
+
}
|
|
3194
|
+
onTestEnd(test, result) {
|
|
3195
|
+
for (const attachment of result.attachments) {
|
|
3196
|
+
if (attachment.name === "trace" && attachment.path)
|
|
3197
|
+
this._traceFiles.add(attachment.path);
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
async onEnd() {
|
|
3201
|
+
const coverage = /* @__PURE__ */ new Map();
|
|
3202
|
+
const traceFiles = [...this._traceFiles];
|
|
3203
|
+
while (traceFiles.length) {
|
|
3204
|
+
const batch = traceFiles.splice(0, 16).map(async (traceFile) => {
|
|
3205
|
+
const zipFile = new ZipFile(traceFile);
|
|
3206
|
+
try {
|
|
3207
|
+
const entries = (await zipFile.entries()).filter((entry) => entry.match(/(^|-)trace\.coverage$/));
|
|
3208
|
+
return await Promise.all(entries.map((entry) => zipFile.read(entry)));
|
|
3209
|
+
} catch {
|
|
3210
|
+
return [];
|
|
3211
|
+
} finally {
|
|
3212
|
+
zipFile.close();
|
|
3213
|
+
}
|
|
3214
|
+
});
|
|
3215
|
+
for (const buffers of await Promise.all(batch)) {
|
|
3216
|
+
for (const buffer of buffers) {
|
|
3217
|
+
try {
|
|
3218
|
+
mergeIstanbulCoverage(coverage, JSON.parse(buffer.toString("utf8")));
|
|
3219
|
+
} catch {
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
if (!coverage.size) {
|
|
3225
|
+
writeLine([
|
|
3226
|
+
`
|
|
3227
|
+
No code coverage was collected.`,
|
|
3228
|
+
`Make sure the application under test is built with istanbul instrumentation`,
|
|
3229
|
+
`(e.g. vite-plugin-istanbul or babel-plugin-istanbul) so that pages expose window.__coverage__,`,
|
|
3230
|
+
`and that tracing is configured with coverage, e.g. trace: { mode: 'on', coverage: true }.`,
|
|
3231
|
+
`Coverage is aggregated from the tests whose traces are kept.`
|
|
3232
|
+
].join("\n"));
|
|
3233
|
+
return;
|
|
3234
|
+
}
|
|
3235
|
+
const outputDir = (0, import_util7.resolveReporterOutputPath)("coverage", this._options.configDir, this._options.outputDir);
|
|
3236
|
+
await import_fs5.default.promises.mkdir(outputDir, { recursive: true });
|
|
3237
|
+
const mergedJson = sortedIstanbulCoverage(coverage);
|
|
3238
|
+
await import_fs5.default.promises.writeFile(import_path7.default.join(outputDir, "coverage-final.json"), JSON.stringify(mergedJson));
|
|
3239
|
+
await import_fs5.default.promises.writeFile(import_path7.default.join(outputDir, "lcov.info"), lcovReport(mergedJson));
|
|
3240
|
+
const hasHtml = this._tryWriteHtmlReport(mergedJson, outputDir);
|
|
3241
|
+
const summary = computeSummary(mergedJson);
|
|
3242
|
+
const lines = [
|
|
3243
|
+
``,
|
|
3244
|
+
`Code coverage (${coverage.size} files):`,
|
|
3245
|
+
` statements: ${formatMetric(summary.statements)}`,
|
|
3246
|
+
` branches: ${formatMetric(summary.branches)}`,
|
|
3247
|
+
` functions: ${formatMetric(summary.functions)}`,
|
|
3248
|
+
` lines: ${formatMetric(summary.lines)}`,
|
|
3249
|
+
`Coverage report written to ${import_path7.default.relative(process.cwd(), outputDir)}`
|
|
3250
|
+
];
|
|
3251
|
+
if (!hasHtml)
|
|
3252
|
+
lines.push(`For an HTML report, install istanbul-lib-coverage, istanbul-lib-report and istanbul-reports, or run 'npx nyc report --temp-dir=${import_path7.default.relative(process.cwd(), outputDir)} --reporter=html'.`);
|
|
3253
|
+
writeLine(lines.join("\n"));
|
|
3254
|
+
}
|
|
3255
|
+
// Istanbul report libraries are not shipped with Playwright, use the project's if any.
|
|
3256
|
+
_tryWriteHtmlReport(mergedJson, outputDir) {
|
|
3257
|
+
try {
|
|
3258
|
+
const resolveFrom = (name) => require.resolve(name, { paths: [this._options.configDir] });
|
|
3259
|
+
const libCoverage = require(resolveFrom("istanbul-lib-coverage"));
|
|
3260
|
+
const libReport = require(resolveFrom("istanbul-lib-report"));
|
|
3261
|
+
const reports = require(resolveFrom("istanbul-reports"));
|
|
3262
|
+
const context = libReport.createContext({
|
|
3263
|
+
dir: outputDir,
|
|
3264
|
+
coverageMap: libCoverage.createCoverageMap(mergedJson)
|
|
3265
|
+
});
|
|
3266
|
+
reports.create("html").execute(context);
|
|
3267
|
+
return true;
|
|
3268
|
+
} catch {
|
|
3269
|
+
return false;
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
};
|
|
3273
|
+
function computeSummary(mergedJson) {
|
|
3274
|
+
const statements = { covered: 0, total: 0 };
|
|
3275
|
+
const branches = { covered: 0, total: 0 };
|
|
3276
|
+
const functions = { covered: 0, total: 0 };
|
|
3277
|
+
const lines = { covered: 0, total: 0 };
|
|
3278
|
+
for (const fileCov of Object.values(mergedJson)) {
|
|
3279
|
+
countHits(statements, Object.values(fileCov.s));
|
|
3280
|
+
countHits(functions, Object.values(fileCov.f));
|
|
3281
|
+
for (const counts of Object.values(fileCov.b))
|
|
3282
|
+
countHits(branches, counts);
|
|
3283
|
+
countHits(lines, lineCoverage(fileCov).values());
|
|
3284
|
+
}
|
|
3285
|
+
return { statements, branches, functions, lines };
|
|
3286
|
+
}
|
|
3287
|
+
function countHits(metric, counts) {
|
|
3288
|
+
for (const count of counts) {
|
|
3289
|
+
++metric.total;
|
|
3290
|
+
if (count > 0)
|
|
3291
|
+
++metric.covered;
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
function lineCoverage(fileCov) {
|
|
3295
|
+
const lines = /* @__PURE__ */ new Map();
|
|
3296
|
+
for (const [key, statement] of Object.entries(fileCov.statementMap)) {
|
|
3297
|
+
const line = statement.start.line;
|
|
3298
|
+
const count = fileCov.s[key] || 0;
|
|
3299
|
+
lines.set(line, Math.max(lines.get(line) || 0, count));
|
|
3300
|
+
}
|
|
3301
|
+
return lines;
|
|
3302
|
+
}
|
|
3303
|
+
function formatMetric(metric) {
|
|
3304
|
+
const percent = metric.total ? (metric.covered / metric.total * 100).toFixed(2) : "100.00";
|
|
3305
|
+
return `${percent}% (${metric.covered}/${metric.total})`;
|
|
3306
|
+
}
|
|
3307
|
+
function lcovReport(mergedJson) {
|
|
3308
|
+
const out = [];
|
|
3309
|
+
for (const [file, fileCov] of Object.entries(mergedJson)) {
|
|
3310
|
+
out.push(`SF:${file}`);
|
|
3311
|
+
let functionsCovered = 0;
|
|
3312
|
+
for (const [key, fn] of Object.entries(fileCov.fnMap)) {
|
|
3313
|
+
out.push(`FN:${fn.decl.start.line},${fn.name}`);
|
|
3314
|
+
out.push(`FNDA:${fileCov.f[key] || 0},${fn.name}`);
|
|
3315
|
+
if (fileCov.f[key] > 0)
|
|
3316
|
+
++functionsCovered;
|
|
3317
|
+
}
|
|
3318
|
+
out.push(`FNF:${Object.keys(fileCov.fnMap).length}`);
|
|
3319
|
+
out.push(`FNH:${functionsCovered}`);
|
|
3320
|
+
let branchesFound = 0;
|
|
3321
|
+
let branchesCovered = 0;
|
|
3322
|
+
for (const [key, branch] of Object.entries(fileCov.branchMap)) {
|
|
3323
|
+
const counts = fileCov.b[key] || [];
|
|
3324
|
+
branch.locations.forEach((location, i) => {
|
|
3325
|
+
const count = counts[i] || 0;
|
|
3326
|
+
out.push(`BRDA:${location.start.line ?? branch.loc.start.line},${key},${i},${count}`);
|
|
3327
|
+
++branchesFound;
|
|
3328
|
+
if (count > 0)
|
|
3329
|
+
++branchesCovered;
|
|
3330
|
+
});
|
|
3331
|
+
}
|
|
3332
|
+
out.push(`BRF:${branchesFound}`);
|
|
3333
|
+
out.push(`BRH:${branchesCovered}`);
|
|
3334
|
+
const lines = lineCoverage(fileCov);
|
|
3335
|
+
let linesCovered = 0;
|
|
3336
|
+
for (const [line, count] of [...lines.entries()].sort((a, b) => a[0] - b[0])) {
|
|
3337
|
+
out.push(`DA:${line},${count}`);
|
|
3338
|
+
if (count > 0)
|
|
3339
|
+
++linesCovered;
|
|
3340
|
+
}
|
|
3341
|
+
out.push(`LF:${lines.size}`);
|
|
3342
|
+
out.push(`LH:${linesCovered}`);
|
|
3343
|
+
out.push(`end_of_record`);
|
|
3344
|
+
}
|
|
3345
|
+
return out.join("\n") + "\n";
|
|
3346
|
+
}
|
|
3347
|
+
function writeLine(line) {
|
|
3348
|
+
terminalScreen.stdout.write(line + "\n");
|
|
3349
|
+
}
|
|
3350
|
+
var coverage_default = CoverageReporter;
|
|
3351
|
+
|
|
3177
3352
|
// packages/playwright/src/reporters/dot.ts
|
|
3178
3353
|
var { getAsBooleanFromENV } = require("playwright-core/lib/coreBundle").utils;
|
|
3179
3354
|
var DotReporter = class extends TerminalReporter {
|
|
@@ -3264,8 +3439,8 @@ var EmptyReporter = class {
|
|
|
3264
3439
|
var empty_default = EmptyReporter;
|
|
3265
3440
|
|
|
3266
3441
|
// packages/playwright/src/reporters/github.ts
|
|
3267
|
-
var
|
|
3268
|
-
var
|
|
3442
|
+
var import_path8 = __toESM(require("path"));
|
|
3443
|
+
var import_util8 = require("../util");
|
|
3269
3444
|
var { noColors: noColors2 } = require("playwright-core/lib/coreBundle").iso;
|
|
3270
3445
|
var { msToString: msToString2 } = require("playwright-core/lib/coreBundle").iso;
|
|
3271
3446
|
var { getAsBooleanFromENV: getAsBooleanFromENV2 } = require("playwright-core/lib/coreBundle").utils;
|
|
@@ -3276,7 +3451,7 @@ var GitHubLogger = class {
|
|
|
3276
3451
|
_log(message, type = "notice", options = {}) {
|
|
3277
3452
|
message = message.replace(/\n/g, "%0A");
|
|
3278
3453
|
const configs = Object.entries(options).map(([key, option]) => `${key}=${option}`).join(",");
|
|
3279
|
-
process.stdout.write((0,
|
|
3454
|
+
process.stdout.write((0, import_util8.stripAnsiEscapes)(`::${type} ${configs}::${message}
|
|
3280
3455
|
`));
|
|
3281
3456
|
}
|
|
3282
3457
|
debug(message, options) {
|
|
@@ -3340,7 +3515,7 @@ var GitHubReporter = class extends TerminalReporter {
|
|
|
3340
3515
|
}
|
|
3341
3516
|
_printSlowTestAnnotations() {
|
|
3342
3517
|
this.getSlowTests().forEach(([file, duration]) => {
|
|
3343
|
-
const filePath = workspaceRelativePath(
|
|
3518
|
+
const filePath = workspaceRelativePath(import_path8.default.join(process.cwd(), file));
|
|
3344
3519
|
this.githubLogger.warning(`${filePath} took ${msToString2(duration)}`, {
|
|
3345
3520
|
title: "Slow Test",
|
|
3346
3521
|
file: filePath
|
|
@@ -3371,7 +3546,7 @@ var GitHubReporter = class extends TerminalReporter {
|
|
|
3371
3546
|
}
|
|
3372
3547
|
};
|
|
3373
3548
|
function workspaceRelativePath(filePath) {
|
|
3374
|
-
return
|
|
3549
|
+
return import_path8.default.relative(process.env["GITHUB_WORKSPACE"] ?? "", filePath);
|
|
3375
3550
|
}
|
|
3376
3551
|
var github_default = GitHubReporter;
|
|
3377
3552
|
|
|
@@ -3381,18 +3556,18 @@ __export(html_exports, {
|
|
|
3381
3556
|
default: () => html_default,
|
|
3382
3557
|
showHTMLReport: () => showHTMLReport
|
|
3383
3558
|
});
|
|
3384
|
-
var
|
|
3559
|
+
var import_fs6 = __toESM(require("fs"));
|
|
3385
3560
|
var import_os = __toESM(require("os"));
|
|
3386
|
-
var
|
|
3561
|
+
var import_path9 = __toESM(require("path"));
|
|
3387
3562
|
var import_stream3 = require("stream");
|
|
3388
3563
|
var babel2 = __toESM(require("../transform/babelBundle"));
|
|
3389
|
-
var
|
|
3564
|
+
var import_util9 = require("../util");
|
|
3390
3565
|
var colors2 = require("playwright-core/lib/utilsBundle").colors;
|
|
3391
3566
|
var mime2 = require("playwright-core/lib/utilsBundle").mime;
|
|
3392
3567
|
var open = require("playwright-core/lib/utilsBundle").open;
|
|
3393
3568
|
var yazl2 = require("playwright-core/lib/utilsBundle").yazl;
|
|
3394
3569
|
var { MultiMap } = require("playwright-core/lib/coreBundle").iso;
|
|
3395
|
-
var { calculateSha1:
|
|
3570
|
+
var { calculateSha1: calculateSha13 } = require("playwright-core/lib/coreBundle").utils;
|
|
3396
3571
|
var { copyFileAndMakeWritable, removeFolders: removeFolders2, sanitizeForFilePath: sanitizeForFilePath2, toPosixPath: toPosixPath2 } = require("playwright-core/lib/coreBundle").utils;
|
|
3397
3572
|
var { getPackageManagerExecCommand: getPackageManagerExecCommand2, isCodingAgent } = require("playwright-core/lib/coreBundle").utils;
|
|
3398
3573
|
var { HttpServer, serveFolder } = require("playwright-core/lib/coreBundle").utils;
|
|
@@ -3432,19 +3607,19 @@ var HtmlReporter = class {
|
|
|
3432
3607
|
if (reportedWarnings.has(key))
|
|
3433
3608
|
continue;
|
|
3434
3609
|
reportedWarnings.add(key);
|
|
3435
|
-
|
|
3436
|
-
|
|
3610
|
+
writeLine2(colors2.red(`Configuration Error: HTML reporter output folder clashes with the tests output folder:`));
|
|
3611
|
+
writeLine2(`
|
|
3437
3612
|
html reporter folder: ${colors2.bold(outputFolder)}
|
|
3438
3613
|
test results folder: ${colors2.bold(project.outputDir)}`);
|
|
3439
|
-
|
|
3440
|
-
|
|
3614
|
+
writeLine2("");
|
|
3615
|
+
writeLine2(`HTML reporter will clear its output directory prior to being generated, which will lead to the artifact loss.
|
|
3441
3616
|
`);
|
|
3442
3617
|
}
|
|
3443
3618
|
}
|
|
3444
3619
|
this.suite = suite;
|
|
3445
3620
|
}
|
|
3446
3621
|
_resolveOptions() {
|
|
3447
|
-
const outputFolder = reportFolderFromEnv() ?? (0,
|
|
3622
|
+
const outputFolder = reportFolderFromEnv() ?? (0, import_util9.resolveReporterOutputPath)("playwright-report", this._options.configDir, this._options.outputFolder);
|
|
3448
3623
|
return {
|
|
3449
3624
|
outputFolder,
|
|
3450
3625
|
open: getHtmlReportOptionProcessEnv() || this._options.open || "on-failure",
|
|
@@ -3454,8 +3629,8 @@ var HtmlReporter = class {
|
|
|
3454
3629
|
};
|
|
3455
3630
|
}
|
|
3456
3631
|
_isSubdirectory(parentDir, dir) {
|
|
3457
|
-
const relativePath =
|
|
3458
|
-
return !!relativePath && !relativePath.startsWith("..") && !
|
|
3632
|
+
const relativePath = import_path9.default.relative(parentDir, dir);
|
|
3633
|
+
return !!relativePath && !relativePath.startsWith("..") && !import_path9.default.isAbsolute(relativePath);
|
|
3459
3634
|
}
|
|
3460
3635
|
onError(error) {
|
|
3461
3636
|
this._topLevelErrors.push(error);
|
|
@@ -3492,12 +3667,14 @@ var HtmlReporter = class {
|
|
|
3492
3667
|
await showHTMLReport(this._outputFolder, this._host, this._port, singleTestId);
|
|
3493
3668
|
} else if (this._options._mode === "test" && !!process.stdin.isTTY) {
|
|
3494
3669
|
const packageManagerCommand = getPackageManagerExecCommand2();
|
|
3495
|
-
const
|
|
3670
|
+
const invocationDir = process.env.INIT_CWD || process.cwd();
|
|
3671
|
+
const isDefaultFolder = invocationDir === process.cwd() && this._outputFolder === standaloneDefaultFolder();
|
|
3672
|
+
const relativeReportPath = isDefaultFolder ? "" : " " + (import_path9.default.relative(invocationDir, this._outputFolder) || ".");
|
|
3496
3673
|
const hostArg = this._host ? ` --host ${this._host}` : "";
|
|
3497
3674
|
const portArg = this._port ? ` --port ${this._port}` : "";
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3675
|
+
writeLine2("");
|
|
3676
|
+
writeLine2("To open last HTML report run:");
|
|
3677
|
+
writeLine2(colors2.cyan(`
|
|
3501
3678
|
${packageManagerCommand} playwright show-report${relativeReportPath}${hostArg}${portArg}
|
|
3502
3679
|
`));
|
|
3503
3680
|
}
|
|
@@ -3505,14 +3682,14 @@ var HtmlReporter = class {
|
|
|
3505
3682
|
};
|
|
3506
3683
|
function reportFolderFromEnv() {
|
|
3507
3684
|
const envValue = process.env.PLAYWRIGHT_HTML_OUTPUT_DIR || process.env.PLAYWRIGHT_HTML_REPORT;
|
|
3508
|
-
return envValue ?
|
|
3685
|
+
return envValue ? import_path9.default.resolve(envValue) : void 0;
|
|
3509
3686
|
}
|
|
3510
3687
|
function getHtmlReportOptionProcessEnv() {
|
|
3511
3688
|
const htmlOpenEnv = process.env.PLAYWRIGHT_HTML_OPEN || process.env.PW_TEST_HTML_REPORT_OPEN;
|
|
3512
3689
|
if (!htmlOpenEnv)
|
|
3513
3690
|
return void 0;
|
|
3514
3691
|
if (!isHtmlReportOption(htmlOpenEnv)) {
|
|
3515
|
-
|
|
3692
|
+
writeLine2(colors2.red(`Configuration Error: HTML reporter Invalid value for PLAYWRIGHT_HTML_OPEN: ${htmlOpenEnv}. Valid values are: ${htmlReportOptions.join(", ")}`));
|
|
3516
3693
|
return void 0;
|
|
3517
3694
|
}
|
|
3518
3695
|
return htmlOpenEnv;
|
|
@@ -3526,10 +3703,10 @@ function parseBooleanEnvVar(name) {
|
|
|
3526
3703
|
return void 0;
|
|
3527
3704
|
}
|
|
3528
3705
|
function standaloneDefaultFolder() {
|
|
3529
|
-
return reportFolderFromEnv() ?? (0,
|
|
3706
|
+
return reportFolderFromEnv() ?? (0, import_util9.resolveReporterOutputPath)("playwright-report", process.cwd(), void 0);
|
|
3530
3707
|
}
|
|
3531
3708
|
async function resolveReportFolder(reportPath) {
|
|
3532
|
-
const stat = await
|
|
3709
|
+
const stat = await import_fs6.default.promises.stat(reportPath).catch(() => null);
|
|
3533
3710
|
if (!stat)
|
|
3534
3711
|
throw new Error(`No report found at "${reportPath}"`);
|
|
3535
3712
|
if (stat.isDirectory())
|
|
@@ -3539,10 +3716,10 @@ async function resolveReportFolder(reportPath) {
|
|
|
3539
3716
|
throw new Error(`No report found at "${reportPath}"`);
|
|
3540
3717
|
}
|
|
3541
3718
|
async function extractReportZip(zipPath) {
|
|
3542
|
-
const tempDir = await
|
|
3719
|
+
const tempDir = await import_fs6.default.promises.mkdtemp(import_path9.default.join(import_os.default.tmpdir(), "playwright-show-report-"));
|
|
3543
3720
|
const cleanup = () => {
|
|
3544
3721
|
try {
|
|
3545
|
-
|
|
3722
|
+
import_fs6.default.rmSync(tempDir, { recursive: true, force: true });
|
|
3546
3723
|
} catch {
|
|
3547
3724
|
}
|
|
3548
3725
|
};
|
|
@@ -3553,7 +3730,7 @@ async function extractReportZip(zipPath) {
|
|
|
3553
3730
|
cleanup();
|
|
3554
3731
|
throw new Error(`Failed to extract report from "${zipPath}": ${e.message}`);
|
|
3555
3732
|
}
|
|
3556
|
-
const hasIndex = await
|
|
3733
|
+
const hasIndex = await import_fs6.default.promises.access(import_path9.default.join(tempDir, "index.html")).then(() => true, () => false);
|
|
3557
3734
|
if (!hasIndex) {
|
|
3558
3735
|
cleanup();
|
|
3559
3736
|
throw new Error(`No "index.html" found at the top level of "${zipPath}"`);
|
|
@@ -3566,15 +3743,15 @@ async function showHTMLReport(reportFolder, host = "localhost", port, testId) {
|
|
|
3566
3743
|
try {
|
|
3567
3744
|
folder = await resolveReportFolder(requestedPath);
|
|
3568
3745
|
} catch (e) {
|
|
3569
|
-
|
|
3746
|
+
writeLine2(colors2.red(e.message));
|
|
3570
3747
|
gracefullyProcessExitDoNotHang(1);
|
|
3571
3748
|
return;
|
|
3572
3749
|
}
|
|
3573
3750
|
const server = false ? await serveHtmlReportWithHMR(folder) : serveFolder(folder);
|
|
3574
3751
|
await server.start({ port, host, preferredPort: port ? void 0 : 9323 });
|
|
3575
3752
|
let url = server.urlPrefix("human-readable");
|
|
3576
|
-
|
|
3577
|
-
|
|
3753
|
+
writeLine2("");
|
|
3754
|
+
writeLine2(colors2.cyan(` Serving HTML report at ${url}. Press Ctrl+C to quit.`));
|
|
3578
3755
|
if (testId)
|
|
3579
3756
|
url += `#?testId=${testId}`;
|
|
3580
3757
|
url = url.replace("0.0.0.0", "localhost");
|
|
@@ -3593,7 +3770,7 @@ var HtmlBuilder = class {
|
|
|
3593
3770
|
this._reportFolder = outputDir;
|
|
3594
3771
|
this._options = options;
|
|
3595
3772
|
this._doNotInlineAssets = doNotInlineAssets;
|
|
3596
|
-
|
|
3773
|
+
import_fs6.default.mkdirSync(this._reportFolder, { recursive: true });
|
|
3597
3774
|
this._attachmentsBaseURL = attachmentsBaseURL;
|
|
3598
3775
|
}
|
|
3599
3776
|
async build(metadata, projectSuites, result, topLevelErrors, machines) {
|
|
@@ -3661,60 +3838,60 @@ var HtmlBuilder = class {
|
|
|
3661
3838
|
}
|
|
3662
3839
|
const reportIndexFile = await this._writeStaticAssets();
|
|
3663
3840
|
if (this._hasTraces) {
|
|
3664
|
-
const traceViewerFolder =
|
|
3665
|
-
const traceViewerTargetFolder =
|
|
3666
|
-
const traceViewerAssetsTargetFolder =
|
|
3667
|
-
|
|
3668
|
-
for (const file of
|
|
3841
|
+
const traceViewerFolder = import_path9.default.join(require.resolve("playwright-core"), "..", "lib", "vite", "traceViewer");
|
|
3842
|
+
const traceViewerTargetFolder = import_path9.default.join(this._reportFolder, "trace");
|
|
3843
|
+
const traceViewerAssetsTargetFolder = import_path9.default.join(traceViewerTargetFolder, "assets");
|
|
3844
|
+
import_fs6.default.mkdirSync(traceViewerAssetsTargetFolder, { recursive: true });
|
|
3845
|
+
for (const file of import_fs6.default.readdirSync(traceViewerFolder)) {
|
|
3669
3846
|
if (file.endsWith(".map") || file.includes("watch") || file.includes("assets"))
|
|
3670
3847
|
continue;
|
|
3671
|
-
await copyFileAndMakeWritable(
|
|
3848
|
+
await copyFileAndMakeWritable(import_path9.default.join(traceViewerFolder, file), import_path9.default.join(traceViewerTargetFolder, file));
|
|
3672
3849
|
}
|
|
3673
|
-
for (const file of
|
|
3850
|
+
for (const file of import_fs6.default.readdirSync(import_path9.default.join(traceViewerFolder, "assets"))) {
|
|
3674
3851
|
if (file.endsWith(".map") || file.includes("xtermModule"))
|
|
3675
3852
|
continue;
|
|
3676
|
-
await copyFileAndMakeWritable(
|
|
3853
|
+
await copyFileAndMakeWritable(import_path9.default.join(traceViewerFolder, "assets", file), import_path9.default.join(traceViewerAssetsTargetFolder, file));
|
|
3677
3854
|
}
|
|
3678
3855
|
}
|
|
3679
3856
|
await this._writeReportData(reportIndexFile);
|
|
3680
3857
|
return { ok, singleTestId };
|
|
3681
3858
|
}
|
|
3682
3859
|
async _writeStaticAssets() {
|
|
3683
|
-
const appFolder =
|
|
3684
|
-
const reportIndexFile =
|
|
3860
|
+
const appFolder = import_path9.default.join(require.resolve("playwright-core"), "..", "lib", "vite", "htmlReport");
|
|
3861
|
+
const reportIndexFile = import_path9.default.join(this._reportFolder, "index.html");
|
|
3685
3862
|
if (this._doNotInlineAssets) {
|
|
3686
|
-
const html = await
|
|
3863
|
+
const html = await import_fs6.default.promises.readFile(import_path9.default.join(appFolder, "index.html"), "utf-8");
|
|
3687
3864
|
await Promise.all([
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3865
|
+
import_fs6.default.promises.writeFile(reportIndexFile, html),
|
|
3866
|
+
import_fs6.default.promises.copyFile(import_path9.default.join(appFolder, "report.js"), import_path9.default.join(this._reportFolder, "report.js")),
|
|
3867
|
+
import_fs6.default.promises.copyFile(import_path9.default.join(appFolder, "report.css"), import_path9.default.join(this._reportFolder, "report.css"))
|
|
3691
3868
|
]);
|
|
3692
3869
|
} else {
|
|
3693
|
-
let html = await
|
|
3870
|
+
let html = await import_fs6.default.promises.readFile(import_path9.default.join(appFolder, "index.html"), "utf-8");
|
|
3694
3871
|
const [js, css] = await Promise.all([
|
|
3695
|
-
|
|
3696
|
-
|
|
3872
|
+
import_fs6.default.promises.readFile(import_path9.default.join(appFolder, "report.js"), "utf-8"),
|
|
3873
|
+
import_fs6.default.promises.readFile(import_path9.default.join(appFolder, "report.css"), "utf-8")
|
|
3697
3874
|
]);
|
|
3698
3875
|
html = html.replace(/<script type="module"[^>]*><\/script>/, () => `<script type="module">${js}</script>`);
|
|
3699
3876
|
html = html.replace(/<link rel="stylesheet"[^>]*>/, () => `<style type='text/css'>${css}</style>`);
|
|
3700
|
-
await
|
|
3877
|
+
await import_fs6.default.promises.writeFile(reportIndexFile, html);
|
|
3701
3878
|
}
|
|
3702
3879
|
return reportIndexFile;
|
|
3703
3880
|
}
|
|
3704
3881
|
async _writeReportData(filePath) {
|
|
3705
|
-
|
|
3882
|
+
import_fs6.default.appendFileSync(filePath, '<template id="playwrightReportBase64">data:application/zip;base64,');
|
|
3706
3883
|
await new Promise((resolve, reject) => {
|
|
3707
3884
|
this._dataZipFile.end(void 0, () => {
|
|
3708
|
-
this._dataZipFile.outputStream.pipe(new Base64Encoder()).pipe(
|
|
3885
|
+
this._dataZipFile.outputStream.pipe(new Base64Encoder()).pipe(import_fs6.default.createWriteStream(filePath, { flags: "a" })).on("close", resolve).on("error", reject);
|
|
3709
3886
|
});
|
|
3710
3887
|
});
|
|
3711
|
-
|
|
3888
|
+
import_fs6.default.appendFileSync(filePath, "</template>");
|
|
3712
3889
|
}
|
|
3713
3890
|
_addDataFile(fileName, data) {
|
|
3714
3891
|
this._dataZipFile.addBuffer(Buffer.from(JSON.stringify(data)), fileName);
|
|
3715
3892
|
}
|
|
3716
3893
|
_createEntryForSuite(data, projectName, suite, fileName, deep) {
|
|
3717
|
-
const fileId =
|
|
3894
|
+
const fileId = calculateSha13(fileName).slice(0, 20);
|
|
3718
3895
|
let fileEntry = data.get(fileId);
|
|
3719
3896
|
if (!fileEntry) {
|
|
3720
3897
|
fileEntry = {
|
|
@@ -3731,8 +3908,8 @@ var HtmlBuilder = class {
|
|
|
3731
3908
|
testFileSummary.tests.push(test.testCaseSummary);
|
|
3732
3909
|
}
|
|
3733
3910
|
}
|
|
3734
|
-
_processSuite(suite, projectName,
|
|
3735
|
-
const newPath = [...
|
|
3911
|
+
_processSuite(suite, projectName, path21, deep, outTests) {
|
|
3912
|
+
const newPath = [...path21, suite.title];
|
|
3736
3913
|
suite.entries().forEach((e) => {
|
|
3737
3914
|
if (e.type === "test")
|
|
3738
3915
|
outTests.push(this._createTestEntry(e, projectName, newPath));
|
|
@@ -3740,10 +3917,10 @@ var HtmlBuilder = class {
|
|
|
3740
3917
|
this._processSuite(e, projectName, newPath, deep, outTests);
|
|
3741
3918
|
});
|
|
3742
3919
|
}
|
|
3743
|
-
_createTestEntry(test, projectName,
|
|
3920
|
+
_createTestEntry(test, projectName, path21) {
|
|
3744
3921
|
const duration = test.results.reduce((a, r) => a + r.duration, 0);
|
|
3745
3922
|
const location = this._relativeLocation(test.location);
|
|
3746
|
-
|
|
3923
|
+
path21 = path21.slice(1).filter((path22) => path22.length > 0);
|
|
3747
3924
|
const results = test.results.map((r) => this._createTestResult(test, r));
|
|
3748
3925
|
return {
|
|
3749
3926
|
testCase: {
|
|
@@ -3755,7 +3932,7 @@ var HtmlBuilder = class {
|
|
|
3755
3932
|
annotations: this._serializeAnnotations(test.annotations),
|
|
3756
3933
|
tags: [...new Set(test.tags)],
|
|
3757
3934
|
outcome: test.outcome(),
|
|
3758
|
-
path:
|
|
3935
|
+
path: path21,
|
|
3759
3936
|
results,
|
|
3760
3937
|
repeatEachIndex: test.repeatEachIndex || void 0,
|
|
3761
3938
|
// Do not include zero.
|
|
@@ -3770,7 +3947,7 @@ var HtmlBuilder = class {
|
|
|
3770
3947
|
annotations: this._serializeAnnotations(test.annotations),
|
|
3771
3948
|
tags: [...new Set(test.tags)],
|
|
3772
3949
|
outcome: test.outcome(),
|
|
3773
|
-
path:
|
|
3950
|
+
path: path21,
|
|
3774
3951
|
ok: test.outcome() === "expected" || test.outcome() === "flaky",
|
|
3775
3952
|
repeatEachIndex: test.repeatEachIndex || void 0,
|
|
3776
3953
|
// Do not include zero.
|
|
@@ -3791,21 +3968,21 @@ var HtmlBuilder = class {
|
|
|
3791
3968
|
this._hasTraces = true;
|
|
3792
3969
|
if ((a.name === "stdout" || a.name === "stderr") && a.contentType === "text/plain") {
|
|
3793
3970
|
if (lastAttachment && lastAttachment.name === a.name && lastAttachment.contentType === a.contentType) {
|
|
3794
|
-
lastAttachment.body += (0,
|
|
3971
|
+
lastAttachment.body += (0, import_util9.stripAnsiEscapes)(a.body);
|
|
3795
3972
|
return null;
|
|
3796
3973
|
}
|
|
3797
|
-
a.body = (0,
|
|
3974
|
+
a.body = (0, import_util9.stripAnsiEscapes)(a.body);
|
|
3798
3975
|
lastAttachment = a;
|
|
3799
3976
|
return a;
|
|
3800
3977
|
}
|
|
3801
3978
|
if (a.path) {
|
|
3802
3979
|
let fileName = a.path;
|
|
3803
3980
|
try {
|
|
3804
|
-
const buffer =
|
|
3805
|
-
const sha1 =
|
|
3981
|
+
const buffer = import_fs6.default.readFileSync(a.path);
|
|
3982
|
+
const sha1 = calculateSha13(buffer) + import_path9.default.extname(a.path);
|
|
3806
3983
|
fileName = this._attachmentsBaseURL + sha1;
|
|
3807
|
-
|
|
3808
|
-
|
|
3984
|
+
import_fs6.default.mkdirSync(import_path9.default.join(this._reportFolder, "data"), { recursive: true });
|
|
3985
|
+
import_fs6.default.writeFileSync(import_path9.default.join(this._reportFolder, "data", sha1), buffer);
|
|
3809
3986
|
} catch (e) {
|
|
3810
3987
|
}
|
|
3811
3988
|
return {
|
|
@@ -3828,10 +4005,10 @@ var HtmlBuilder = class {
|
|
|
3828
4005
|
} catch (e) {
|
|
3829
4006
|
}
|
|
3830
4007
|
}
|
|
3831
|
-
|
|
3832
|
-
const extension = sanitizeForFilePath2(
|
|
3833
|
-
const sha1 =
|
|
3834
|
-
|
|
4008
|
+
import_fs6.default.mkdirSync(import_path9.default.join(this._reportFolder, "data"), { recursive: true });
|
|
4009
|
+
const extension = sanitizeForFilePath2(import_path9.default.extname(a.name).replace(/^\./, "")) || mime2.getExtension(a.contentType) || "dat";
|
|
4010
|
+
const sha1 = calculateSha13(a.body) + "." + extension;
|
|
4011
|
+
import_fs6.default.writeFileSync(import_path9.default.join(this._reportFolder, "data", sha1), a.body);
|
|
3835
4012
|
return {
|
|
3836
4013
|
name: a.name,
|
|
3837
4014
|
contentType: a.contentType,
|
|
@@ -3908,7 +4085,7 @@ var HtmlBuilder = class {
|
|
|
3908
4085
|
_relativeLocation(location) {
|
|
3909
4086
|
if (!location)
|
|
3910
4087
|
return void 0;
|
|
3911
|
-
const file = toPosixPath2(
|
|
4088
|
+
const file = toPosixPath2(import_path9.default.relative(this._config.rootDir, location.file));
|
|
3912
4089
|
return {
|
|
3913
4090
|
file,
|
|
3914
4091
|
line: location.line,
|
|
@@ -3988,7 +4165,7 @@ function createSnippets(stepsInFile) {
|
|
|
3988
4165
|
for (const file of stepsInFile.keys()) {
|
|
3989
4166
|
let source;
|
|
3990
4167
|
try {
|
|
3991
|
-
source =
|
|
4168
|
+
source = import_fs6.default.readFileSync(file, "utf-8") + "\n//";
|
|
3992
4169
|
} catch (e) {
|
|
3993
4170
|
continue;
|
|
3994
4171
|
}
|
|
@@ -4010,7 +4187,7 @@ function createSnippets(stepsInFile) {
|
|
|
4010
4187
|
function createErrorCodeframe(message, location) {
|
|
4011
4188
|
let source;
|
|
4012
4189
|
try {
|
|
4013
|
-
source =
|
|
4190
|
+
source = import_fs6.default.readFileSync(location.file, "utf-8") + "\n//";
|
|
4014
4191
|
} catch (e) {
|
|
4015
4192
|
return;
|
|
4016
4193
|
}
|
|
@@ -4026,18 +4203,18 @@ function createErrorCodeframe(message, location) {
|
|
|
4026
4203
|
highlightCode: false,
|
|
4027
4204
|
linesAbove: 100,
|
|
4028
4205
|
linesBelow: 100,
|
|
4029
|
-
message: (0,
|
|
4206
|
+
message: (0, import_util9.stripAnsiEscapes)(message).split("\n")[0] || void 0
|
|
4030
4207
|
}
|
|
4031
4208
|
);
|
|
4032
4209
|
}
|
|
4033
|
-
function
|
|
4210
|
+
function writeLine2(line) {
|
|
4034
4211
|
process.stdout.write(line + "\n");
|
|
4035
4212
|
}
|
|
4036
4213
|
var html_default = HtmlReporter;
|
|
4037
4214
|
|
|
4038
4215
|
// packages/playwright/src/reporters/json.ts
|
|
4039
|
-
var
|
|
4040
|
-
var
|
|
4216
|
+
var import_fs7 = __toESM(require("fs"));
|
|
4217
|
+
var import_path10 = __toESM(require("path"));
|
|
4041
4218
|
var import_common5 = require("../common");
|
|
4042
4219
|
var { MultiMap: MultiMap2 } = require("playwright-core/lib/coreBundle").iso;
|
|
4043
4220
|
var { toPosixPath: toPosixPath3 } = require("playwright-core/lib/coreBundle").utils;
|
|
@@ -4130,7 +4307,7 @@ var JSONReporter = class {
|
|
|
4130
4307
|
if (!location)
|
|
4131
4308
|
return { file: "", line: 0, column: 0 };
|
|
4132
4309
|
return {
|
|
4133
|
-
file: toPosixPath3(
|
|
4310
|
+
file: toPosixPath3(import_path10.default.relative(this.config.rootDir, location.file)),
|
|
4134
4311
|
line: location.line,
|
|
4135
4312
|
column: location.column
|
|
4136
4313
|
};
|
|
@@ -4150,7 +4327,7 @@ var JSONReporter = class {
|
|
|
4150
4327
|
}
|
|
4151
4328
|
}
|
|
4152
4329
|
for (const spec of from.specs || []) {
|
|
4153
|
-
const toSpec = to.specs.find((s) => s.title === spec.title && s.file === toPosixPath3(
|
|
4330
|
+
const toSpec = to.specs.find((s) => s.title === spec.title && s.file === toPosixPath3(import_path10.default.relative(this.config.rootDir, spec.file)) && s.line === spec.line && s.column === spec.column);
|
|
4154
4331
|
if (toSpec)
|
|
4155
4332
|
toSpec.tests.push(...spec.tests);
|
|
4156
4333
|
else
|
|
@@ -4233,8 +4410,8 @@ var JSONReporter = class {
|
|
|
4233
4410
|
async function outputReport(report, resolvedOutputFile) {
|
|
4234
4411
|
const reportString = JSON.stringify(report, void 0, 2);
|
|
4235
4412
|
if (resolvedOutputFile) {
|
|
4236
|
-
await
|
|
4237
|
-
await
|
|
4413
|
+
await import_fs7.default.promises.mkdir(import_path10.default.dirname(resolvedOutputFile), { recursive: true });
|
|
4414
|
+
await import_fs7.default.promises.writeFile(resolvedOutputFile, reportString);
|
|
4238
4415
|
} else {
|
|
4239
4416
|
console.log(reportString);
|
|
4240
4417
|
}
|
|
@@ -4255,9 +4432,9 @@ function serializePatterns(patterns) {
|
|
|
4255
4432
|
var json_default = JSONReporter;
|
|
4256
4433
|
|
|
4257
4434
|
// packages/playwright/src/reporters/junit.ts
|
|
4258
|
-
var
|
|
4259
|
-
var
|
|
4260
|
-
var
|
|
4435
|
+
var import_fs8 = __toESM(require("fs"));
|
|
4436
|
+
var import_path11 = __toESM(require("path"));
|
|
4437
|
+
var import_util10 = require("../util");
|
|
4261
4438
|
var { getAsBooleanFromENV: getAsBooleanFromENV3 } = require("playwright-core/lib/coreBundle").utils;
|
|
4262
4439
|
var JUnitReporter = class {
|
|
4263
4440
|
constructor(options) {
|
|
@@ -4313,8 +4490,8 @@ var JUnitReporter = class {
|
|
|
4313
4490
|
serializeXML(root, tokens, this.stripANSIControlSequences);
|
|
4314
4491
|
const reportString = tokens.join("\n");
|
|
4315
4492
|
if (this.resolvedOutputFile) {
|
|
4316
|
-
await
|
|
4317
|
-
await
|
|
4493
|
+
await import_fs8.default.promises.mkdir(import_path11.default.dirname(this.resolvedOutputFile), { recursive: true });
|
|
4494
|
+
await import_fs8.default.promises.writeFile(this.resolvedOutputFile, reportString);
|
|
4318
4495
|
} else {
|
|
4319
4496
|
console.log(reportString);
|
|
4320
4497
|
}
|
|
@@ -4425,17 +4602,17 @@ var JUnitReporter = class {
|
|
|
4425
4602
|
entry.children.push({
|
|
4426
4603
|
name: errorInfo.elementName,
|
|
4427
4604
|
attributes: { message: errorInfo.message, type: errorInfo.type },
|
|
4428
|
-
text: (0,
|
|
4605
|
+
text: (0, import_util10.stripAnsiEscapes)(formatFailure(nonTerminalScreen, this.config, test, void 0, { omitTags: this.omitTags }))
|
|
4429
4606
|
});
|
|
4430
4607
|
return errorInfo.elementName;
|
|
4431
4608
|
}
|
|
4432
4609
|
entry.children.push({
|
|
4433
4610
|
name: "failure",
|
|
4434
4611
|
attributes: {
|
|
4435
|
-
message: `${
|
|
4612
|
+
message: `${import_path11.default.basename(test.location.file)}:${test.location.line}:${test.location.column} ${test.title}`,
|
|
4436
4613
|
type: "FAILURE"
|
|
4437
4614
|
},
|
|
4438
|
-
text: (0,
|
|
4615
|
+
text: (0, import_util10.stripAnsiEscapes)(formatFailure(nonTerminalScreen, this.config, test, void 0, { omitTags: this.omitTags }))
|
|
4439
4616
|
});
|
|
4440
4617
|
return "failure";
|
|
4441
4618
|
}
|
|
@@ -4450,16 +4627,16 @@ var JUnitReporter = class {
|
|
|
4450
4627
|
for (const attachment of result.attachments) {
|
|
4451
4628
|
if (!attachment.path)
|
|
4452
4629
|
continue;
|
|
4453
|
-
let attachmentPath =
|
|
4630
|
+
let attachmentPath = import_path11.default.relative(this.configDir, attachment.path);
|
|
4454
4631
|
try {
|
|
4455
4632
|
if (this.resolvedOutputFile)
|
|
4456
|
-
attachmentPath =
|
|
4633
|
+
attachmentPath = import_path11.default.relative(import_path11.default.dirname(this.resolvedOutputFile), attachment.path);
|
|
4457
4634
|
} catch {
|
|
4458
4635
|
systemOut.push(`
|
|
4459
4636
|
Warning: Unable to make attachment path ${attachment.path} relative to report output file ${this.resolvedOutputFile}`);
|
|
4460
4637
|
}
|
|
4461
4638
|
try {
|
|
4462
|
-
await
|
|
4639
|
+
await import_fs8.default.promises.access(attachment.path);
|
|
4463
4640
|
systemOut.push(`
|
|
4464
4641
|
[[ATTACHMENT|${attachmentPath}]]
|
|
4465
4642
|
`);
|
|
@@ -4482,7 +4659,7 @@ Warning: attachment ${attachmentPath} is missing`);
|
|
|
4482
4659
|
children: []
|
|
4483
4660
|
};
|
|
4484
4661
|
const stackTrace = result.error?.stack || result.error?.message || result.error?.value || "";
|
|
4485
|
-
entry.children.push({ name: "stackTrace", text: (0,
|
|
4662
|
+
entry.children.push({ name: "stackTrace", text: (0, import_util10.stripAnsiEscapes)(stackTrace) });
|
|
4486
4663
|
await this._appendStdIO(entry, [result]);
|
|
4487
4664
|
return entry;
|
|
4488
4665
|
}
|
|
@@ -4491,7 +4668,7 @@ function classifyResultError(result) {
|
|
|
4491
4668
|
const error = result.error;
|
|
4492
4669
|
if (!error)
|
|
4493
4670
|
return null;
|
|
4494
|
-
const rawMessage = (0,
|
|
4671
|
+
const rawMessage = (0, import_util10.stripAnsiEscapes)(error.message || error.value || "");
|
|
4495
4672
|
const nameMatch = rawMessage.match(/^(\w+): /);
|
|
4496
4673
|
const errorName = nameMatch ? nameMatch[1] : "";
|
|
4497
4674
|
const messageBody = nameMatch ? rawMessage.slice(nameMatch[0].length) : rawMessage;
|
|
@@ -4533,7 +4710,7 @@ function serializeXML(entry, tokens, stripANSIControlSequences) {
|
|
|
4533
4710
|
var discouragedXMLCharacters = /[\u0000-\u0008\u000b-\u000c\u000e-\u001f\u007f-\u0084\u0086-\u009f]/g;
|
|
4534
4711
|
function escape(text, stripANSIControlSequences, isCharacterData) {
|
|
4535
4712
|
if (stripANSIControlSequences)
|
|
4536
|
-
text = (0,
|
|
4713
|
+
text = (0, import_util10.stripAnsiEscapes)(text);
|
|
4537
4714
|
if (isCharacterData) {
|
|
4538
4715
|
text = "<![CDATA[" + text.replace(/]]>/g, "]]>") + "]]>";
|
|
4539
4716
|
} else {
|
|
@@ -4656,7 +4833,7 @@ var LineReporter = class extends TerminalReporter {
|
|
|
4656
4833
|
var line_default = LineReporter;
|
|
4657
4834
|
|
|
4658
4835
|
// packages/playwright/src/reporters/list.ts
|
|
4659
|
-
var
|
|
4836
|
+
var import_util11 = require("../util");
|
|
4660
4837
|
var { msToString: msToString3 } = require("playwright-core/lib/coreBundle").iso;
|
|
4661
4838
|
var { getAsBooleanFromENV: getAsBooleanFromENV5 } = require("playwright-core/lib/coreBundle").utils;
|
|
4662
4839
|
var DOES_NOT_SUPPORT_UTF8_IN_TERMINAL = process.platform === "win32" && process.env.TERM_PROGRAM !== "vscode" && !process.env.WT_SESSION;
|
|
@@ -4664,7 +4841,8 @@ var POSITIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? "ok" : "\u2713";
|
|
|
4664
4841
|
var NEGATIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? "x" : "\u2718";
|
|
4665
4842
|
var ListReporter = class extends TerminalReporter {
|
|
4666
4843
|
constructor(options) {
|
|
4667
|
-
|
|
4844
|
+
const printFailuresInline = getAsBooleanFromENV5("PLAYWRIGHT_LIST_PRINT_FAILURES_INLINE", options?.printFailuresInline);
|
|
4845
|
+
super({ ...options, omitTags: getAsBooleanFromENV5("PLAYWRIGHT_LIST_OMIT_TAGS", options?.omitTags), lastResult: printFailuresInline });
|
|
4668
4846
|
this._lastRow = 0;
|
|
4669
4847
|
this._lastColumn = 0;
|
|
4670
4848
|
this._testRows = /* @__PURE__ */ new Map();
|
|
@@ -4672,10 +4850,10 @@ var ListReporter = class extends TerminalReporter {
|
|
|
4672
4850
|
this._resultIndex = /* @__PURE__ */ new Map();
|
|
4673
4851
|
this._stepIndex = /* @__PURE__ */ new Map();
|
|
4674
4852
|
this._needNewLine = false;
|
|
4675
|
-
this._failureIndex =
|
|
4853
|
+
this._failureIndex = /* @__PURE__ */ new Map();
|
|
4676
4854
|
this._paused = /* @__PURE__ */ new Set();
|
|
4677
4855
|
this._printSteps = getAsBooleanFromENV5("PLAYWRIGHT_LIST_PRINT_STEPS", options?.printSteps);
|
|
4678
|
-
this._printFailuresInline =
|
|
4856
|
+
this._printFailuresInline = printFailuresInline;
|
|
4679
4857
|
}
|
|
4680
4858
|
onBegin(suite) {
|
|
4681
4859
|
super.onBegin(suite);
|
|
@@ -4808,7 +4986,12 @@ var ListReporter = class extends TerminalReporter {
|
|
|
4808
4986
|
}
|
|
4809
4987
|
_printFailure(test) {
|
|
4810
4988
|
this._maybeWriteNewLine();
|
|
4811
|
-
|
|
4989
|
+
let index = this._failureIndex.get(test);
|
|
4990
|
+
if (index === void 0) {
|
|
4991
|
+
index = this._failureIndex.size + 1;
|
|
4992
|
+
this._failureIndex.set(test, index);
|
|
4993
|
+
}
|
|
4994
|
+
const message = "\n" + this.formatFailure(test, index) + "\n";
|
|
4812
4995
|
this._updateLineCountAndNewLineFlagForOutput(message);
|
|
4813
4996
|
this.screen.stdout.write(message);
|
|
4814
4997
|
}
|
|
@@ -4874,7 +5057,7 @@ var ListReporter = class extends TerminalReporter {
|
|
|
4874
5057
|
this.screen.stdout.write(`\x1B[${this._lastRow - row}E`);
|
|
4875
5058
|
}
|
|
4876
5059
|
_testPrefix(index, statusMark) {
|
|
4877
|
-
const statusMarkLength = (0,
|
|
5060
|
+
const statusMarkLength = (0, import_util11.stripAnsiEscapes)(statusMark).length;
|
|
4878
5061
|
const indexLength = Math.ceil(Math.log10(this.totalTestCount + 1));
|
|
4879
5062
|
return " " + statusMark + " ".repeat(3 - statusMarkLength) + this.screen.colors.dim(index.padStart(indexLength) + " ");
|
|
4880
5063
|
}
|
|
@@ -4898,7 +5081,7 @@ var lastStepOrdinalSymbol = /* @__PURE__ */ Symbol("lastStepOrdinal");
|
|
|
4898
5081
|
var list_default = ListReporter;
|
|
4899
5082
|
|
|
4900
5083
|
// packages/playwright/src/reporters/listModeReporter.ts
|
|
4901
|
-
var
|
|
5084
|
+
var import_path12 = __toESM(require("path"));
|
|
4902
5085
|
var ListModeReporter = class {
|
|
4903
5086
|
constructor(options = {}) {
|
|
4904
5087
|
this._options = options;
|
|
@@ -4916,7 +5099,7 @@ var ListModeReporter = class {
|
|
|
4916
5099
|
const files = /* @__PURE__ */ new Set();
|
|
4917
5100
|
for (const test of tests) {
|
|
4918
5101
|
const [, projectName, , ...titles] = test.titlePath();
|
|
4919
|
-
const location = `${
|
|
5102
|
+
const location = `${import_path12.default.relative(this.config.rootDir, test.location.file)}:${test.location.line}:${test.location.column}`;
|
|
4920
5103
|
const testId = this._options.includeTestId ? `[id=${test.id}] ` : "";
|
|
4921
5104
|
const projectLabel = this._options.includeTestId ? `project=` : "";
|
|
4922
5105
|
const projectTitle = projectName ? `[${projectLabel}${projectName}] \u203A ` : "";
|
|
@@ -4935,11 +5118,12 @@ var ListModeReporter = class {
|
|
|
4935
5118
|
var listModeReporter_default = ListModeReporter;
|
|
4936
5119
|
|
|
4937
5120
|
// packages/playwright/src/reporters/perfetto.ts
|
|
4938
|
-
var
|
|
4939
|
-
var
|
|
5121
|
+
var import_events2 = require("events");
|
|
5122
|
+
var import_fs9 = __toESM(require("fs"));
|
|
5123
|
+
var import_path13 = __toESM(require("path"));
|
|
4940
5124
|
var import_zlib = __toESM(require("zlib"));
|
|
4941
5125
|
var import_coreBundle2 = require("playwright-core/lib/coreBundle");
|
|
4942
|
-
var
|
|
5126
|
+
var import_util12 = require("../util");
|
|
4943
5127
|
var { toPosixPath: toPosixPath4 } = require("playwright-core/lib/coreBundle").utils;
|
|
4944
5128
|
var kStatusColors = {
|
|
4945
5129
|
passed: "good",
|
|
@@ -5107,10 +5291,10 @@ var PerfettoReporter = class {
|
|
|
5107
5291
|
return `${this._relativePath(location.file)}:${location.line}:${location.column}`;
|
|
5108
5292
|
}
|
|
5109
5293
|
_formatError(error) {
|
|
5110
|
-
return (0,
|
|
5294
|
+
return (0, import_util12.stripAnsiEscapes)(formatError(nonTerminalScreen, error).message);
|
|
5111
5295
|
}
|
|
5112
5296
|
_relativePath(file) {
|
|
5113
|
-
return toPosixPath4(
|
|
5297
|
+
return toPosixPath4(import_path13.default.relative(this._config.rootDir, file));
|
|
5114
5298
|
}
|
|
5115
5299
|
async _writeReport(result) {
|
|
5116
5300
|
let timeOrigin2 = result.startTime.getTime();
|
|
@@ -5136,7 +5320,7 @@ var PerfettoReporter = class {
|
|
|
5136
5320
|
"duration": result.duration,
|
|
5137
5321
|
"status": result.status
|
|
5138
5322
|
};
|
|
5139
|
-
await
|
|
5323
|
+
await import_fs9.default.promises.mkdir(import_path13.default.dirname(this._resolvedOutputFile), { recursive: true });
|
|
5140
5324
|
const writer = new ChunkWriter(this._resolvedOutputFile);
|
|
5141
5325
|
await writer.write('{"traceEvents":[');
|
|
5142
5326
|
let separator2 = "";
|
|
@@ -5152,10 +5336,12 @@ var PerfettoReporter = class {
|
|
|
5152
5336
|
};
|
|
5153
5337
|
var ChunkWriter = class {
|
|
5154
5338
|
constructor(file) {
|
|
5155
|
-
const fileStream =
|
|
5339
|
+
const fileStream = import_fs9.default.createWriteStream(file);
|
|
5156
5340
|
const gzip = file.endsWith(".gz") ? import_zlib.default.createGzip() : void 0;
|
|
5157
5341
|
gzip?.pipe(fileStream);
|
|
5158
5342
|
this._stream = gzip ?? fileStream;
|
|
5343
|
+
if (gzip)
|
|
5344
|
+
fileStream.on("error", (error) => gzip.destroy(error));
|
|
5159
5345
|
this._closed = new Promise((resolve) => fileStream.on("close", resolve));
|
|
5160
5346
|
for (const stream of /* @__PURE__ */ new Set([this._stream, fileStream]))
|
|
5161
5347
|
stream.on("error", (error) => this._error ??= error);
|
|
@@ -5164,7 +5350,7 @@ var ChunkWriter = class {
|
|
|
5164
5350
|
if (this._error)
|
|
5165
5351
|
throw this._error;
|
|
5166
5352
|
if (!this._stream.write(chunk))
|
|
5167
|
-
await
|
|
5353
|
+
await (0, import_events2.once)(this._stream, "drain");
|
|
5168
5354
|
}
|
|
5169
5355
|
async close() {
|
|
5170
5356
|
this._stream.end();
|
|
@@ -5191,7 +5377,7 @@ function concatChunks(chunks) {
|
|
|
5191
5377
|
var perfetto_default = PerfettoReporter;
|
|
5192
5378
|
|
|
5193
5379
|
// packages/playwright/src/runner/reporters.ts
|
|
5194
|
-
var { calculateSha1:
|
|
5380
|
+
var { calculateSha1: calculateSha14 } = require("playwright-core/lib/coreBundle").utils;
|
|
5195
5381
|
async function createReporters(config2, mode, descriptions, runOptions) {
|
|
5196
5382
|
const defaultReporters = {
|
|
5197
5383
|
"blob": BlobReporter,
|
|
@@ -5203,7 +5389,8 @@ async function createReporters(config2, mode, descriptions, runOptions) {
|
|
|
5203
5389
|
"json": json_default,
|
|
5204
5390
|
"junit": junit_default,
|
|
5205
5391
|
"null": empty_default,
|
|
5206
|
-
"html": html_default
|
|
5392
|
+
"html": html_default,
|
|
5393
|
+
"coverage": coverage_default
|
|
5207
5394
|
};
|
|
5208
5395
|
const reporters = [];
|
|
5209
5396
|
descriptions ??= config2.config.reporter;
|
|
@@ -5270,22 +5457,22 @@ function computeCommandHash(config2, runOptions) {
|
|
|
5270
5457
|
if (config2.config.tags.length)
|
|
5271
5458
|
command.tags = config2.config.tags.join(" ");
|
|
5272
5459
|
if (runOptions?.testList)
|
|
5273
|
-
command.testList =
|
|
5460
|
+
command.testList = calculateSha14(import_fs10.default.readFileSync(runOptions.testList));
|
|
5274
5461
|
if (runOptions?.testListInvert)
|
|
5275
|
-
command.testListInvert =
|
|
5462
|
+
command.testListInvert = calculateSha14(import_fs10.default.readFileSync(runOptions.testListInvert));
|
|
5276
5463
|
if (Object.keys(command).length)
|
|
5277
|
-
parts.push(
|
|
5464
|
+
parts.push(calculateSha14(JSON.stringify(command)).substring(0, 7));
|
|
5278
5465
|
return parts.join("-");
|
|
5279
5466
|
}
|
|
5280
5467
|
|
|
5281
5468
|
// packages/playwright/src/runner/tasks.ts
|
|
5282
|
-
var
|
|
5283
|
-
var
|
|
5284
|
-
var
|
|
5469
|
+
var import_fs13 = __toESM(require("fs"));
|
|
5470
|
+
var import_path17 = __toESM(require("path"));
|
|
5471
|
+
var import_util15 = require("util");
|
|
5285
5472
|
|
|
5286
5473
|
// packages/playwright/src/runner/rebase.ts
|
|
5287
|
-
var
|
|
5288
|
-
var
|
|
5474
|
+
var import_fs11 = __toESM(require("fs"));
|
|
5475
|
+
var import_path14 = __toESM(require("path"));
|
|
5289
5476
|
var babel3 = __toESM(require("../transform/babelBundle"));
|
|
5290
5477
|
var colors3 = require("playwright-core/lib/utilsBundle").colors;
|
|
5291
5478
|
var diff = require("playwright-core/lib/utilsBundle").diff;
|
|
@@ -5309,16 +5496,16 @@ async function applySuggestedRebaselines(config2, reporter, filteredProjects) {
|
|
|
5309
5496
|
const patches = [];
|
|
5310
5497
|
const files = [];
|
|
5311
5498
|
const gitCache = /* @__PURE__ */ new Map();
|
|
5312
|
-
const patchFile =
|
|
5499
|
+
const patchFile = import_path14.default.join(project.project.outputDir, "rebaselines.patch");
|
|
5313
5500
|
for (const fileName of [...suggestedRebaselines.keys()].sort()) {
|
|
5314
|
-
const source = await
|
|
5501
|
+
const source = await import_fs11.default.promises.readFile(fileName, "utf8");
|
|
5315
5502
|
const lines = source.split("\n");
|
|
5316
5503
|
const replacements = suggestedRebaselines.get(fileName);
|
|
5317
5504
|
const fileNode = babel3.babelParse(source, fileName, true);
|
|
5318
5505
|
const ranges = [];
|
|
5319
5506
|
babel3.traverse(fileNode, {
|
|
5320
|
-
CallExpression: (
|
|
5321
|
-
const node =
|
|
5507
|
+
CallExpression: (path21) => {
|
|
5508
|
+
const node = path21.node;
|
|
5322
5509
|
if (node.arguments.length < 1)
|
|
5323
5510
|
return;
|
|
5324
5511
|
if (!t.isMemberExpression(node.callee))
|
|
@@ -5345,15 +5532,15 @@ async function applySuggestedRebaselines(config2, reporter, filteredProjects) {
|
|
|
5345
5532
|
let result = source;
|
|
5346
5533
|
for (const range of ranges)
|
|
5347
5534
|
result = result.substring(0, range.start) + range.newText + result.substring(range.end);
|
|
5348
|
-
const relativeName =
|
|
5535
|
+
const relativeName = import_path14.default.relative(process.cwd(), fileName);
|
|
5349
5536
|
files.push(relativeName);
|
|
5350
5537
|
if (config2.config.updateSourceMethod === "overwrite") {
|
|
5351
|
-
await
|
|
5538
|
+
await import_fs11.default.promises.writeFile(fileName, result);
|
|
5352
5539
|
} else if (config2.config.updateSourceMethod === "3way") {
|
|
5353
|
-
await
|
|
5540
|
+
await import_fs11.default.promises.writeFile(fileName, applyPatchWithConflictMarkers(source, result));
|
|
5354
5541
|
} else {
|
|
5355
|
-
const gitFolder = findGitRoot(
|
|
5356
|
-
const relativeToGit =
|
|
5542
|
+
const gitFolder = findGitRoot(import_path14.default.dirname(fileName), gitCache);
|
|
5543
|
+
const relativeToGit = import_path14.default.relative(gitFolder || process.cwd(), fileName);
|
|
5357
5544
|
patches.push(createPatch(relativeToGit, source, result));
|
|
5358
5545
|
}
|
|
5359
5546
|
}
|
|
@@ -5364,10 +5551,10 @@ New baselines created for:
|
|
|
5364
5551
|
${fileList}
|
|
5365
5552
|
`);
|
|
5366
5553
|
if (config2.config.updateSourceMethod === "patch") {
|
|
5367
|
-
await
|
|
5368
|
-
await
|
|
5554
|
+
await import_fs11.default.promises.mkdir(import_path14.default.dirname(patchFile), { recursive: true });
|
|
5555
|
+
await import_fs11.default.promises.writeFile(patchFile, patches.join("\n"));
|
|
5369
5556
|
reporter.onStdErr(`
|
|
5370
|
-
` + colors3.cyan("git apply " +
|
|
5557
|
+
` + colors3.cyan("git apply " + import_path14.default.relative(process.cwd(), patchFile)) + "\n");
|
|
5371
5558
|
}
|
|
5372
5559
|
}
|
|
5373
5560
|
function createPatch(fileName, before, after) {
|
|
@@ -5384,12 +5571,12 @@ function findGitRoot(dir, cache) {
|
|
|
5384
5571
|
const result = cache.get(dir);
|
|
5385
5572
|
if (result !== void 0)
|
|
5386
5573
|
return result;
|
|
5387
|
-
const gitPath =
|
|
5388
|
-
if (
|
|
5574
|
+
const gitPath = import_path14.default.join(dir, ".git");
|
|
5575
|
+
if (import_fs11.default.existsSync(gitPath) && import_fs11.default.lstatSync(gitPath).isDirectory()) {
|
|
5389
5576
|
cache.set(dir, dir);
|
|
5390
5577
|
return dir;
|
|
5391
5578
|
}
|
|
5392
|
-
const parentDir =
|
|
5579
|
+
const parentDir = import_path14.default.dirname(dir);
|
|
5393
5580
|
if (dir === parentDir) {
|
|
5394
5581
|
cache.set(dir, null);
|
|
5395
5582
|
return null;
|
|
@@ -5433,8 +5620,8 @@ function applyPatchWithConflictMarkers(oldText, newText) {
|
|
|
5433
5620
|
}
|
|
5434
5621
|
|
|
5435
5622
|
// packages/playwright/src/runner/workerHost.ts
|
|
5436
|
-
var
|
|
5437
|
-
var
|
|
5623
|
+
var import_fs12 = __toESM(require("fs"));
|
|
5624
|
+
var import_path15 = __toESM(require("path"));
|
|
5438
5625
|
var import_common6 = require("../common");
|
|
5439
5626
|
|
|
5440
5627
|
// packages/playwright/src/isomorphic/folders.ts
|
|
@@ -5463,13 +5650,13 @@ var WorkerHost = class extends ProcessHost {
|
|
|
5463
5650
|
repeatEachIndex: testGroup.repeatEachIndex,
|
|
5464
5651
|
projectId: testGroup.projectId,
|
|
5465
5652
|
config: options.config,
|
|
5466
|
-
artifactsDir:
|
|
5653
|
+
artifactsDir: import_path15.default.join(options.outputDir, artifactsFolderName(workerIndex)),
|
|
5467
5654
|
pauseOnError: options.pauseOnError,
|
|
5468
5655
|
pauseAtEnd: options.pauseAtEnd
|
|
5469
5656
|
};
|
|
5470
5657
|
}
|
|
5471
5658
|
async start() {
|
|
5472
|
-
await
|
|
5659
|
+
await import_fs12.default.promises.mkdir(this._params.artifactsDir, { recursive: true });
|
|
5473
5660
|
return await this.startRunner(this._params, {
|
|
5474
5661
|
onStdOut: (chunk) => this.emit("stdOut", import_common6.ipc.stdioChunkToParams(chunk)),
|
|
5475
5662
|
onStdErr: (chunk) => this.emit("stdErr", import_common6.ipc.stdioChunkToParams(chunk))
|
|
@@ -5505,7 +5692,7 @@ var WorkerHost = class extends ProcessHost {
|
|
|
5505
5692
|
|
|
5506
5693
|
// packages/playwright/src/runner/dispatcher.ts
|
|
5507
5694
|
var import_common7 = require("../common");
|
|
5508
|
-
var
|
|
5695
|
+
var import_util13 = require("../util");
|
|
5509
5696
|
var colors4 = require("playwright-core/lib/utilsBundle").colors;
|
|
5510
5697
|
var { ManualPromise: ManualPromise3 } = require("playwright-core/lib/coreBundle").iso;
|
|
5511
5698
|
var { eventsHelper } = require("playwright-core/lib/coreBundle").utils;
|
|
@@ -5994,7 +6181,7 @@ var JobDispatcher = class {
|
|
|
5994
6181
|
addLocationAndSnippetToError(this._testRun.config.config, response.error);
|
|
5995
6182
|
return response;
|
|
5996
6183
|
} catch (e) {
|
|
5997
|
-
const error = (0,
|
|
6184
|
+
const error = (0, import_util13.serializeError)(e);
|
|
5998
6185
|
addLocationAndSnippetToError(this._testRun.config.config, error);
|
|
5999
6186
|
return { response: void 0, error };
|
|
6000
6187
|
}
|
|
@@ -6113,11 +6300,11 @@ var FixedNodeSIGINTHandler = class {
|
|
|
6113
6300
|
};
|
|
6114
6301
|
|
|
6115
6302
|
// packages/playwright/src/runner/taskRunner.ts
|
|
6116
|
-
var
|
|
6303
|
+
var import_util14 = require("../util");
|
|
6117
6304
|
var colors5 = require("playwright-core/lib/utilsBundle").colors;
|
|
6118
6305
|
var debug4 = require("playwright-core/lib/utilsBundle").debug;
|
|
6119
6306
|
var { ManualPromise: ManualPromise4 } = require("playwright-core/lib/coreBundle").iso;
|
|
6120
|
-
var { monotonicTime:
|
|
6307
|
+
var { monotonicTime: monotonicTime4 } = require("playwright-core/lib/coreBundle").iso;
|
|
6121
6308
|
var TaskRunner = class _TaskRunner {
|
|
6122
6309
|
constructor(reporter, globalTimeoutForError) {
|
|
6123
6310
|
this._tasks = [];
|
|
@@ -6154,7 +6341,7 @@ var TaskRunner = class _TaskRunner {
|
|
|
6154
6341
|
await task.setup?.(context, errors, softErrors);
|
|
6155
6342
|
} catch (e) {
|
|
6156
6343
|
debug4("pw:test:task")(`error in "${task.title}": `, e);
|
|
6157
|
-
errors.push((0,
|
|
6344
|
+
errors.push((0, import_util14.serializeError)(e));
|
|
6158
6345
|
} finally {
|
|
6159
6346
|
for (const error of [...softErrors, ...errors])
|
|
6160
6347
|
this._reporter.onError?.(error);
|
|
@@ -6196,7 +6383,7 @@ var TimeoutWatcher = class {
|
|
|
6196
6383
|
this.promise = new ManualPromise4();
|
|
6197
6384
|
if (!deadline)
|
|
6198
6385
|
return;
|
|
6199
|
-
if (deadline -
|
|
6386
|
+
if (deadline - monotonicTime4() <= 0) {
|
|
6200
6387
|
this._timedOut = true;
|
|
6201
6388
|
this.promise.resolve();
|
|
6202
6389
|
return;
|
|
@@ -6204,7 +6391,7 @@ var TimeoutWatcher = class {
|
|
|
6204
6391
|
this._timer = setTimeout(() => {
|
|
6205
6392
|
this._timedOut = true;
|
|
6206
6393
|
this.promise.resolve();
|
|
6207
|
-
}, deadline -
|
|
6394
|
+
}, deadline - monotonicTime4());
|
|
6208
6395
|
}
|
|
6209
6396
|
timedOut() {
|
|
6210
6397
|
return this._timedOut;
|
|
@@ -6216,7 +6403,7 @@ var TimeoutWatcher = class {
|
|
|
6216
6403
|
|
|
6217
6404
|
// packages/playwright/src/runner/vcs.ts
|
|
6218
6405
|
var import_child_process2 = __toESM(require("child_process"));
|
|
6219
|
-
var
|
|
6406
|
+
var import_path16 = __toESM(require("path"));
|
|
6220
6407
|
var import_common8 = require("../common");
|
|
6221
6408
|
async function detectChangedTestFiles(baseCommit, configDir) {
|
|
6222
6409
|
function gitFileList(args) {
|
|
@@ -6246,20 +6433,20 @@ async function detectChangedTestFiles(baseCommit, configDir) {
|
|
|
6246
6433
|
].join("\n"));
|
|
6247
6434
|
}
|
|
6248
6435
|
}
|
|
6249
|
-
const untrackedFiles = gitFileList(["ls-files", "--others", "--exclude-standard"]).map((file) =>
|
|
6436
|
+
const untrackedFiles = gitFileList(["ls-files", "--others", "--exclude-standard"]).map((file) => import_path16.default.join(configDir, file));
|
|
6250
6437
|
const [gitRoot] = gitFileList(["rev-parse", "--show-toplevel"]);
|
|
6251
|
-
const trackedFilesWithChanges = gitFileList(["diff", baseCommit, "--name-only"]).map((file) =>
|
|
6438
|
+
const trackedFilesWithChanges = gitFileList(["diff", baseCommit, "--name-only"]).map((file) => import_path16.default.join(gitRoot, file));
|
|
6252
6439
|
return new Set(import_common8.cc.affectedTestFiles([...untrackedFiles, ...trackedFilesWithChanges]));
|
|
6253
6440
|
}
|
|
6254
6441
|
|
|
6255
6442
|
// packages/playwright/src/runner/tasks.ts
|
|
6256
6443
|
var import_common9 = require("../common");
|
|
6257
|
-
var
|
|
6444
|
+
var import_util16 = require("../util");
|
|
6258
6445
|
var debug5 = require("playwright-core/lib/utilsBundle").debug;
|
|
6259
6446
|
var { ManualPromise: ManualPromise5 } = require("playwright-core/lib/coreBundle").iso;
|
|
6260
|
-
var { monotonicTime:
|
|
6447
|
+
var { monotonicTime: monotonicTime5 } = require("playwright-core/lib/coreBundle").iso;
|
|
6261
6448
|
var { removeFolders: removeFolders4 } = require("playwright-core/lib/coreBundle").utils;
|
|
6262
|
-
var readDirAsync2 = (0,
|
|
6449
|
+
var readDirAsync2 = (0, import_util15.promisify)(import_fs13.default.readdir);
|
|
6263
6450
|
var TestRun = class {
|
|
6264
6451
|
constructor(config2, reporter, options) {
|
|
6265
6452
|
this.rootSuite = void 0;
|
|
@@ -6275,7 +6462,8 @@ var TestRun = class {
|
|
|
6275
6462
|
this.config = config2;
|
|
6276
6463
|
this.options = options ?? {};
|
|
6277
6464
|
this.reporter = reporter;
|
|
6278
|
-
this.filteredProjects = filterProjects(config2.projects, this.options.projectFilter);
|
|
6465
|
+
this.filteredProjects = filterProjects(config2.projects, this.options.projectFilter, this.options.includeNonDefaultProjects);
|
|
6466
|
+
config2.config.filteredProjects = this.filteredProjects.map((p) => p.project);
|
|
6279
6467
|
}
|
|
6280
6468
|
onTestPaused(params) {
|
|
6281
6469
|
this.options.onTestPaused?.(params);
|
|
@@ -6291,7 +6479,7 @@ var TestRun = class {
|
|
|
6291
6479
|
}
|
|
6292
6480
|
};
|
|
6293
6481
|
async function runTasks(testRun, tasks, globalTimeout, cancelPromise) {
|
|
6294
|
-
const deadline = globalTimeout ?
|
|
6482
|
+
const deadline = globalTimeout ? monotonicTime5() + globalTimeout : 0;
|
|
6295
6483
|
const taskRunner = new TaskRunner(testRun.reporter, globalTimeout || 0);
|
|
6296
6484
|
for (const task of tasks)
|
|
6297
6485
|
taskRunner.addTask(task);
|
|
@@ -6337,7 +6525,7 @@ function createClearCacheTask(config2) {
|
|
|
6337
6525
|
return {
|
|
6338
6526
|
title: "clear cache",
|
|
6339
6527
|
setup: async () => {
|
|
6340
|
-
await (0,
|
|
6528
|
+
await (0, import_util16.removeDirAndLogToConsole)(import_common9.cc.cacheDir);
|
|
6341
6529
|
}
|
|
6342
6530
|
};
|
|
6343
6531
|
}
|
|
@@ -6408,7 +6596,7 @@ function createRemoveOutputDirsTask() {
|
|
|
6408
6596
|
return;
|
|
6409
6597
|
if (error.code === "EBUSY") {
|
|
6410
6598
|
const entries = await readDirAsync2(outputDir).catch((e) => []);
|
|
6411
|
-
await Promise.all(entries.map((entry) => removeFolders4([
|
|
6599
|
+
await Promise.all(entries.map((entry) => removeFolders4([import_path17.default.join(outputDir, entry)])));
|
|
6412
6600
|
} else {
|
|
6413
6601
|
throw error;
|
|
6414
6602
|
}
|
|
@@ -6427,7 +6615,7 @@ function createListFilesTask() {
|
|
|
6427
6615
|
projectSuite._fullProject = project;
|
|
6428
6616
|
testRun.rootSuite._addSuite(projectSuite);
|
|
6429
6617
|
const suites = files.map((file) => {
|
|
6430
|
-
const title =
|
|
6618
|
+
const title = import_path17.default.relative(testRun.config.config.rootDir, file);
|
|
6431
6619
|
const suite = new import_common9.test.Suite(title, "file");
|
|
6432
6620
|
suite.location = { file, line: 0, column: 0 };
|
|
6433
6621
|
projectSuite._addSuite(suite);
|
|
@@ -6457,8 +6645,8 @@ function createLoadTask(mode, options) {
|
|
|
6457
6645
|
testRun.preOnlyTestFilters.push((test) => !testFilter(test));
|
|
6458
6646
|
}
|
|
6459
6647
|
if (testRun.options.grep || testRun.options.grepInvert) {
|
|
6460
|
-
const grepMatcher = testRun.options.grep ? (0,
|
|
6461
|
-
const grepInvertMatcher = testRun.options.grepInvert ? (0,
|
|
6648
|
+
const grepMatcher = testRun.options.grep ? (0, import_util16.createTitleMatcher)((0, import_util16.forceRegExp)(testRun.options.grep)) : () => true;
|
|
6649
|
+
const grepInvertMatcher = testRun.options.grepInvert ? (0, import_util16.createTitleMatcher)((0, import_util16.forceRegExp)(testRun.options.grepInvert)) : () => false;
|
|
6462
6650
|
testRun.preOnlyTestFilters.push((test) => {
|
|
6463
6651
|
const grepTitle = test._grepTitleWithTags();
|
|
6464
6652
|
return !grepInvertMatcher(grepTitle) && grepMatcher(grepTitle);
|
|
@@ -6545,6 +6733,8 @@ function createPhasesTask() {
|
|
|
6545
6733
|
}
|
|
6546
6734
|
}
|
|
6547
6735
|
testRun.config.config.metadata.actualWorkers = Math.min(testRun.config.config.workers, maxConcurrentTestGroups);
|
|
6736
|
+
if (testRun.config.configCLIOverrides.shuffle)
|
|
6737
|
+
testRun.config.config.metadata.shuffleSeed = testRun.config.configCLIOverrides.shuffle;
|
|
6548
6738
|
}
|
|
6549
6739
|
};
|
|
6550
6740
|
}
|
|
@@ -6568,6 +6758,8 @@ function createRunTestsTask() {
|
|
|
6568
6758
|
if (!hasFailedDeps)
|
|
6569
6759
|
phaseTestGroups.push(...testGroups);
|
|
6570
6760
|
}
|
|
6761
|
+
if (testRun.config.configCLIOverrides.shuffle)
|
|
6762
|
+
shuffleTestGroups(phaseTestGroups, testRun.config.configCLIOverrides.shuffle);
|
|
6571
6763
|
if (phaseTestGroups.length) {
|
|
6572
6764
|
await dispatcher.run(phaseTestGroups, extraEnvByProjectId);
|
|
6573
6765
|
await dispatcher.stop();
|
|
@@ -6593,8 +6785,8 @@ function createRunTestsTask() {
|
|
|
6593
6785
|
}
|
|
6594
6786
|
|
|
6595
6787
|
// packages/playwright/src/runner/lastRun.ts
|
|
6596
|
-
var
|
|
6597
|
-
var
|
|
6788
|
+
var import_fs14 = __toESM(require("fs"));
|
|
6789
|
+
var import_path18 = __toESM(require("path"));
|
|
6598
6790
|
function didNotRun(test) {
|
|
6599
6791
|
if (test.outcome() !== "skipped")
|
|
6600
6792
|
return false;
|
|
@@ -6607,18 +6799,18 @@ var LastRunReporter = class {
|
|
|
6607
6799
|
this._listMode = !!listMode;
|
|
6608
6800
|
const override = lastFailedFileOverride ?? process.env.PLAYWRIGHT_LAST_RUN_OUTPUT_FILE;
|
|
6609
6801
|
if (override) {
|
|
6610
|
-
this._lastRunFile =
|
|
6802
|
+
this._lastRunFile = import_path18.default.resolve(process.cwd(), override);
|
|
6611
6803
|
} else {
|
|
6612
6804
|
const [project] = filteredProjects;
|
|
6613
6805
|
if (project)
|
|
6614
|
-
this._lastRunFile =
|
|
6806
|
+
this._lastRunFile = import_path18.default.join(project.project.outputDir, ".last-run.json");
|
|
6615
6807
|
}
|
|
6616
6808
|
}
|
|
6617
6809
|
async filterLastFailed() {
|
|
6618
6810
|
if (!this._lastRunFile)
|
|
6619
6811
|
return void 0;
|
|
6620
6812
|
try {
|
|
6621
|
-
const lastRunInfo = JSON.parse(await
|
|
6813
|
+
const lastRunInfo = JSON.parse(await import_fs14.default.promises.readFile(this._lastRunFile, "utf8"));
|
|
6622
6814
|
return lastRunInfo.failedTests;
|
|
6623
6815
|
} catch {
|
|
6624
6816
|
return void 0;
|
|
@@ -6640,8 +6832,8 @@ var LastRunReporter = class {
|
|
|
6640
6832
|
status: result.status,
|
|
6641
6833
|
failedTests: this._suite?.allTests().filter((t2) => !t2.ok() || didNotRun(t2)).map((t2) => t2.id) || []
|
|
6642
6834
|
};
|
|
6643
|
-
await
|
|
6644
|
-
await
|
|
6835
|
+
await import_fs14.default.promises.mkdir(import_path18.default.dirname(this._lastRunFile), { recursive: true });
|
|
6836
|
+
await import_fs14.default.promises.writeFile(this._lastRunFile, JSON.stringify(lastRunInfo, void 0, 2));
|
|
6645
6837
|
}
|
|
6646
6838
|
};
|
|
6647
6839
|
|
|
@@ -6653,7 +6845,7 @@ var TestRunnerEvent = {
|
|
|
6653
6845
|
TestFilesChanged: "testFilesChanged",
|
|
6654
6846
|
TestPaused: "testPaused"
|
|
6655
6847
|
};
|
|
6656
|
-
var TestRunner = class extends
|
|
6848
|
+
var TestRunner = class extends import_events3.default {
|
|
6657
6849
|
constructor(configLocation, configCLIOverrides) {
|
|
6658
6850
|
super();
|
|
6659
6851
|
this._watchedProjectDirs = /* @__PURE__ */ new Set();
|
|
@@ -6742,7 +6934,7 @@ var TestRunner = class extends import_events2.default {
|
|
|
6742
6934
|
const config2 = await this._loadConfigOrReportError(reporter);
|
|
6743
6935
|
if (!config2)
|
|
6744
6936
|
return { status: "failed" };
|
|
6745
|
-
const options = { projectFilter: projects?.length ? projects : void 0 };
|
|
6937
|
+
const options = { projectFilter: projects?.length ? projects : void 0, includeNonDefaultProjects: true };
|
|
6746
6938
|
const status = await runTasks(new TestRun(config2, reporter, options), [
|
|
6747
6939
|
createListFilesTask(),
|
|
6748
6940
|
createReportBeginTask()
|
|
@@ -6775,6 +6967,8 @@ var TestRunner = class extends import_events2.default {
|
|
|
6775
6967
|
grep: params.grep,
|
|
6776
6968
|
grepInvert: params.grepInvert,
|
|
6777
6969
|
projectFilter: params.projects?.length ? params.projects : void 0,
|
|
6970
|
+
// Non-default projects are listed so that they can be selected by name.
|
|
6971
|
+
includeNonDefaultProjects: true,
|
|
6778
6972
|
onlyChanged: params.onlyChanged ? "HEAD" : void 0,
|
|
6779
6973
|
listMode: true
|
|
6780
6974
|
};
|
|
@@ -6910,7 +7104,7 @@ var TestRunner = class extends import_events2.default {
|
|
|
6910
7104
|
this._lastLoadedConfig = config2;
|
|
6911
7105
|
return { config: config2 };
|
|
6912
7106
|
} catch (e) {
|
|
6913
|
-
return { config: null, error: (0,
|
|
7107
|
+
return { config: null, error: (0, import_util17.serializeError)(e) };
|
|
6914
7108
|
}
|
|
6915
7109
|
}
|
|
6916
7110
|
lastLoadedConfig() {
|
|
@@ -6966,7 +7160,7 @@ __export(testServer_exports, {
|
|
|
6966
7160
|
runTestServer: () => runTestServer,
|
|
6967
7161
|
runUIMode: () => runUIMode
|
|
6968
7162
|
});
|
|
6969
|
-
var
|
|
7163
|
+
var import_util18 = __toESM(require("util"));
|
|
6970
7164
|
var import_coreBundle4 = require("playwright-core/lib/coreBundle");
|
|
6971
7165
|
var import_common11 = require("../common");
|
|
6972
7166
|
|
|
@@ -7126,7 +7320,7 @@ var TestServerDispatcher = class {
|
|
|
7126
7320
|
if (interceptStdio) {
|
|
7127
7321
|
if (debug6.log === originalDebugLog) {
|
|
7128
7322
|
debug6.log = (...args) => {
|
|
7129
|
-
const string =
|
|
7323
|
+
const string = import_util18.default.format(...args) + "\n";
|
|
7130
7324
|
return originalStderrWrite.apply(process.stderr, [string]);
|
|
7131
7325
|
};
|
|
7132
7326
|
}
|
|
@@ -7219,9 +7413,9 @@ var watchMode_exports = {};
|
|
|
7219
7413
|
__export(watchMode_exports, {
|
|
7220
7414
|
runWatchModeLoop: () => runWatchModeLoop
|
|
7221
7415
|
});
|
|
7222
|
-
var
|
|
7416
|
+
var import_path19 = __toESM(require("path"));
|
|
7223
7417
|
var import_readline = __toESM(require("readline"));
|
|
7224
|
-
var
|
|
7418
|
+
var import_events4 = require("events");
|
|
7225
7419
|
var import_coreBundle5 = require("playwright-core/lib/coreBundle");
|
|
7226
7420
|
|
|
7227
7421
|
// packages/playwright/src/isomorphic/testTree.ts
|
|
@@ -7568,7 +7762,7 @@ var { ManualPromise: ManualPromise8 } = require("playwright-core/lib/coreBundle"
|
|
|
7568
7762
|
var { createGuid: createGuid3 } = require("playwright-core/lib/coreBundle").utils;
|
|
7569
7763
|
var { getPackageManagerExecCommand: getPackageManagerExecCommand3 } = require("playwright-core/lib/coreBundle").utils;
|
|
7570
7764
|
var { eventsHelper: eventsHelper2 } = require("playwright-core/lib/coreBundle").utils;
|
|
7571
|
-
var InMemoryTransport = class extends
|
|
7765
|
+
var InMemoryTransport = class extends import_events4.EventEmitter {
|
|
7572
7766
|
constructor(send) {
|
|
7573
7767
|
super();
|
|
7574
7768
|
this._send = send;
|
|
@@ -7611,7 +7805,7 @@ async function runWatchModeLoop(configLocation, initialOptions) {
|
|
|
7611
7805
|
};
|
|
7612
7806
|
const testServerConnection = new TestServerConnection(transport);
|
|
7613
7807
|
transport.emit("open");
|
|
7614
|
-
const teleSuiteUpdater = new TeleSuiteUpdater({ pathSeparator:
|
|
7808
|
+
const teleSuiteUpdater = new TeleSuiteUpdater({ pathSeparator: import_path19.default.sep, onUpdate() {
|
|
7615
7809
|
} });
|
|
7616
7810
|
const dirtyTestFiles = /* @__PURE__ */ new Set();
|
|
7617
7811
|
const dirtyTestIds = /* @__PURE__ */ new Set();
|
|
@@ -7887,7 +8081,7 @@ function printBufferPrompt(dirtyTestFiles, rootDir) {
|
|
|
7887
8081
|
|
|
7888
8082
|
`);
|
|
7889
8083
|
for (const file of dirtyTestFiles)
|
|
7890
|
-
process.stdout.write(` \xB7 ${
|
|
8084
|
+
process.stdout.write(` \xB7 ${import_path19.default.relative(rootDir, file)}
|
|
7891
8085
|
`);
|
|
7892
8086
|
process.stdout.write(`
|
|
7893
8087
|
${colors6.dim(`Press`)} ${colors6.bold("enter")} ${colors6.dim("to run")}, ${colors6.bold("q")} ${colors6.dim("to quit or")} ${colors6.bold("h")} ${colors6.dim("for more options.")}
|
|
@@ -7921,8 +8115,8 @@ var merge_exports = {};
|
|
|
7921
8115
|
__export(merge_exports, {
|
|
7922
8116
|
createMergedReport: () => createMergedReport
|
|
7923
8117
|
});
|
|
7924
|
-
var
|
|
7925
|
-
var
|
|
8118
|
+
var import_fs15 = __toESM(require("fs"));
|
|
8119
|
+
var import_path20 = __toESM(require("path"));
|
|
7926
8120
|
|
|
7927
8121
|
// packages/playwright/src/isomorphic/stringInternPool.ts
|
|
7928
8122
|
var StringInternPool = class {
|
|
@@ -7967,9 +8161,9 @@ var JsonStringInternalizer = class {
|
|
|
7967
8161
|
};
|
|
7968
8162
|
|
|
7969
8163
|
// packages/playwright/src/reporters/merge.ts
|
|
7970
|
-
var
|
|
8164
|
+
var import_util19 = require("../util");
|
|
7971
8165
|
var { isPathInside } = require("playwright-core/lib/coreBundle").utils;
|
|
7972
|
-
var { ZipFile } = require("playwright-core/lib/coreBundle").utils;
|
|
8166
|
+
var { ZipFile: ZipFile2 } = require("playwright-core/lib/coreBundle").utils;
|
|
7973
8167
|
async function createMergedReport(config2, dir, reporterDescriptions, rootDirOverride) {
|
|
7974
8168
|
const reporters = await createReporters(config2, "merge", reporterDescriptions);
|
|
7975
8169
|
const multiplexer = new Multiplexer(reporters);
|
|
@@ -7984,8 +8178,8 @@ async function createMergedReport(config2, dir, reporterDescriptions, rootDirOve
|
|
|
7984
8178
|
if (shardFiles.length === 0)
|
|
7985
8179
|
throw new Error(`No report files found in ${dir}`);
|
|
7986
8180
|
const eventData = await mergeEvents(dir, shardFiles, stringPool, printStatus, rootDirOverride);
|
|
7987
|
-
const pathSeparator = rootDirOverride ?
|
|
7988
|
-
const pathPackage = pathSeparator === "/" ?
|
|
8181
|
+
const pathSeparator = rootDirOverride ? import_path20.default.sep : eventData.pathSeparatorFromMetadata ?? import_path20.default.sep;
|
|
8182
|
+
const pathPackage = pathSeparator === "/" ? import_path20.default.posix : import_path20.default.win32;
|
|
7989
8183
|
const receiver = new TeleReporterReceiver(multiplexer, {
|
|
7990
8184
|
mergeProjects: false,
|
|
7991
8185
|
mergeTestCases: false,
|
|
@@ -8013,7 +8207,7 @@ async function createMergedReport(config2, dir, reporterDescriptions, rootDirOve
|
|
|
8013
8207
|
reportPath: zipFile,
|
|
8014
8208
|
config: asFullConfig(config3)
|
|
8015
8209
|
});
|
|
8016
|
-
const reportJsonl = await
|
|
8210
|
+
const reportJsonl = await import_fs15.default.promises.readFile(reportFile);
|
|
8017
8211
|
const events = parseTestEvents(reportJsonl);
|
|
8018
8212
|
new JsonStringInternalizer(stringPool).traverse(events);
|
|
8019
8213
|
eventPatchers.patchers.push(new AttachmentPathPatcher(dir));
|
|
@@ -8059,15 +8253,15 @@ function splitBufferLines(buffer) {
|
|
|
8059
8253
|
}
|
|
8060
8254
|
async function extractAndParseReports(dir, shardFiles, internalizer, printStatus) {
|
|
8061
8255
|
const shardEvents = [];
|
|
8062
|
-
await
|
|
8256
|
+
await import_fs15.default.promises.mkdir(import_path20.default.join(dir, "resources"), { recursive: true });
|
|
8063
8257
|
const reportNames = new UniqueFileNameGenerator();
|
|
8064
8258
|
for (const file of shardFiles) {
|
|
8065
|
-
const absolutePath =
|
|
8066
|
-
printStatus(`extracting: ${(0,
|
|
8067
|
-
const zipFile = new
|
|
8259
|
+
const absolutePath = import_path20.default.join(dir, file);
|
|
8260
|
+
printStatus(`extracting: ${(0, import_util19.relativeFilePath)(absolutePath)}`);
|
|
8261
|
+
const zipFile = new ZipFile2(absolutePath);
|
|
8068
8262
|
const entryNames = await zipFile.entries();
|
|
8069
8263
|
for (const entryName of entryNames.sort()) {
|
|
8070
|
-
let reportFile =
|
|
8264
|
+
let reportFile = import_path20.default.join(dir, entryName);
|
|
8071
8265
|
const content = await zipFile.read(entryName);
|
|
8072
8266
|
if (entryName.endsWith(".jsonl")) {
|
|
8073
8267
|
reportFile = reportNames.makeUnique(reportFile);
|
|
@@ -8082,7 +8276,7 @@ async function extractAndParseReports(dir, shardFiles, internalizer, printStatus
|
|
|
8082
8276
|
parsedEvents
|
|
8083
8277
|
});
|
|
8084
8278
|
}
|
|
8085
|
-
await
|
|
8279
|
+
await import_fs15.default.promises.writeFile(reportFile, content);
|
|
8086
8280
|
}
|
|
8087
8281
|
zipFile.close();
|
|
8088
8282
|
}
|
|
@@ -8249,7 +8443,7 @@ function mergeEndEvents(endEvents) {
|
|
|
8249
8443
|
};
|
|
8250
8444
|
}
|
|
8251
8445
|
async function sortedShardFiles(dir) {
|
|
8252
|
-
const files = await
|
|
8446
|
+
const files = await import_fs15.default.promises.readdir(dir);
|
|
8253
8447
|
return files.filter((file) => file.endsWith(".zip")).sort();
|
|
8254
8448
|
}
|
|
8255
8449
|
function printStatusToStdout(message) {
|
|
@@ -8265,7 +8459,7 @@ var UniqueFileNameGenerator = class {
|
|
|
8265
8459
|
this._usedNames.add(name);
|
|
8266
8460
|
return name;
|
|
8267
8461
|
}
|
|
8268
|
-
const extension =
|
|
8462
|
+
const extension = import_path20.default.extname(name);
|
|
8269
8463
|
name = name.substring(0, name.length - extension.length);
|
|
8270
8464
|
let index = 0;
|
|
8271
8465
|
while (true) {
|
|
@@ -8348,11 +8542,11 @@ var AttachmentPathPatcher = class {
|
|
|
8348
8542
|
this._patchAttachments(event.params.result.attachments ?? []);
|
|
8349
8543
|
}
|
|
8350
8544
|
_patchAttachments(attachments) {
|
|
8351
|
-
const resourceRoot =
|
|
8545
|
+
const resourceRoot = import_path20.default.resolve(this._resourceDir);
|
|
8352
8546
|
for (const attachment of attachments) {
|
|
8353
8547
|
if (!attachment.path)
|
|
8354
8548
|
continue;
|
|
8355
|
-
const joined =
|
|
8549
|
+
const joined = import_path20.default.resolve(resourceRoot, attachment.path);
|
|
8356
8550
|
if (!isPathInside(resourceRoot, joined)) {
|
|
8357
8551
|
attachment.path = void 0;
|
|
8358
8552
|
continue;
|
|
@@ -8363,8 +8557,8 @@ var AttachmentPathPatcher = class {
|
|
|
8363
8557
|
};
|
|
8364
8558
|
var PathSeparatorPatcher = class {
|
|
8365
8559
|
constructor(from) {
|
|
8366
|
-
this._from = from ?? (
|
|
8367
|
-
this._to =
|
|
8560
|
+
this._from = from ?? (import_path20.default.sep === "/" ? "\\" : "/");
|
|
8561
|
+
this._to = import_path20.default.sep;
|
|
8368
8562
|
}
|
|
8369
8563
|
patchEvent(jsonEvent) {
|
|
8370
8564
|
if (this._from === this._to)
|