aws-runtime-bridge 1.9.103 → 1.9.104
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/node_modules/playwright/LICENSE +202 -0
- package/node_modules/playwright/NOTICE +5 -0
- package/node_modules/playwright/README.md +318 -0
- package/node_modules/playwright/ThirdPartyNotices.txt +14 -0
- package/node_modules/playwright/cli.js +19 -0
- package/node_modules/playwright/index.d.ts +17 -0
- package/node_modules/playwright/index.js +17 -0
- package/node_modules/playwright/index.mjs +18 -0
- package/node_modules/playwright/jsx-runtime.js +42 -0
- package/node_modules/playwright/jsx-runtime.mjs +21 -0
- package/node_modules/playwright/lib/agents/agentParser.js +89 -0
- package/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- package/node_modules/playwright/lib/agents/generateAgents.js +395 -0
- package/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- package/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
- package/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
- package/node_modules/playwright/lib/cli/reportActions.js +78 -0
- package/node_modules/playwright/lib/cli/testActions.js +213 -0
- package/node_modules/playwright/lib/common/index.js +2957 -0
- package/node_modules/playwright/lib/common/index.js.txt +34 -0
- package/node_modules/playwright/lib/errorContext.js +129 -0
- package/node_modules/playwright/lib/globals.js +58 -0
- package/node_modules/playwright/lib/index.js +806 -0
- package/node_modules/playwright/lib/isomorphic.js +260 -0
- package/node_modules/playwright/lib/isomorphic.js.txt +9 -0
- package/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
- package/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
- package/node_modules/playwright/lib/matchers/expect.js +13486 -0
- package/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
- package/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
- package/node_modules/playwright/lib/mcp/test/browserBackend.js +125 -0
- package/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- package/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
- package/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- package/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- package/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- package/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
- package/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- package/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
- package/node_modules/playwright/lib/package.js +47 -0
- package/node_modules/playwright/lib/program.js +242 -0
- package/node_modules/playwright/lib/runner/index.js +8241 -0
- package/node_modules/playwright/lib/runner/index.js.txt +60 -0
- package/node_modules/playwright/lib/transform/babelBundle.js +72275 -0
- package/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
- package/node_modules/playwright/lib/transform/babelBundle.js.txt +325 -0
- package/node_modules/playwright/lib/transform/esmLoader.js +8078 -0
- package/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
- package/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
- package/node_modules/playwright/lib/util.js +373 -0
- package/node_modules/playwright/lib/worker/workerProcessEntry.js +1850 -0
- package/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
- package/node_modules/playwright/package.json +58 -0
- package/node_modules/playwright/test.d.ts +18 -0
- package/node_modules/playwright/test.js +24 -0
- package/node_modules/playwright/test.mjs +35 -0
- package/node_modules/playwright/types/test.d.ts +10848 -0
- package/node_modules/playwright/types/testReporter.d.ts +899 -0
- package/node_modules/playwright-core/LICENSE +202 -0
- package/node_modules/playwright-core/NOTICE +5 -0
- package/node_modules/playwright-core/README.md +3 -0
- package/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
- package/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/browsers.json +75 -0
- package/node_modules/playwright-core/cli.js +21 -0
- package/node_modules/playwright-core/index.d.ts +17 -0
- package/node_modules/playwright-core/index.js +17 -0
- package/node_modules/playwright-core/index.mjs +28 -0
- package/node_modules/playwright-core/lib/bootstrap.js +88 -0
- package/node_modules/playwright-core/lib/coreBundle.js +74830 -0
- package/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
- package/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
- package/node_modules/playwright-core/lib/entry/mcp.js +10 -0
- package/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
- package/node_modules/playwright-core/lib/package.js +50 -0
- package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/node_modules/playwright-core/lib/server/electron/loader.js +118 -0
- package/node_modules/playwright-core/lib/serverRegistry.js +7347 -0
- package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +354 -0
- package/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
- package/node_modules/playwright-core/lib/tools/cli-client/cli.js +6 -0
- package/node_modules/playwright-core/lib/tools/cli-client/help.json +708 -0
- package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
- package/node_modules/playwright-core/lib/tools/cli-client/output.js +343 -0
- package/node_modules/playwright-core/lib/tools/cli-client/program.js +404 -0
- package/node_modules/playwright-core/lib/tools/cli-client/registry.js +176 -0
- package/node_modules/playwright-core/lib/tools/cli-client/session.js +258 -0
- package/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +420 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +241 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +225 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +143 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +143 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +85 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +67 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +75 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +171 -0
- package/node_modules/playwright-core/lib/tools/utils/extension.js +101 -0
- package/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
- package/node_modules/playwright-core/lib/utilsBundle.js +90764 -0
- package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +2179 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +11 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
- package/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/report.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-CwYYHbcZ.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-DYjdXIbE.js +129 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-By56iMx7.js +32 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-B34OrIms.js +181 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-COQkjINf.js +7 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.Dl36UVQT.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.C7UW1sC9.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.D962mr9b.js +5 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
- package/node_modules/playwright-core/lib/webp_codec.LICENSE +173 -0
- package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
- package/node_modules/playwright-core/lib/xdg-open +1267 -0
- package/node_modules/playwright-core/package.json +34 -0
- package/node_modules/playwright-core/types/protocol.d.ts +24842 -0
- package/node_modules/playwright-core/types/structs.d.ts +47 -0
- package/node_modules/playwright-core/types/types.d.ts +26188 -0
- package/package.json +3 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playwright-test-healer
|
|
3
|
+
description: Use this agent when you need to debug and fix failing Playwright tests
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: red
|
|
6
|
+
tools:
|
|
7
|
+
- search
|
|
8
|
+
- edit
|
|
9
|
+
- playwright-test/browser_console_messages
|
|
10
|
+
- playwright-test/browser_evaluate
|
|
11
|
+
- playwright-test/browser_generate_locator
|
|
12
|
+
- playwright-test/browser_network_request
|
|
13
|
+
- playwright-test/browser_network_requests
|
|
14
|
+
- playwright-test/browser_snapshot
|
|
15
|
+
- playwright-test/test_debug
|
|
16
|
+
- playwright-test/test_list
|
|
17
|
+
- playwright-test/test_run
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and
|
|
21
|
+
resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix
|
|
22
|
+
broken Playwright tests using a methodical approach.
|
|
23
|
+
|
|
24
|
+
Your workflow:
|
|
25
|
+
1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests
|
|
26
|
+
2. **Debug failed tests**: For each failing test run `test_debug`.
|
|
27
|
+
3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
|
|
28
|
+
- Examine the error details
|
|
29
|
+
- Capture page snapshot to understand the context
|
|
30
|
+
- Analyze selectors, timing issues, or assertion failures
|
|
31
|
+
4. **Root Cause Analysis**: Determine the underlying cause of the failure by examining:
|
|
32
|
+
- Element selectors that may have changed
|
|
33
|
+
- Timing and synchronization issues
|
|
34
|
+
- Data dependencies or test environment problems
|
|
35
|
+
- Application changes that broke test assumptions
|
|
36
|
+
5. **Code Remediation**: Edit the test code to address identified issues, focusing on:
|
|
37
|
+
- Updating selectors to match current application state
|
|
38
|
+
- Fixing assertions and expected values
|
|
39
|
+
- Improving test reliability and maintainability
|
|
40
|
+
- For inherently dynamic data, utilize regular expressions to produce resilient locators
|
|
41
|
+
6. **Verification**: Restart the test after each fix to validate the changes
|
|
42
|
+
7. **Iteration**: Repeat the investigation and fixing process until the test passes cleanly
|
|
43
|
+
|
|
44
|
+
Key principles:
|
|
45
|
+
- Be systematic and thorough in your debugging approach
|
|
46
|
+
- Document your findings and reasoning for each fix
|
|
47
|
+
- Prefer robust, maintainable solutions over quick hacks
|
|
48
|
+
- Use Playwright best practices for reliable test automation
|
|
49
|
+
- If multiple errors exist, fix them one at a time and retest
|
|
50
|
+
- Provide clear explanations of what was broken and how you fixed it
|
|
51
|
+
- You will continue this process until the test runs successfully without any failures or errors.
|
|
52
|
+
- If the error persists and you have high level of confidence that the test is correct, mark this test as test.fixme()
|
|
53
|
+
so that it is skipped during the execution. Add a comment before the failing step explaining what is happening instead
|
|
54
|
+
of the expected behavior.
|
|
55
|
+
- Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
|
|
56
|
+
- Never wait for networkidle or use other discouraged or deprecated apis
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playwright-test-planner
|
|
3
|
+
description: Use this agent when you need to create comprehensive test plan for a web application or website
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: green
|
|
6
|
+
tools:
|
|
7
|
+
- search
|
|
8
|
+
- playwright-test/browser_click
|
|
9
|
+
- playwright-test/browser_close
|
|
10
|
+
- playwright-test/browser_console_messages
|
|
11
|
+
- playwright-test/browser_drag
|
|
12
|
+
- playwright-test/browser_evaluate
|
|
13
|
+
- playwright-test/browser_file_upload
|
|
14
|
+
- playwright-test/browser_handle_dialog
|
|
15
|
+
- playwright-test/browser_hover
|
|
16
|
+
- playwright-test/browser_navigate
|
|
17
|
+
- playwright-test/browser_navigate_back
|
|
18
|
+
- playwright-test/browser_network_request
|
|
19
|
+
- playwright-test/browser_network_requests
|
|
20
|
+
- playwright-test/browser_press_key
|
|
21
|
+
- playwright-test/browser_run_code_unsafe
|
|
22
|
+
- playwright-test/browser_select_option
|
|
23
|
+
- playwright-test/browser_snapshot
|
|
24
|
+
- playwright-test/browser_take_screenshot
|
|
25
|
+
- playwright-test/browser_type
|
|
26
|
+
- playwright-test/browser_wait_for
|
|
27
|
+
- playwright-test/planner_setup_page
|
|
28
|
+
- playwright-test/planner_save_plan
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
|
|
32
|
+
scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
|
|
33
|
+
planning.
|
|
34
|
+
|
|
35
|
+
You will:
|
|
36
|
+
|
|
37
|
+
1. **Navigate and Explore**
|
|
38
|
+
- Invoke the `planner_setup_page` tool once to set up page before using any other tools
|
|
39
|
+
- Explore the browser snapshot
|
|
40
|
+
- Do not take screenshots unless absolutely necessary
|
|
41
|
+
- Use `browser_*` tools to navigate and discover interface
|
|
42
|
+
- Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
|
|
43
|
+
|
|
44
|
+
2. **Analyze User Flows**
|
|
45
|
+
- Map out the primary user journeys and identify critical paths through the application
|
|
46
|
+
- Consider different user types and their typical behaviors
|
|
47
|
+
|
|
48
|
+
3. **Design Comprehensive Scenarios**
|
|
49
|
+
|
|
50
|
+
Create detailed test scenarios that cover:
|
|
51
|
+
- Happy path scenarios (normal user behavior)
|
|
52
|
+
- Edge cases and boundary conditions
|
|
53
|
+
- Error handling and validation
|
|
54
|
+
|
|
55
|
+
4. **Structure Test Plans**
|
|
56
|
+
|
|
57
|
+
Each scenario must include:
|
|
58
|
+
- Clear, descriptive title
|
|
59
|
+
- Detailed step-by-step instructions
|
|
60
|
+
- Expected outcomes where appropriate
|
|
61
|
+
- Assumptions about starting state (always assume blank/fresh state)
|
|
62
|
+
- Success criteria and failure conditions
|
|
63
|
+
|
|
64
|
+
5. **Create Documentation**
|
|
65
|
+
|
|
66
|
+
Submit your test plan using `planner_save_plan` tool.
|
|
67
|
+
|
|
68
|
+
**Quality Standards**:
|
|
69
|
+
- Write steps that are specific enough for any tester to follow
|
|
70
|
+
- Include negative testing scenarios
|
|
71
|
+
- Ensure scenarios are independent and can be run in any order
|
|
72
|
+
|
|
73
|
+
**Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
|
|
74
|
+
professional formatting suitable for sharing with development and QA teams.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var reportActions_exports = {};
|
|
30
|
+
__export(reportActions_exports, {
|
|
31
|
+
mergeReports: () => mergeReports,
|
|
32
|
+
showReport: () => showReport
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(reportActions_exports);
|
|
35
|
+
var import_fs = __toESM(require("fs"));
|
|
36
|
+
var import_path = __toESM(require("path"));
|
|
37
|
+
var import_common = require("../common");
|
|
38
|
+
var import_runner = require("../runner");
|
|
39
|
+
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
|
|
40
|
+
async function showReport(report, host, port) {
|
|
41
|
+
await import_runner.html.showHTMLReport(report, host, port);
|
|
42
|
+
}
|
|
43
|
+
async function mergeReports(reportDir, opts) {
|
|
44
|
+
const configFile = opts.config;
|
|
45
|
+
const config = configFile ? await import_common.configLoader.loadConfigFromFile(configFile) : await import_common.configLoader.loadEmptyConfigForMergeReports();
|
|
46
|
+
const dir = import_path.default.resolve(process.cwd(), reportDir || "");
|
|
47
|
+
const dirStat = await import_fs.default.promises.stat(dir).catch((e) => null);
|
|
48
|
+
if (!dirStat)
|
|
49
|
+
throw new Error("Directory does not exist: " + dir);
|
|
50
|
+
if (!dirStat.isDirectory())
|
|
51
|
+
throw new Error(`"${dir}" is not a directory`);
|
|
52
|
+
let reporterDescriptions = resolveReporterOption(opts.reporter);
|
|
53
|
+
if (!reporterDescriptions && configFile)
|
|
54
|
+
reporterDescriptions = config.config.reporter;
|
|
55
|
+
if (!reporterDescriptions)
|
|
56
|
+
reporterDescriptions = [[import_common.config.defaultReporter]];
|
|
57
|
+
const rootDirOverride = configFile ? config.config.rootDir : void 0;
|
|
58
|
+
const result = await import_runner.merge.createMergedReport(config, dir, reporterDescriptions, rootDirOverride);
|
|
59
|
+
gracefullyProcessExitDoNotHang(result === "failed" ? 1 : 0);
|
|
60
|
+
}
|
|
61
|
+
function resolveReporterOption(reporter) {
|
|
62
|
+
if (!reporter || !reporter.length)
|
|
63
|
+
return void 0;
|
|
64
|
+
return reporter.split(",").map((r) => [resolveReporter(r)]);
|
|
65
|
+
}
|
|
66
|
+
function resolveReporter(id) {
|
|
67
|
+
if (import_common.builtInReporters.includes(id))
|
|
68
|
+
return id;
|
|
69
|
+
const localPath = import_path.default.resolve(process.cwd(), id);
|
|
70
|
+
if (import_fs.default.existsSync(localPath))
|
|
71
|
+
return localPath;
|
|
72
|
+
return require.resolve(id, { paths: [process.cwd()] });
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
mergeReports,
|
|
77
|
+
showReport
|
|
78
|
+
});
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var testActions_exports = {};
|
|
30
|
+
__export(testActions_exports, {
|
|
31
|
+
clearCache: () => clearCache,
|
|
32
|
+
runTestServerAction: () => runTestServerAction,
|
|
33
|
+
runTests: () => runTests
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(testActions_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_path = __toESM(require("path"));
|
|
38
|
+
var import_common = require("../common");
|
|
39
|
+
var import_runner = require("../runner");
|
|
40
|
+
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
|
|
41
|
+
const { startProfiling, stopProfiling } = require("playwright-core/lib/coreBundle").utils;
|
|
42
|
+
async function runTests(args, opts) {
|
|
43
|
+
await startProfiling();
|
|
44
|
+
const cliOverrides = overridesFromOptions(opts);
|
|
45
|
+
cliOverrides.argv = process.argv;
|
|
46
|
+
const config = await import_common.configLoader.loadConfigFromFile(opts.config, cliOverrides, opts.deps === false);
|
|
47
|
+
const options = {
|
|
48
|
+
locations: args.length ? args : void 0,
|
|
49
|
+
grep: opts.grep,
|
|
50
|
+
grepInvert: opts.grepInvert,
|
|
51
|
+
onlyChanged: opts.onlyChanged === true ? "HEAD" : opts.onlyChanged,
|
|
52
|
+
listMode: !!opts.list,
|
|
53
|
+
projectFilter: opts.project || void 0,
|
|
54
|
+
passWithNoTests: !!opts.passWithNoTests,
|
|
55
|
+
lastFailed: !!opts.lastFailed,
|
|
56
|
+
lastFailedFile: opts.lastFailedFile,
|
|
57
|
+
testList: opts.testList ? import_path.default.resolve(process.cwd(), opts.testList) : void 0,
|
|
58
|
+
testListInvert: opts.testListInvert ? import_path.default.resolve(process.cwd(), opts.testListInvert) : void 0,
|
|
59
|
+
shardWeights: resolveShardWeightsOption()
|
|
60
|
+
};
|
|
61
|
+
import_runner.projectUtils.filterProjects(config.projects, options.projectFilter);
|
|
62
|
+
if (opts.ui || opts.uiHost || opts.uiPort) {
|
|
63
|
+
if (opts.onlyChanged)
|
|
64
|
+
throw new Error(`--only-changed is not supported in UI mode. If you'd like that to change, see https://github.com/microsoft/playwright/issues/15075 for more details.`);
|
|
65
|
+
const status2 = await import_runner.testServer.runUIMode(opts.config, cliOverrides, {
|
|
66
|
+
host: opts.uiHost,
|
|
67
|
+
port: opts.uiPort ? +opts.uiPort : void 0,
|
|
68
|
+
args,
|
|
69
|
+
grep: opts.grep,
|
|
70
|
+
grepInvert: opts.grepInvert,
|
|
71
|
+
project: opts.project || void 0,
|
|
72
|
+
reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : void 0
|
|
73
|
+
});
|
|
74
|
+
await stopProfiling("runner");
|
|
75
|
+
const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
|
|
76
|
+
gracefullyProcessExitDoNotHang(exitCode2);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (process.env.PWTEST_WATCH) {
|
|
80
|
+
if (opts.onlyChanged)
|
|
81
|
+
throw new Error(`--only-changed is not supported in watch mode. If you'd like that to change, file an issue and let us know about your usecase for it.`);
|
|
82
|
+
const status2 = await import_runner.watchMode.runWatchModeLoop(
|
|
83
|
+
import_common.configLoader.resolveConfigLocation(opts.config),
|
|
84
|
+
{
|
|
85
|
+
projects: opts.project,
|
|
86
|
+
files: args,
|
|
87
|
+
grep: opts.grep
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
await stopProfiling("runner");
|
|
91
|
+
const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
|
|
92
|
+
gracefullyProcessExitDoNotHang(exitCode2);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const status = await import_runner.testRunner.runAllTestsWithConfig(config, options);
|
|
96
|
+
await stopProfiling("runner");
|
|
97
|
+
const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
|
|
98
|
+
gracefullyProcessExitDoNotHang(exitCode);
|
|
99
|
+
}
|
|
100
|
+
async function runTestServerAction(opts) {
|
|
101
|
+
const host = opts.host;
|
|
102
|
+
const port = opts.port ? +opts.port : void 0;
|
|
103
|
+
const status = await import_runner.testServer.runTestServer(opts.config, {}, { host, port });
|
|
104
|
+
const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
|
|
105
|
+
gracefullyProcessExitDoNotHang(exitCode);
|
|
106
|
+
}
|
|
107
|
+
async function clearCache(opts) {
|
|
108
|
+
const runner = new import_runner.testRunner.TestRunner(import_common.configLoader.resolveConfigLocation(opts.config), {});
|
|
109
|
+
const { status } = await runner.clearCache(import_runner.runnerReporters.createErrorCollectingReporter(import_runner.base.terminalScreen));
|
|
110
|
+
const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
|
|
111
|
+
gracefullyProcessExitDoNotHang(exitCode);
|
|
112
|
+
}
|
|
113
|
+
function overridesFromOptions(options) {
|
|
114
|
+
if (options.ui) {
|
|
115
|
+
options.debug = void 0;
|
|
116
|
+
options.trace = void 0;
|
|
117
|
+
}
|
|
118
|
+
const overrides = {
|
|
119
|
+
debug: options.debug,
|
|
120
|
+
failOnFlakyTests: options.failOnFlakyTests ? true : void 0,
|
|
121
|
+
forbidOnly: options.forbidOnly ? true : void 0,
|
|
122
|
+
fullyParallel: options.fullyParallel ? true : void 0,
|
|
123
|
+
globalTimeout: options.globalTimeout ? parseInt(options.globalTimeout, 10) : void 0,
|
|
124
|
+
maxFailures: options.x ? 1 : options.maxFailures ? parseInt(options.maxFailures, 10) : void 0,
|
|
125
|
+
outputDir: options.output ? import_path.default.resolve(process.cwd(), options.output) : void 0,
|
|
126
|
+
pause: !!process.env.PWPAUSE,
|
|
127
|
+
quiet: options.quiet ? options.quiet : void 0,
|
|
128
|
+
repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : void 0,
|
|
129
|
+
retries: options.retries ? parseInt(options.retries, 10) : void 0,
|
|
130
|
+
reporter: resolveReporterOption(options.reporter),
|
|
131
|
+
shard: resolveShardOption(options.shard),
|
|
132
|
+
timeout: options.timeout ? parseInt(options.timeout, 10) : void 0,
|
|
133
|
+
tsconfig: options.tsconfig ? import_path.default.resolve(process.cwd(), options.tsconfig) : void 0,
|
|
134
|
+
ignoreSnapshots: options.ignoreSnapshots ? !!options.ignoreSnapshots : void 0,
|
|
135
|
+
updateSnapshots: options.updateSnapshots,
|
|
136
|
+
updateSourceMethod: options.updateSourceMethod,
|
|
137
|
+
use: {
|
|
138
|
+
trace: options.trace
|
|
139
|
+
},
|
|
140
|
+
workers: options.workers
|
|
141
|
+
};
|
|
142
|
+
if (options.browser) {
|
|
143
|
+
const browserOpt = options.browser.toLowerCase();
|
|
144
|
+
if (!["all", "chromium", "firefox", "webkit"].includes(browserOpt))
|
|
145
|
+
throw new Error(`Unsupported browser "${options.browser}", must be one of "all", "chromium", "firefox" or "webkit"`);
|
|
146
|
+
const browserNames = browserOpt === "all" ? ["chromium", "firefox", "webkit"] : [browserOpt];
|
|
147
|
+
overrides.projects = browserNames.map((browserName) => {
|
|
148
|
+
return {
|
|
149
|
+
name: browserName,
|
|
150
|
+
use: { browserName }
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (options.headed)
|
|
155
|
+
overrides.use.headless = false;
|
|
156
|
+
if (options.debug === "inspector") {
|
|
157
|
+
overrides.use.headless = false;
|
|
158
|
+
process.env.PWDEBUG = "1";
|
|
159
|
+
}
|
|
160
|
+
if (overrides.tsconfig && !import_fs.default.existsSync(overrides.tsconfig))
|
|
161
|
+
throw new Error(`--tsconfig "${options.tsconfig}" does not exist`);
|
|
162
|
+
return overrides;
|
|
163
|
+
}
|
|
164
|
+
function resolveReporterOption(reporter) {
|
|
165
|
+
if (!reporter || !reporter.length)
|
|
166
|
+
return void 0;
|
|
167
|
+
return reporter.split(",").map((r) => [resolveReporter(r)]);
|
|
168
|
+
}
|
|
169
|
+
function resolveShardOption(shard) {
|
|
170
|
+
if (!shard)
|
|
171
|
+
return void 0;
|
|
172
|
+
const shardPair = shard.split("/");
|
|
173
|
+
if (shardPair.length !== 2) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
`--shard "${shard}", expected format is "current/all", 1-based, for example "3/5".`
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
const current = parseInt(shardPair[0], 10);
|
|
179
|
+
const total = parseInt(shardPair[1], 10);
|
|
180
|
+
if (isNaN(total) || total < 1)
|
|
181
|
+
throw new Error(`--shard "${shard}" total must be a positive number`);
|
|
182
|
+
if (isNaN(current) || current < 1 || current > total) {
|
|
183
|
+
throw new Error(
|
|
184
|
+
`--shard "${shard}" current must be a positive number, not greater than shard total`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
return { current, total };
|
|
188
|
+
}
|
|
189
|
+
function resolveShardWeightsOption() {
|
|
190
|
+
const shardWeights = process.env.PWTEST_SHARD_WEIGHTS;
|
|
191
|
+
if (!shardWeights)
|
|
192
|
+
return void 0;
|
|
193
|
+
return shardWeights.split(":").map((w) => {
|
|
194
|
+
const weight = parseInt(w, 10);
|
|
195
|
+
if (isNaN(weight) || weight < 0)
|
|
196
|
+
throw new Error(`PWTEST_SHARD_WEIGHTS="${shardWeights}" weights must be non-negative numbers`);
|
|
197
|
+
return weight;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function resolveReporter(id) {
|
|
201
|
+
if (import_common.builtInReporters.includes(id))
|
|
202
|
+
return id;
|
|
203
|
+
const localPath = import_path.default.resolve(process.cwd(), id);
|
|
204
|
+
if (import_fs.default.existsSync(localPath))
|
|
205
|
+
return localPath;
|
|
206
|
+
return require.resolve(id, { paths: [process.cwd()] });
|
|
207
|
+
}
|
|
208
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
209
|
+
0 && (module.exports = {
|
|
210
|
+
clearCache,
|
|
211
|
+
runTestServerAction,
|
|
212
|
+
runTests
|
|
213
|
+
});
|