完全跑通1.0版本

This commit is contained in:
2026-05-26 12:56:03 +08:00
parent 2ece5174a7
commit 93c714a93b
11557 changed files with 1648225 additions and 36 deletions

View File

@@ -0,0 +1,89 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var agentParser_exports = {};
__export(agentParser_exports, {
parseAgentSpec: () => parseAgentSpec
});
module.exports = __toCommonJS(agentParser_exports);
var import_fs = __toESM(require("fs"));
const yaml = require("playwright-core/lib/utilsBundle").yaml;
async function parseAgentSpec(filePath) {
const source = await import_fs.default.promises.readFile(filePath, "utf-8");
const { header, content } = extractYamlAndContent(source);
const { instructions, examples } = extractInstructionsAndExamples(content);
return {
...header,
instructions,
examples
};
}
function extractYamlAndContent(markdown) {
const lines = markdown.split("\n");
if (lines[0] !== "---")
throw new Error("Markdown file must start with YAML front matter (---)");
let yamlEndIndex = -1;
for (let i = 1; i < lines.length; i++) {
if (lines[i] === "---") {
yamlEndIndex = i;
break;
}
}
if (yamlEndIndex === -1)
throw new Error("YAML front matter must be closed with ---");
const yamlLines = lines.slice(1, yamlEndIndex);
const yamlRaw = yamlLines.join("\n");
const contentLines = lines.slice(yamlEndIndex + 1);
const content = contentLines.join("\n");
let header;
try {
header = yaml.parse(yamlRaw);
} catch (error) {
throw new Error(`Failed to parse YAML header: ${error.message}`);
}
if (!header.name)
throw new Error('YAML header must contain a "name" field');
if (!header.description)
throw new Error('YAML header must contain a "description" field');
return { header, content };
}
function extractInstructionsAndExamples(content) {
const examples = [];
const instructions = content.split("<example>")[0].trim();
const exampleRegex = /<example>([\s\S]*?)<\/example>/g;
let match;
while ((match = exampleRegex.exec(content)) !== null) {
const example = match[1].trim();
examples.push(example.replace(/[\n]/g, " ").replace(/ +/g, " "));
}
return { instructions, examples };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
parseAgentSpec
});

View File

@@ -0,0 +1,34 @@
name: "Copilot Setup Steps"
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
# Customize this step as needed
- name: Build application
run: npx run build

View File

@@ -0,0 +1,347 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var generateAgents_exports = {};
__export(generateAgents_exports, {
ClaudeGenerator: () => ClaudeGenerator,
CopilotGenerator: () => CopilotGenerator,
OpencodeGenerator: () => OpencodeGenerator,
VSCodeGenerator: () => VSCodeGenerator
});
module.exports = __toCommonJS(generateAgents_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_seed = require("../mcp/test/seed");
var import_agentParser = require("./agentParser");
const colors = require("playwright-core/lib/utilsBundle").colors;
const yaml = require("playwright-core/lib/utilsBundle").yaml;
const { mkdirIfNeeded } = require("playwright-core/lib/coreBundle").utils;
async function loadAgentSpecs() {
const files = await import_fs.default.promises.readdir(__dirname);
return Promise.all(files.filter((file) => file.endsWith(".agent.md")).map((file) => (0, import_agentParser.parseAgentSpec)(import_path.default.join(__dirname, file))));
}
class ClaudeGenerator {
static async init(fullConfig, projectName, prompts) {
await initRepo(fullConfig, projectName, {
promptsFolder: prompts ? ".claude/prompts" : void 0
});
const agents = await loadAgentSpecs();
await import_fs.default.promises.mkdir(".claude/agents", { recursive: true });
for (const agent of agents)
await writeFile(`.claude/agents/${agent.name}.md`, ClaudeGenerator.agentSpec(agent), "\u{1F916}", "agent definition");
const mcpServer = process.platform === "win32" ? { command: "cmd", args: ["/c", "npx", "playwright", "run-test-mcp-server"] } : { command: "npx", args: ["playwright", "run-test-mcp-server"] };
await writeFile(".mcp.json", JSON.stringify({
mcpServers: {
"playwright-test": mcpServer
}
}, null, 2), "\u{1F527}", "mcp configuration");
initRepoDone();
}
static agentSpec(agent) {
const claudeToolMap = /* @__PURE__ */ new Map([
["search", ["Glob", "Grep", "Read", "LS"]],
["edit", ["Edit", "MultiEdit", "Write"]]
]);
function asClaudeTool(tool) {
const [first, second] = tool.split("/");
if (!second)
return (claudeToolMap.get(first) || [first]).join(", ");
return `mcp__${first}__${second}`;
}
const examples = agent.examples.length ? ` Examples: ${agent.examples.map((example) => `<example>${example}</example>`).join("")}` : "";
const lines = [];
const header = {
name: agent.name,
description: agent.description + examples,
tools: agent.tools.map((tool) => asClaudeTool(tool)).join(", "),
model: agent.model,
color: agent.color
};
lines.push(`---`);
lines.push(yaml.stringify(header, { lineWidth: 1e5 }) + `---`);
lines.push("");
lines.push(agent.instructions);
return lines.join("\n");
}
}
class OpencodeGenerator {
static async init(fullConfig, projectName, prompts) {
await initRepo(fullConfig, projectName, {
defaultAgentName: "Build",
promptsFolder: prompts ? ".opencode/prompts" : void 0
});
const agents = await loadAgentSpecs();
for (const agent of agents) {
const prompt = [agent.instructions];
prompt.push("");
prompt.push(...agent.examples.map((example) => `<example>${example}</example>`));
await writeFile(`.opencode/prompts/${agent.name}.md`, prompt.join("\n"), "\u{1F916}", "agent definition");
}
await writeFile("opencode.json", OpencodeGenerator.configuration(agents), "\u{1F527}", "opencode configuration");
initRepoDone();
}
static configuration(agents) {
const opencodeToolMap = /* @__PURE__ */ new Map([
["search", ["ls", "glob", "grep", "read"]],
["edit", ["edit", "write"]]
]);
const asOpencodeTool = (tools, tool) => {
const [first, second] = tool.split("/");
if (!second) {
for (const tool2 of opencodeToolMap.get(first) || [first])
tools[tool2] = true;
} else {
tools[`${first}*${second}`] = true;
}
};
const result = {};
result["$schema"] = "https://opencode.ai/config.json";
result["mcp"] = {};
result["tools"] = {
"playwright*": false
};
result["agent"] = {};
for (const agent of agents) {
const tools = {};
result["agent"][agent.name] = {
description: agent.description,
mode: "subagent",
prompt: `{file:.opencode/prompts/${agent.name}.md}`,
tools
};
for (const tool of agent.tools)
asOpencodeTool(tools, tool);
}
result["mcp"]["playwright-test"] = {
type: "local",
command: ["npx", "playwright", "run-test-mcp-server"],
enabled: true
};
return JSON.stringify(result, null, 2);
}
}
class CopilotGenerator {
static async init(fullConfig, projectName, prompts) {
await initRepo(fullConfig, projectName, {
defaultAgentName: "agent",
promptsFolder: prompts ? ".github/prompts" : void 0,
promptSuffix: "prompt"
});
const agents = await loadAgentSpecs();
await import_fs.default.promises.mkdir(".github/agents", { recursive: true });
for (const agent of agents)
await writeFile(`.github/agents/${agent.name}.agent.md`, CopilotGenerator.agentSpec(agent), "\u{1F916}", "agent definition");
await deleteFile(`.github/chatmodes/ \u{1F3AD} planner.chatmode.md`, "legacy planner chatmode");
await deleteFile(`.github/chatmodes/\u{1F3AD} generator.chatmode.md`, "legacy generator chatmode");
await deleteFile(`.github/chatmodes/\u{1F3AD} healer.chatmode.md`, "legacy healer chatmode");
await deleteFile(`.github/agents/ \u{1F3AD} planner.agent.md`, "legacy planner agent");
await deleteFile(`.github/agents/\u{1F3AD} generator.agent.md`, "legacy generator agent");
await deleteFile(`.github/agents/\u{1F3AD} healer.agent.md`, "legacy healer agent");
await VSCodeGenerator.appendToMCPJson();
const mcpConfig = { mcpServers: CopilotGenerator.mcpServers };
if (!import_fs.default.existsSync(".github/copilot-setup-steps.yml")) {
const yaml2 = import_fs.default.readFileSync(import_path.default.join(__dirname, "copilot-setup-steps.yml"), "utf-8");
await writeFile(".github/workflows/copilot-setup-steps.yml", yaml2, "\u{1F527}", "GitHub Copilot setup steps");
}
console.log("");
console.log("");
console.log(" \u{1F527} TODO: GitHub > Settings > Copilot > Coding agent > MCP configuration");
console.log("------------------------------------------------------------------");
console.log(JSON.stringify(mcpConfig, null, 2));
console.log("------------------------------------------------------------------");
initRepoDone();
}
static agentSpec(agent) {
const examples = agent.examples.length ? ` Examples: ${agent.examples.map((example) => `<example>${example}</example>`).join("")}` : "";
const lines = [];
const header = {
"name": agent.name,
"description": agent.description + examples,
"tools": agent.tools,
"model": "Claude Sonnet 4.6",
"mcp-servers": CopilotGenerator.mcpServers
};
lines.push(`---`);
lines.push(yaml.stringify(header, { lineWidth: 1e5 }) + `---`);
lines.push("");
lines.push(agent.instructions);
lines.push("");
return lines.join("\n");
}
static {
this.mcpServers = {
"playwright-test": {
"type": "stdio",
"command": "npx",
"args": [
"playwright",
"run-test-mcp-server"
],
"tools": ["*"]
}
};
}
}
class VSCodeGenerator {
static async init(fullConfig, projectName) {
await initRepo(fullConfig, projectName, {
promptsFolder: void 0
});
const agents = await loadAgentSpecs();
const nameMap = /* @__PURE__ */ new Map([
["playwright-test-planner", " \u{1F3AD} planner"],
["playwright-test-generator", "\u{1F3AD} generator"],
["playwright-test-healer", "\u{1F3AD} healer"]
]);
await import_fs.default.promises.mkdir(".github/chatmodes", { recursive: true });
for (const agent of agents)
await writeFile(`.github/chatmodes/${nameMap.get(agent.name)}.chatmode.md`, VSCodeGenerator.agentSpec(agent), "\u{1F916}", "chatmode definition");
await VSCodeGenerator.appendToMCPJson();
initRepoDone();
}
static async appendToMCPJson() {
await import_fs.default.promises.mkdir(".vscode", { recursive: true });
const mcpJsonPath = ".vscode/mcp.json";
let mcpJson = {
servers: {},
inputs: []
};
try {
mcpJson = JSON.parse(import_fs.default.readFileSync(mcpJsonPath, "utf8"));
} catch {
}
if (!mcpJson.servers)
mcpJson.servers = {};
mcpJson.servers["playwright-test"] = {
type: "stdio",
command: "npx",
args: ["playwright", "run-test-mcp-server"]
};
await writeFile(mcpJsonPath, JSON.stringify(mcpJson, null, 2), "\u{1F527}", "mcp configuration");
}
static agentSpec(agent) {
const vscodeToolMap = /* @__PURE__ */ new Map([
["search", ["search/listDirectory", "search/fileSearch", "search/textSearch"]],
["read", ["search/readFile"]],
["edit", ["edit/editFiles"]],
["write", ["edit/createFile", "edit/createDirectory"]]
]);
const vscodeToolsOrder = ["edit/createFile", "edit/createDirectory", "edit/editFiles", "search/fileSearch", "search/textSearch", "search/listDirectory", "search/readFile"];
const vscodeMcpName = "playwright-test";
function asVscodeTool(tool) {
const [first, second] = tool.split("/");
if (second)
return `${vscodeMcpName}/${second}`;
return vscodeToolMap.get(first) || first;
}
const tools = agent.tools.map(asVscodeTool).flat().sort((a, b) => {
const indexA = vscodeToolsOrder.indexOf(a);
const indexB = vscodeToolsOrder.indexOf(b);
if (indexA === -1 && indexB === -1)
return a.localeCompare(b);
if (indexA === -1)
return 1;
if (indexB === -1)
return -1;
return indexA - indexB;
}).map((tool) => `'${tool}'`).join(", ");
const lines = [];
lines.push(`---`);
lines.push(`description: ${agent.description}.`);
lines.push(`tools: [${tools}]`);
lines.push(`---`);
lines.push("");
lines.push(agent.instructions);
for (const example of agent.examples)
lines.push(`<example>${example}</example>`);
lines.push("");
return lines.join("\n");
}
}
async function writeFile(filePath, content, icon, description) {
console.log(` ${icon} ${import_path.default.relative(process.cwd(), filePath)} ${colors.dim("- " + description)}`);
await mkdirIfNeeded(filePath);
await import_fs.default.promises.writeFile(filePath, content, "utf-8");
}
async function deleteFile(filePath, description) {
try {
if (!import_fs.default.existsSync(filePath))
return;
} catch {
return;
}
console.log(` \u2702\uFE0F ${import_path.default.relative(process.cwd(), filePath)} ${colors.dim("- " + description)}`);
await import_fs.default.promises.unlink(filePath);
}
async function initRepo(fullConfig, projectName, options) {
const project = (0, import_seed.seedProject)(fullConfig, projectName);
console.log(` \u{1F3AD} Using project "${project.project.name}" as a primary project`);
if (!import_fs.default.existsSync("specs")) {
await import_fs.default.promises.mkdir("specs");
await writeFile(import_path.default.join("specs", "README.md"), `# Specs
This is a directory for test plans.
`, "\u{1F4DD}", "directory for test plans");
}
let seedFile = await (0, import_seed.findSeedFile)(project);
if (!seedFile) {
seedFile = (0, import_seed.defaultSeedFile)(project);
await writeFile(seedFile, import_seed.seedFileContent, "\u{1F331}", "default environment seed file");
}
if (options.promptsFolder) {
await import_fs.default.promises.mkdir(options.promptsFolder, { recursive: true });
for (const promptFile of await import_fs.default.promises.readdir(__dirname)) {
if (!promptFile.endsWith(".prompt.md"))
continue;
const shortName = promptFile.replace(".prompt.md", "");
const fileName = options.promptSuffix ? `${shortName}.${options.promptSuffix}.md` : `${shortName}.md`;
const content = await loadPrompt(promptFile, {
defaultAgentName: "default",
...options,
seedFile: import_path.default.relative(process.cwd(), seedFile)
});
await writeFile(import_path.default.join(options.promptsFolder, fileName), content, "\u{1F4DD}", "prompt template");
}
}
}
function initRepoDone() {
console.log(" \u2705 Done.");
}
async function loadPrompt(file, params) {
const content = await import_fs.default.promises.readFile(import_path.default.join(__dirname, file), "utf-8");
return Object.entries(params).reduce((acc, [key, value]) => {
return acc.replace(new RegExp(`\\\${${key}}`, "g"), value);
}, content);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ClaudeGenerator,
CopilotGenerator,
OpencodeGenerator,
VSCodeGenerator
});

View File

@@ -0,0 +1,31 @@
---
agent: ${defaultAgentName}
description: Produce test coverage
---
Parameters:
- Task: the task to perform
- Seed file (optional): the seed file to use, defaults to `${seedFile}`
- Test plan file (optional): the test plan file to write, under `specs/` folder.
1. Call #playwright-test-planner subagent with prompt:
<plan>
<task-text><!-- the task --></task-text>
<seed-file><!-- path to seed file --></seed-file>
<plan-file><!-- path to test plan file to generate --></plan-file>
</plan>
2. For each test case from the test plan file (1.1, 1.2, ...), one after another, not in parallel, call #playwright-test-generator subagent with prompt:
<generate>
<test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite>
<test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name>
<test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file>
<seed-file><!-- Seed file path from test plan --></seed-file>
<body><!-- Test case content including steps and expectations --></body>
</generate>
3. Call #playwright-test-healer subagent with prompt:
<heal>Run all tests and fix the failing ones one after another.</heal>

View File

@@ -0,0 +1,8 @@
---
agent: playwright-test-generator
description: Generate test plan
---
Generate tests for the test plan's bullet 1.1 Add item to card.
Test plan: `specs/coverage.plan.md`

View File

@@ -0,0 +1,88 @@
---
name: playwright-test-generator
description: Use this agent when you need to create automated browser tests using Playwright
model: sonnet
color: blue
tools:
- search
- playwright-test/browser_click
- playwright-test/browser_drag
- playwright-test/browser_evaluate
- playwright-test/browser_file_upload
- playwright-test/browser_handle_dialog
- playwright-test/browser_hover
- playwright-test/browser_navigate
- playwright-test/browser_press_key
- playwright-test/browser_select_option
- playwright-test/browser_snapshot
- playwright-test/browser_type
- playwright-test/browser_verify_element_visible
- playwright-test/browser_verify_list_visible
- playwright-test/browser_verify_text_visible
- playwright-test/browser_verify_value
- playwright-test/browser_wait_for
- playwright-test/generator_read_log
- playwright-test/generator_setup_page
- playwright-test/generator_write_test
---
You are a Playwright Test Generator, an expert in browser automation and end-to-end testing.
Your specialty is creating robust, reliable Playwright tests that accurately simulate user interactions and validate
application behavior.
# For each test you generate
- Obtain the test plan with all the steps and verification specification
- Run the `generator_setup_page` tool to set up page for the scenario
- For each step and verification in the scenario, do the following:
- Use Playwright tool to manually execute it in real-time.
- Use the step description as the intent for each Playwright tool call.
- Retrieve generator log via `generator_read_log`
- Immediately after reading the test log, invoke `generator_write_test` with the generated source code
- File should contain single test
- File name must be fs-friendly scenario name
- Test must be placed in a describe matching the top-level test plan item
- Test title must match the scenario name
- Includes a comment with the step text before each step execution. Do not duplicate comments if step requires
multiple actions.
- Always use best practices from the log when generating tests.
<example-generation>
For following plan:
```markdown file=specs/plan.md
### 1. Adding New Todos
**Seed:** `tests/seed.spec.ts`
#### 1.1 Add Valid Todo
**Steps:**
1. Click in the "What needs to be done?" input field
#### 1.2 Add Multiple Todos
...
```
Following file is generated:
```ts file=add-valid-todo.spec.ts
// spec: specs/plan.md
// seed: tests/seed.spec.ts
test.describe('Adding New Todos', () => {
test('Add Valid Todo', async { page } => {
// 1. Click in the "What needs to be done?" input field
await page.click(...);
...
});
});
```
</example-generation>
<example>
Context: User wants to generate a test for the test plan item.
<test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite>
<test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name>
<test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file>
<seed-file><!-- Seed file path from test plan --></seed-file>
<body><!-- Test case content including steps and expectations --></body>
</example>

View File

@@ -0,0 +1,6 @@
---
agent: playwright-test-healer
description: Fix tests
---
Run all my tests and fix the failing ones.

View File

@@ -0,0 +1,56 @@
---
name: playwright-test-healer
description: Use this agent when you need to debug and fix failing Playwright tests
model: sonnet
color: red
tools:
- search
- edit
- playwright-test/browser_console_messages
- playwright-test/browser_evaluate
- playwright-test/browser_generate_locator
- playwright-test/browser_network_request
- playwright-test/browser_network_requests
- playwright-test/browser_snapshot
- playwright-test/test_debug
- playwright-test/test_list
- playwright-test/test_run
---
You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and
resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix
broken Playwright tests using a methodical approach.
Your workflow:
1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests
2. **Debug failed tests**: For each failing test run `test_debug`.
3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
- Examine the error details
- Capture page snapshot to understand the context
- Analyze selectors, timing issues, or assertion failures
4. **Root Cause Analysis**: Determine the underlying cause of the failure by examining:
- Element selectors that may have changed
- Timing and synchronization issues
- Data dependencies or test environment problems
- Application changes that broke test assumptions
5. **Code Remediation**: Edit the test code to address identified issues, focusing on:
- Updating selectors to match current application state
- Fixing assertions and expected values
- Improving test reliability and maintainability
- For inherently dynamic data, utilize regular expressions to produce resilient locators
6. **Verification**: Restart the test after each fix to validate the changes
7. **Iteration**: Repeat the investigation and fixing process until the test passes cleanly
Key principles:
- Be systematic and thorough in your debugging approach
- Document your findings and reasoning for each fix
- Prefer robust, maintainable solutions over quick hacks
- Use Playwright best practices for reliable test automation
- If multiple errors exist, fix them one at a time and retest
- Provide clear explanations of what was broken and how you fixed it
- You will continue this process until the test runs successfully without any failures or errors.
- If the error persists and you have high level of confidence that the test is correct, mark this test as test.fixme()
so that it is skipped during the execution. Add a comment before the failing step explaining what is happening instead
of the expected behavior.
- Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
- Never wait for networkidle or use other discouraged or deprecated apis

View File

@@ -0,0 +1,9 @@
---
agent: playwright-test-planner
description: Create test plan
---
Create test plan for "add to cart" functionality of my app.
- Seed file: `${seedFile}`
- Test plan: `specs/coverage.plan.md`

View File

@@ -0,0 +1,74 @@
---
name: playwright-test-planner
description: Use this agent when you need to create comprehensive test plan for a web application or website
model: sonnet
color: green
tools:
- search
- playwright-test/browser_click
- playwright-test/browser_close
- playwright-test/browser_console_messages
- playwright-test/browser_drag
- playwright-test/browser_evaluate
- playwright-test/browser_file_upload
- playwright-test/browser_handle_dialog
- playwright-test/browser_hover
- playwright-test/browser_navigate
- playwright-test/browser_navigate_back
- playwright-test/browser_network_request
- playwright-test/browser_network_requests
- playwright-test/browser_press_key
- playwright-test/browser_run_code_unsafe
- playwright-test/browser_select_option
- playwright-test/browser_snapshot
- playwright-test/browser_take_screenshot
- playwright-test/browser_type
- playwright-test/browser_wait_for
- playwright-test/planner_setup_page
- playwright-test/planner_save_plan
---
You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
planning.
You will:
1. **Navigate and Explore**
- Invoke the `planner_setup_page` tool once to set up page before using any other tools
- Explore the browser snapshot
- Do not take screenshots unless absolutely necessary
- Use `browser_*` tools to navigate and discover interface
- Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
2. **Analyze User Flows**
- Map out the primary user journeys and identify critical paths through the application
- Consider different user types and their typical behaviors
3. **Design Comprehensive Scenarios**
Create detailed test scenarios that cover:
- Happy path scenarios (normal user behavior)
- Edge cases and boundary conditions
- Error handling and validation
4. **Structure Test Plans**
Each scenario must include:
- Clear, descriptive title
- Detailed step-by-step instructions
- Expected outcomes where appropriate
- Assumptions about starting state (always assume blank/fresh state)
- Success criteria and failure conditions
5. **Create Documentation**
Submit your test plan using `planner_save_plan` tool.
**Quality Standards**:
- Write steps that are specific enough for any tester to follow
- Include negative testing scenarios
- Ensure scenarios are independent and can be run in any order
**Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
professional formatting suitable for sharing with development and QA teams.

View File

@@ -0,0 +1,78 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var reportActions_exports = {};
__export(reportActions_exports, {
mergeReports: () => mergeReports,
showReport: () => showReport
});
module.exports = __toCommonJS(reportActions_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_common = require("../common");
var import_runner = require("../runner");
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
async function showReport(report, host, port) {
await import_runner.html.showHTMLReport(report, host, port);
}
async function mergeReports(reportDir, opts) {
const configFile = opts.config;
const config = configFile ? await import_common.configLoader.loadConfigFromFile(configFile) : await import_common.configLoader.loadEmptyConfigForMergeReports();
const dir = import_path.default.resolve(process.cwd(), reportDir || "");
const dirStat = await import_fs.default.promises.stat(dir).catch((e) => null);
if (!dirStat)
throw new Error("Directory does not exist: " + dir);
if (!dirStat.isDirectory())
throw new Error(`"${dir}" is not a directory`);
let reporterDescriptions = resolveReporterOption(opts.reporter);
if (!reporterDescriptions && configFile)
reporterDescriptions = config.config.reporter;
if (!reporterDescriptions)
reporterDescriptions = [[import_common.config.defaultReporter]];
const rootDirOverride = configFile ? config.config.rootDir : void 0;
await import_runner.merge.createMergedReport(config, dir, reporterDescriptions, rootDirOverride);
gracefullyProcessExitDoNotHang(0);
}
function resolveReporterOption(reporter) {
if (!reporter || !reporter.length)
return void 0;
return reporter.split(",").map((r) => [resolveReporter(r)]);
}
function resolveReporter(id) {
if (import_common.builtInReporters.includes(id))
return id;
const localPath = import_path.default.resolve(process.cwd(), id);
if (import_fs.default.existsSync(localPath))
return localPath;
return require.resolve(id, { paths: [process.cwd()] });
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
mergeReports,
showReport
});

211
frontend/node_modules/playwright/lib/cli/testActions.js generated vendored Normal file
View File

@@ -0,0 +1,211 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testActions_exports = {};
__export(testActions_exports, {
clearCache: () => clearCache,
runTestServerAction: () => runTestServerAction,
runTests: () => runTests
});
module.exports = __toCommonJS(testActions_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_common = require("../common");
var import_runner = require("../runner");
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
const { startProfiling, stopProfiling } = require("playwright-core/lib/coreBundle").utils;
async function runTests(args, opts) {
await startProfiling();
const cliOverrides = overridesFromOptions(opts);
const config = await import_common.configLoader.loadConfigFromFile(opts.config, cliOverrides, opts.deps === false);
const options = {
locations: args.length ? args : void 0,
grep: opts.grep,
grepInvert: opts.grepInvert,
onlyChanged: opts.onlyChanged === true ? "HEAD" : opts.onlyChanged,
listMode: !!opts.list,
projectFilter: opts.project || void 0,
passWithNoTests: !!opts.passWithNoTests,
lastFailed: !!opts.lastFailed,
testList: opts.testList ? import_path.default.resolve(process.cwd(), opts.testList) : void 0,
testListInvert: opts.testListInvert ? import_path.default.resolve(process.cwd(), opts.testListInvert) : void 0,
shardWeights: resolveShardWeightsOption()
};
import_runner.projectUtils.filterProjects(config.projects, options.projectFilter);
if (opts.ui || opts.uiHost || opts.uiPort) {
if (opts.onlyChanged)
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.`);
const status2 = await import_runner.testServer.runUIMode(opts.config, cliOverrides, {
host: opts.uiHost,
port: opts.uiPort ? +opts.uiPort : void 0,
args,
grep: opts.grep,
grepInvert: opts.grepInvert,
project: opts.project || void 0,
reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : void 0
});
await stopProfiling("runner");
const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
gracefullyProcessExitDoNotHang(exitCode2);
return;
}
if (process.env.PWTEST_WATCH) {
if (opts.onlyChanged)
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.`);
const status2 = await import_runner.watchMode.runWatchModeLoop(
import_common.configLoader.resolveConfigLocation(opts.config),
{
projects: opts.project,
files: args,
grep: opts.grep
}
);
await stopProfiling("runner");
const exitCode2 = status2 === "interrupted" ? 130 : status2 === "passed" ? 0 : 1;
gracefullyProcessExitDoNotHang(exitCode2);
return;
}
const status = await import_runner.testRunner.runAllTestsWithConfig(config, options);
await stopProfiling("runner");
const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
gracefullyProcessExitDoNotHang(exitCode);
}
async function runTestServerAction(opts) {
const host = opts.host;
const port = opts.port ? +opts.port : void 0;
const status = await import_runner.testServer.runTestServer(opts.config, {}, { host, port });
const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
gracefullyProcessExitDoNotHang(exitCode);
}
async function clearCache(opts) {
const runner = new import_runner.testRunner.TestRunner(import_common.configLoader.resolveConfigLocation(opts.config), {});
const { status } = await runner.clearCache(import_runner.runnerReporters.createErrorCollectingReporter(import_runner.base.terminalScreen));
const exitCode = status === "interrupted" ? 130 : status === "passed" ? 0 : 1;
gracefullyProcessExitDoNotHang(exitCode);
}
function overridesFromOptions(options) {
if (options.ui) {
options.debug = void 0;
options.trace = void 0;
}
const overrides = {
debug: options.debug,
failOnFlakyTests: options.failOnFlakyTests ? true : void 0,
forbidOnly: options.forbidOnly ? true : void 0,
fullyParallel: options.fullyParallel ? true : void 0,
globalTimeout: options.globalTimeout ? parseInt(options.globalTimeout, 10) : void 0,
maxFailures: options.x ? 1 : options.maxFailures ? parseInt(options.maxFailures, 10) : void 0,
outputDir: options.output ? import_path.default.resolve(process.cwd(), options.output) : void 0,
pause: !!process.env.PWPAUSE,
quiet: options.quiet ? options.quiet : void 0,
repeatEach: options.repeatEach ? parseInt(options.repeatEach, 10) : void 0,
retries: options.retries ? parseInt(options.retries, 10) : void 0,
reporter: resolveReporterOption(options.reporter),
shard: resolveShardOption(options.shard),
timeout: options.timeout ? parseInt(options.timeout, 10) : void 0,
tsconfig: options.tsconfig ? import_path.default.resolve(process.cwd(), options.tsconfig) : void 0,
ignoreSnapshots: options.ignoreSnapshots ? !!options.ignoreSnapshots : void 0,
updateSnapshots: options.updateSnapshots,
updateSourceMethod: options.updateSourceMethod,
use: {
trace: options.trace
},
workers: options.workers
};
if (options.browser) {
const browserOpt = options.browser.toLowerCase();
if (!["all", "chromium", "firefox", "webkit"].includes(browserOpt))
throw new Error(`Unsupported browser "${options.browser}", must be one of "all", "chromium", "firefox" or "webkit"`);
const browserNames = browserOpt === "all" ? ["chromium", "firefox", "webkit"] : [browserOpt];
overrides.projects = browserNames.map((browserName) => {
return {
name: browserName,
use: { browserName }
};
});
}
if (options.headed)
overrides.use.headless = false;
if (options.debug === "inspector") {
overrides.use.headless = false;
process.env.PWDEBUG = "1";
}
if (overrides.tsconfig && !import_fs.default.existsSync(overrides.tsconfig))
throw new Error(`--tsconfig "${options.tsconfig}" does not exist`);
return overrides;
}
function resolveReporterOption(reporter) {
if (!reporter || !reporter.length)
return void 0;
return reporter.split(",").map((r) => [resolveReporter(r)]);
}
function resolveShardOption(shard) {
if (!shard)
return void 0;
const shardPair = shard.split("/");
if (shardPair.length !== 2) {
throw new Error(
`--shard "${shard}", expected format is "current/all", 1-based, for example "3/5".`
);
}
const current = parseInt(shardPair[0], 10);
const total = parseInt(shardPair[1], 10);
if (isNaN(total) || total < 1)
throw new Error(`--shard "${shard}" total must be a positive number`);
if (isNaN(current) || current < 1 || current > total) {
throw new Error(
`--shard "${shard}" current must be a positive number, not greater than shard total`
);
}
return { current, total };
}
function resolveShardWeightsOption() {
const shardWeights = process.env.PWTEST_SHARD_WEIGHTS;
if (!shardWeights)
return void 0;
return shardWeights.split(":").map((w) => {
const weight = parseInt(w, 10);
if (isNaN(weight) || weight < 0)
throw new Error(`PWTEST_SHARD_WEIGHTS="${shardWeights}" weights must be non-negative numbers`);
return weight;
});
}
function resolveReporter(id) {
if (import_common.builtInReporters.includes(id))
return id;
const localPath = import_path.default.resolve(process.cwd(), id);
if (import_fs.default.existsSync(localPath))
return localPath;
return require.resolve(id, { paths: [process.cwd()] });
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
clearCache,
runTestServerAction,
runTests
});

2898
frontend/node_modules/playwright/lib/common/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
# packages/playwright/lib/common/index.js
# total: 111.2 KB
## Inlined (20)
11.6 KB packages/playwright/src/common/config.ts
13.7 KB packages/playwright/src/common/configLoader.ts
2.1 KB packages/playwright/src/common/esmLoaderHost.ts
10.9 KB packages/playwright/src/common/fixtures.ts
0.8 KB packages/playwright/src/common/index.ts
1.3 KB packages/playwright/src/common/ipc.ts
2.1 KB packages/playwright/src/common/poolBuilder.ts
3.7 KB packages/playwright/src/common/process.ts
4.7 KB packages/playwright/src/common/suiteUtils.ts
7.9 KB packages/playwright/src/common/test.ts
2.1 KB packages/playwright/src/common/testLoader.ts
12.5 KB packages/playwright/src/common/testType.ts
1.2 KB packages/playwright/src/common/validators.ts
1.3 KB packages/playwright/src/isomorphic/teleReceiver.ts
9.6 KB packages/playwright/src/transform/compilationCache.ts
1.1 KB packages/playwright/src/transform/pirates.ts
1.1 KB packages/playwright/src/transform/portTransport.ts
10.2 KB packages/playwright/src/transform/transform.ts
2.9 KB packages/playwright/src/transform/tsconfig-loader.ts
7.5 KB packages/playwright/src/util.ts
## External (9)
../globals
../matchers/expect
../package
../transform/esmLoader.js
playwright
playwright-core/lib/bootstrap
playwright-core/lib/coreBundle
playwright-core/lib/utilsBundle
playwright-core/package.json

130
frontend/node_modules/playwright/lib/errorContext.js generated vendored Normal file
View File

@@ -0,0 +1,130 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var errorContext_exports = {};
__export(errorContext_exports, {
buildErrorContext: () => buildErrorContext
});
module.exports = __toCommonJS(errorContext_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_util = require("./util");
const { parseErrorStack } = require("playwright-core/lib/coreBundle").iso;
const { stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
const fixTestInstructions = `# Instructions
- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.
`;
function buildErrorContext(options) {
const { titlePath, location, errors, pageSnapshot } = options;
const meaningfulErrors = errors.filter((e) => !!e.message);
if (!meaningfulErrors.length && !pageSnapshot)
return void 0;
const lines = [
fixTestInstructions,
"# Test info",
"",
`- Name: ${titlePath.join(" >> ")}`,
`- Location: ${(0, import_util.relativeFilePath)(location.file)}:${location.line}:${location.column}`
];
if (meaningfulErrors.length) {
lines.push("", "# Error details");
for (const error of meaningfulErrors) {
lines.push(
"",
"```",
stripAnsiEscapes(error.message || ""),
"```"
);
if (error.errorContext) {
lines.push(
"",
"```yaml",
error.errorContext,
"```"
);
}
}
}
if (pageSnapshot) {
lines.push(
"",
"# Page snapshot",
"",
"```yaml",
pageSnapshot,
"```"
);
}
const lastError = meaningfulErrors[meaningfulErrors.length - 1];
const codeFrame = lastError ? buildCodeFrame(lastError, location) : void 0;
if (codeFrame) {
lines.push(
"",
"# Test source",
"",
"```ts",
codeFrame,
"```"
);
}
return lines.join("\n");
}
function buildCodeFrame(error, testLocation) {
const stack = error.stack;
if (!stack)
return void 0;
const parsed = parseErrorStack(stack, import_path.default.sep);
const errorLocation = parsed.location;
if (!errorLocation)
return void 0;
let source;
try {
source = import_fs.default.readFileSync(errorLocation.file, "utf8");
} catch {
return void 0;
}
const sourceLines = source.split("\n");
const linesAbove = 100;
const linesBelow = 100;
const start = Math.max(0, errorLocation.line - linesAbove - 1);
const end = Math.min(sourceLines.length, errorLocation.line + linesBelow);
const scope = sourceLines.slice(start, end);
const lineNumberWidth = String(end).length;
const message = stripAnsiEscapes(error.message || "").split("\n")[0] || void 0;
const frame = scope.map((line, index) => `${start + index + 1 === errorLocation.line ? "> " : " "}${(start + index + 1).toString().padEnd(lineNumberWidth, " ")} | ${line}`);
if (message)
frame.splice(errorLocation.line - start, 0, `${" ".repeat(lineNumberWidth + 2)} | ${" ".repeat(Math.max(0, errorLocation.column - 2))} ^ ${message}`);
return frame.join("\n");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
buildErrorContext
});

58
frontend/node_modules/playwright/lib/globals.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var globals_exports = {};
__export(globals_exports, {
currentTestInfo: () => currentTestInfo,
currentlyLoadingFileSuite: () => currentlyLoadingFileSuite,
isWorkerProcess: () => isWorkerProcess,
setCurrentTestInfo: () => setCurrentTestInfo,
setCurrentlyLoadingFileSuite: () => setCurrentlyLoadingFileSuite,
setIsWorkerProcess: () => setIsWorkerProcess
});
module.exports = __toCommonJS(globals_exports);
let currentTestInfoValue = null;
function setCurrentTestInfo(testInfo) {
currentTestInfoValue = testInfo;
}
function currentTestInfo() {
return currentTestInfoValue;
}
let currentFileSuite;
function setCurrentlyLoadingFileSuite(suite) {
currentFileSuite = suite;
}
function currentlyLoadingFileSuite() {
return currentFileSuite;
}
let _isWorkerProcess = false;
function setIsWorkerProcess() {
_isWorkerProcess = true;
}
function isWorkerProcess() {
return _isWorkerProcess;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
currentTestInfo,
currentlyLoadingFileSuite,
isWorkerProcess,
setCurrentTestInfo,
setCurrentlyLoadingFileSuite,
setIsWorkerProcess
});

779
frontend/node_modules/playwright/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,779 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var index_exports = {};
__export(index_exports, {
_baseTest: () => _baseTest,
_utilityTest: () => _utilityTest,
defineConfig: () => import_common2.defineConfig,
expect: () => import_expect.expect,
mergeExpects: () => import_expect2.mergeExpects,
mergeTests: () => import_common2.mergeTests,
test: () => test
});
module.exports = __toCommonJS(index_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var playwrightLibrary = __toESM(require("playwright-core"));
var import_errorContext = require("./errorContext");
var import_common = require("./common");
var globals = __toESM(require("./globals"));
var import_package = require("./package");
var import_browserBackend = require("./mcp/test/browserBackend");
var import_expect = require("./matchers/expect");
var import_common2 = require("./common");
var import_expect2 = require("./matchers/expect");
const { asLocatorDescription } = require("playwright-core/lib/coreBundle").iso;
const { getActionGroup, renderTitleForCall } = require("playwright-core/lib/coreBundle").iso;
const { escapeHTML } = require("playwright-core/lib/coreBundle").iso;
const { jsonStringifyForceASCII } = require("playwright-core/lib/coreBundle").utils;
const { createGuid } = require("playwright-core/lib/coreBundle").utils;
const { debugMode } = require("playwright-core/lib/coreBundle").utils;
const { setBoxedStackPrefixes } = require("playwright-core/lib/coreBundle").utils;
const { currentZone } = require("playwright-core/lib/coreBundle").utils;
const _baseTest = import_common.testType.rootTestType.test;
setBoxedStackPrefixes([import_package.packageRoot]);
if (process["__pw_initiator__"]) {
const originalStackTraceLimit = Error.stackTraceLimit;
Error.stackTraceLimit = 200;
try {
throw new Error("Requiring @playwright/test second time, \nFirst:\n" + process["__pw_initiator__"] + "\n\nSecond: ");
} finally {
Error.stackTraceLimit = originalStackTraceLimit;
}
} else {
process["__pw_initiator__"] = new Error().stack;
}
const utilityFixtures = {
playwright: [async ({}, use) => {
await use(require("playwright-core"));
}, { scope: "worker", box: true }],
screenshot: ["off", { scope: "worker", option: true, box: true }],
trace: ["off", { scope: "worker", option: true, box: true }],
testIdAttribute: ["data-testid", { option: true, box: true }],
_combinedContextOptions: [{}, { box: true }],
_setupArtifacts: [async ({ playwright, screenshot, _combinedContextOptions }, use, testInfo) => {
testInfo.setTimeout(testInfo.project.timeout);
const artifactsRecorder = new ArtifactsRecorder(playwright, tracing().artifactsDir(), screenshot);
await artifactsRecorder.willStartTest(testInfo);
const tracingGroupSteps = [];
const pausedContexts = /* @__PURE__ */ new Set();
const csiListener = {
onApiCallBegin: (data, channel) => {
const testInfo2 = globals.currentTestInfo();
if (!testInfo2 || data.apiName.includes("setTestIdAttribute") || data.apiName === "tracing.groupEnd")
return;
const zone = currentZone().data("stepZone");
const isExpectCall = data.apiName === "locator._expect" || data.apiName === "frame._expect" || data.apiName === "page._expectScreenshot";
if (zone && zone.category === "expect" && isExpectCall) {
if (zone.apiName)
data.apiName = zone.apiName;
if (zone.shortTitle || zone.title)
data.title = zone.shortTitle ?? zone.title;
data.stepId = zone.stepId;
return;
}
const step = testInfo2._addStep({
location: data.frames[0],
category: "pw:api",
title: renderTitle(channel.type, channel.method, channel.params, data.title),
apiName: data.apiName,
params: channel.params,
group: getActionGroup({ type: channel.type, method: channel.method })
}, tracingGroupSteps[tracingGroupSteps.length - 1]);
data.userData = step;
data.stepId = step.stepId;
if (data.apiName === "tracing.group")
tracingGroupSteps.push(step);
},
onApiCallEnd: (data) => {
if (data.apiName === "tracing.group")
return;
if (data.apiName === "tracing.groupEnd") {
const step2 = tracingGroupSteps.pop();
step2?.complete({ error: data.error });
return;
}
const step = data.userData;
step?.complete({ error: data.error });
},
onWillPause: ({ keepTestTimeout }) => {
if (!keepTestTimeout)
globals.currentTestInfo()?._setIgnoreTimeouts(true);
},
runBeforeCreateBrowserContext: async (options) => {
for (const [key, value] of Object.entries(_combinedContextOptions)) {
if (!(key in options))
options[key] = value;
}
},
runBeforeCreateRequestContext: async (options) => {
for (const [key, value] of Object.entries(_combinedContextOptions)) {
if (!(key in options))
options[key] = value;
}
},
runAfterCreateBrowserContext: async (context) => {
context.debugger.on("pausedstatechanged", () => {
const paused = !!context.debugger.pausedDetails();
if (pausedContexts.has(context) && !paused) {
pausedContexts.delete(context);
testInfo._setIgnoreTimeouts(false);
} else if (!pausedContexts.has(context) && paused) {
pausedContexts.add(context);
testInfo._setIgnoreTimeouts(true);
}
});
await artifactsRecorder.didCreateBrowserContext(context);
const currentTestInfo = globals.currentTestInfo();
if (currentTestInfo) {
attachConnectedHeaderIfNeeded(currentTestInfo, context.browser());
currentTestInfo._onCustomMessageCallback = (0, import_browserBackend.createCustomMessageHandler)(currentTestInfo, context);
await (0, import_browserBackend.runDaemonForContext)(currentTestInfo, context);
}
},
runAfterCreateRequestContext: async (context) => {
await artifactsRecorder.didCreateRequestContext(context);
},
runBeforeCloseBrowserContext: async (context) => {
await artifactsRecorder.willCloseBrowserContext(context);
},
runBeforeCloseRequestContext: async (context) => {
await artifactsRecorder.willCloseRequestContext(context);
}
};
const clientInstrumentation = playwright._instrumentation;
clientInstrumentation.addListener(csiListener);
await use();
clientInstrumentation.removeListener(csiListener);
await artifactsRecorder.didFinishTest();
}, { auto: "all-hooks-included", title: "trace recording", box: true, timeout: 0 }],
request: async ({ playwright }, use) => {
const request = await playwright.request.newContext();
await use(request);
const hook = test.info()._currentHookType();
if (hook === "beforeAll") {
await request.dispose({ reason: [
`Fixture { request } from beforeAll cannot be reused in a test.`,
` - Recommended fix: use a separate { request } in the test.`,
` - Alternatively, manually create APIRequestContext in beforeAll and dispose it in afterAll.`,
`See https://playwright.dev/docs/api-testing#sending-api-requests-from-ui-tests for more details.`
].join("\n") });
} else {
await request.dispose();
}
}
};
const _utilityTest = _baseTest.extend(utilityFixtures);
const playwrightFixtures = {
defaultBrowserType: ["chromium", { scope: "worker", option: true, box: true }],
browserName: [({ defaultBrowserType }, use) => use(defaultBrowserType), { scope: "worker", option: true, box: true }],
headless: [({ launchOptions }, use) => use(launchOptions.headless ?? true), { scope: "worker", option: true, box: true }],
channel: [({ launchOptions }, use) => use(launchOptions.channel), { scope: "worker", option: true, box: true }],
launchOptions: [{}, { scope: "worker", option: true, box: true }],
connectOptions: [async ({ _optionConnectOptions }, use) => {
await use(connectOptionsFromEnv() || _optionConnectOptions);
}, { scope: "worker", option: true, box: true }],
video: ["off", { scope: "worker", option: true, box: true }],
_browserOptions: [async ({ playwright, headless, channel, launchOptions }, use) => {
const options = {
handleSIGINT: false,
...launchOptions,
tracesDir: tracing().tracesDir(),
artifactsDir: tracing().artifactsDir()
};
if (headless !== void 0)
options.headless = headless;
if (channel !== void 0)
options.channel = channel;
playwright._defaultLaunchOptions = options;
await use(options);
playwright._defaultLaunchOptions = void 0;
}, { scope: "worker", auto: true, box: true }],
browser: [async ({ playwright, browserName, _browserOptions, connectOptions }, use, workerInfo) => {
if (!["chromium", "firefox", "webkit"].includes(browserName))
throw new Error(`Unexpected browserName "${browserName}", must be one of "chromium", "firefox" or "webkit"`);
if (connectOptions) {
const browser2 = await playwright[browserName].connect(connectOptions.wsEndpoint, {
...connectOptions,
exposeNetwork: connectOptions.exposeNetwork,
headers: {
// HTTP headers are ASCII only (not UTF-8).
"x-playwright-launch-options": jsonStringifyForceASCII(_browserOptions),
...connectOptions.headers
}
});
await use(browser2);
await browser2.close({ reason: "Test ended." });
return;
}
const browser = await playwright[browserName].launch();
if (process.env.PLAYWRIGHT_DASHBOARD)
await browser.bind(`worker-${workerInfo.parallelIndex}`);
await use(browser);
await browser.close({ reason: "Test ended." });
}, { scope: "worker", timeout: 0 }],
acceptDownloads: [({ contextOptions }, use) => use(contextOptions.acceptDownloads ?? true), { option: true, box: true }],
bypassCSP: [({ contextOptions }, use) => use(contextOptions.bypassCSP ?? false), { option: true, box: true }],
colorScheme: [({ contextOptions }, use) => use(contextOptions.colorScheme === void 0 ? "light" : contextOptions.colorScheme), { option: true, box: true }],
deviceScaleFactor: [({ contextOptions }, use) => use(contextOptions.deviceScaleFactor), { option: true, box: true }],
extraHTTPHeaders: [({ contextOptions }, use) => use(contextOptions.extraHTTPHeaders), { option: true, box: true }],
geolocation: [({ contextOptions }, use) => use(contextOptions.geolocation), { option: true, box: true }],
hasTouch: [({ contextOptions }, use) => use(contextOptions.hasTouch ?? false), { option: true, box: true }],
httpCredentials: [({ contextOptions }, use) => use(contextOptions.httpCredentials), { option: true, box: true }],
ignoreHTTPSErrors: [({ contextOptions }, use) => use(contextOptions.ignoreHTTPSErrors ?? false), { option: true, box: true }],
isMobile: [({ contextOptions }, use) => use(contextOptions.isMobile ?? false), { option: true, box: true }],
javaScriptEnabled: [({ contextOptions }, use) => use(contextOptions.javaScriptEnabled ?? true), { option: true, box: true }],
locale: [({ contextOptions }, use) => use(contextOptions.locale ?? "en-US"), { option: true, box: true }],
offline: [({ contextOptions }, use) => use(contextOptions.offline ?? false), { option: true, box: true }],
permissions: [({ contextOptions }, use) => use(contextOptions.permissions), { option: true, box: true }],
proxy: [({ contextOptions }, use) => use(contextOptions.proxy), { option: true, box: true }],
storageState: [({ contextOptions }, use) => use(contextOptions.storageState), { option: true, box: true }],
clientCertificates: [({ contextOptions }, use) => use(contextOptions.clientCertificates), { option: true, box: true }],
timezoneId: [({ contextOptions }, use) => use(contextOptions.timezoneId), { option: true, box: true }],
userAgent: [({ contextOptions }, use) => use(contextOptions.userAgent), { option: true, box: true }],
viewport: [({ contextOptions }, use) => use(contextOptions.viewport === void 0 ? { width: 1280, height: 720 } : contextOptions.viewport), { option: true, box: true }],
actionTimeout: [0, { option: true, box: true }],
navigationTimeout: [0, { option: true, box: true }],
baseURL: [async ({}, use) => {
await use(process.env.PLAYWRIGHT_TEST_BASE_URL);
}, { option: true, box: true }],
serviceWorkers: [({ contextOptions }, use) => use(contextOptions.serviceWorkers ?? "allow"), { option: true, box: true }],
contextOptions: [{}, { option: true, box: true }],
_combinedContextOptions: [async ({
acceptDownloads,
bypassCSP,
clientCertificates,
colorScheme,
deviceScaleFactor,
extraHTTPHeaders,
hasTouch,
geolocation,
httpCredentials,
ignoreHTTPSErrors,
isMobile,
javaScriptEnabled,
locale,
offline,
permissions,
proxy,
storageState,
viewport,
timezoneId,
userAgent,
baseURL,
contextOptions,
serviceWorkers
}, use, testInfo) => {
const options = {};
if (acceptDownloads !== void 0)
options.acceptDownloads = acceptDownloads;
if (bypassCSP !== void 0)
options.bypassCSP = bypassCSP;
if (colorScheme !== void 0)
options.colorScheme = colorScheme;
if (deviceScaleFactor !== void 0)
options.deviceScaleFactor = deviceScaleFactor;
if (extraHTTPHeaders !== void 0)
options.extraHTTPHeaders = extraHTTPHeaders;
if (geolocation !== void 0)
options.geolocation = geolocation;
if (hasTouch !== void 0)
options.hasTouch = hasTouch;
if (httpCredentials !== void 0)
options.httpCredentials = httpCredentials;
if (ignoreHTTPSErrors !== void 0)
options.ignoreHTTPSErrors = ignoreHTTPSErrors;
if (isMobile !== void 0)
options.isMobile = isMobile;
if (javaScriptEnabled !== void 0)
options.javaScriptEnabled = javaScriptEnabled;
if (locale !== void 0)
options.locale = locale;
if (offline !== void 0)
options.offline = offline;
if (permissions !== void 0)
options.permissions = permissions;
if (proxy !== void 0)
options.proxy = proxy;
if (storageState !== void 0)
options.storageState = storageState;
if (clientCertificates?.length)
options.clientCertificates = resolveClientCerticates(clientCertificates);
if (timezoneId !== void 0)
options.timezoneId = timezoneId;
if (userAgent !== void 0)
options.userAgent = userAgent;
if (viewport !== void 0)
options.viewport = viewport;
if (baseURL !== void 0)
options.baseURL = baseURL;
if (serviceWorkers !== void 0)
options.serviceWorkers = serviceWorkers;
await use({
...contextOptions,
...options
});
}, { scope: "test", box: true }],
_setupContextOptions: [async ({ playwright, actionTimeout, navigationTimeout, testIdAttribute }, use, _testInfo) => {
const testInfo = _testInfo;
if (testIdAttribute)
playwrightLibrary.selectors.setTestIdAttribute(testIdAttribute);
testInfo.snapshotSuffix = process.platform;
testInfo._onCustomMessageCallback = () => Promise.reject(new Error("Only tests that use default Playwright context or page fixture support test_debug"));
if (debugMode() === "inspector")
testInfo._setIgnoreTimeouts(true);
playwright._defaultContextTimeout = actionTimeout || 0;
playwright._defaultContextNavigationTimeout = navigationTimeout || 0;
await use();
playwright._defaultContextTimeout = void 0;
playwright._defaultContextNavigationTimeout = void 0;
}, { auto: "all-hooks-included", title: "context configuration", box: true }],
_contextFactory: [async ({
browser,
video,
_reuseContext,
_combinedContextOptions
/** mitigate dep-via-auto lack of traceability */
}, use, testInfo) => {
const testInfoImpl = testInfo;
const videoMode = normalizeVideoMode(video);
const captureVideo = shouldCaptureVideo(videoMode, testInfo) && !_reuseContext;
const contexts = /* @__PURE__ */ new Map();
let counter = 0;
await use(async (options) => {
const hook = testInfoImpl._currentHookType();
if (hook === "beforeAll" || hook === "afterAll") {
throw new Error([
`"context" and "page" fixtures are not supported in "${hook}" since they are created on a per-test basis.`,
`If you would like to reuse a single page between tests, create context manually with browser.newContext(). See https://aka.ms/playwright/reuse-page for details.`,
`If you would like to configure your page before each test, do that in beforeEach hook instead.`
].join("\n"));
}
const show = typeof video === "string" ? void 0 : video.show;
const videoOptions = captureVideo ? {
recordVideo: {
dir: tracing().artifactsDir(),
size: typeof video === "string" ? void 0 : video.size,
showActions: show?.actions
}
} : {};
const context = await browser.newContext({ ...videoOptions, ...options });
if (process.env.PW_CLOCK === "frozen") {
await context._wrapApiCall(async () => {
await context.clock.install({ time: 0 });
await context.clock.pauseAt(1e3);
}, { internal: true });
} else if (process.env.PW_CLOCK === "realtime") {
await context._wrapApiCall(async () => {
await context.clock.install({ time: 0 });
}, { internal: true });
}
let closed = false;
const close = async () => {
if (closed)
return;
closed = true;
const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
await context.close({ reason: closeReason });
const testFailed = testInfo.status !== testInfo.expectedStatus;
const preserveVideo = captureVideo && (videoMode === "on" || testFailed && videoMode === "retain-on-failure" || videoMode === "on-first-retry" && testInfo.retry === 1);
if (preserveVideo) {
const { pagesWithVideo: pagesForVideo } = contexts.get(context);
const videos = pagesForVideo.map((p) => p.video()).filter((video2) => !!video2);
await Promise.all(videos.map(async (v) => {
try {
const savedPath = testInfo.outputPath(`video${counter ? "-" + counter : ""}.webm`);
++counter;
await v.saveAs(savedPath);
testInfo.attachments.push({ name: "video", path: savedPath, contentType: "video/webm" });
} catch (e) {
}
}));
}
};
const contextData = { close, pagesWithVideo: [] };
if (captureVideo)
context.on("page", (page) => contextData.pagesWithVideo.push(page));
contexts.set(context, contextData);
return { context, close };
});
await Promise.all([...contexts.values()].map((data) => data.close()));
}, { scope: "test", title: "context", box: true }],
_optionContextReuseMode: ["none", { scope: "worker", option: true, box: true }],
_optionConnectOptions: [void 0, { scope: "worker", option: true, box: true }],
_reuseContext: [async ({ video, _optionContextReuseMode }, use) => {
let mode = _optionContextReuseMode;
if (process.env.PW_TEST_REUSE_CONTEXT)
mode = "when-possible";
const reuse = mode === "when-possible" && normalizeVideoMode(video) === "off";
await use(reuse);
}, { scope: "worker", title: "context", box: true }],
context: async ({ browser, video, _reuseContext, _contextFactory }, use, testInfoPublic) => {
const browserImpl = browser;
const testInfo = testInfoPublic;
const show = typeof video === "string" ? void 0 : video.show;
attachConnectedHeaderIfNeeded(testInfo, browserImpl);
if (!_reuseContext) {
const { context: context2, close } = await _contextFactory();
await installScreencastTitleUpdater(testInfo, context2, show?.test);
await use(context2);
await close();
return;
}
const context = await browserImpl._wrapApiCall(() => browserImpl._newContextForReuse(), { internal: true });
await installScreencastTitleUpdater(testInfo, context, show?.test);
await use(context);
const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
await browserImpl._wrapApiCall(() => browserImpl._disconnectFromReusedContext(closeReason), { internal: true });
},
page: async ({ context, _reuseContext }, use) => {
if (!_reuseContext) {
await use(await context.newPage());
return;
}
let [page] = context.pages();
if (!page)
page = await context.newPage();
await use(page);
}
};
function normalizeVideoMode(video) {
if (!video)
return "off";
let videoMode = typeof video === "string" ? video : video.mode;
if (videoMode === "retry-with-video")
videoMode = "on-first-retry";
return videoMode;
}
function shouldCaptureVideo(videoMode, testInfo) {
return videoMode === "on" || videoMode === "retain-on-failure" || videoMode === "on-first-retry" && testInfo.retry === 1;
}
function normalizeScreenshotMode(screenshot) {
if (!screenshot)
return "off";
return typeof screenshot === "string" ? screenshot : screenshot.mode;
}
function attachConnectedHeaderIfNeeded(testInfo, browser) {
const connectHeaders = browser?._connection.headers;
if (!connectHeaders)
return;
for (const header of connectHeaders) {
if (header.name !== "x-playwright-attachment")
continue;
const [name, value] = header.value.split("=");
if (!name || !value)
continue;
if (testInfo.attachments.some((attachment) => attachment.name === name))
continue;
testInfo.attachments.push({ name, contentType: "text/plain", body: Buffer.from(value) });
}
}
function resolveFileToConfig(file) {
const config2 = test.info().config.configFile;
if (!config2 || !file)
return file;
if (import_path.default.isAbsolute(file))
return file;
return import_path.default.resolve(import_path.default.dirname(config2), file);
}
function resolveClientCerticates(clientCertificates) {
for (const cert of clientCertificates) {
cert.certPath = resolveFileToConfig(cert.certPath);
cert.keyPath = resolveFileToConfig(cert.keyPath);
cert.pfxPath = resolveFileToConfig(cert.pfxPath);
}
return clientCertificates;
}
const kTracingStarted = Symbol("kTracingStarted");
function connectOptionsFromEnv() {
const wsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT;
if (!wsEndpoint)
return void 0;
const headers = process.env.PW_TEST_CONNECT_HEADERS ? JSON.parse(process.env.PW_TEST_CONNECT_HEADERS) : void 0;
return {
wsEndpoint,
headers,
exposeNetwork: process.env.PW_TEST_CONNECT_EXPOSE_NETWORK
};
}
class SnapshotRecorder {
constructor(_artifactsRecorder, _mode, _name, _contentType, _extension, _doSnapshot) {
this._artifactsRecorder = _artifactsRecorder;
this._mode = _mode;
this._name = _name;
this._contentType = _contentType;
this._extension = _extension;
this._doSnapshot = _doSnapshot;
this._ordinal = 0;
this._temporary = [];
}
fixOrdinal() {
this._ordinal = this.testInfo.attachments.filter((a) => a.name === this._name).length;
}
shouldCaptureUponFinish() {
return this._mode === "on" || this._mode === "only-on-failure" && this.testInfo._isFailure() || this._mode === "on-first-failure" && this.testInfo._isFailure() && this.testInfo.retry === 0;
}
async maybeCapture() {
if (!this.shouldCaptureUponFinish())
return;
await Promise.all(this._artifactsRecorder._playwright._allPages().map((page) => this._snapshotPage(page, false)));
}
async persistTemporary() {
if (this.shouldCaptureUponFinish()) {
await Promise.all(this._temporary.map(async (file) => {
try {
const path2 = this._createAttachmentPath();
await import_fs.default.promises.rename(file, path2);
this._attach(path2);
} catch {
}
}));
}
}
async captureTemporary(context) {
if (this._mode === "on" || this._mode === "only-on-failure" || this._mode === "on-first-failure" && this.testInfo.retry === 0)
await Promise.all(context.pages().map((page) => this._snapshotPage(page, true)));
}
_attach(screenshotPath) {
this.testInfo.attachments.push({ name: this._name, path: screenshotPath, contentType: this._contentType });
}
_createAttachmentPath() {
const testFailed = this.testInfo._isFailure();
const index = this._ordinal + 1;
++this._ordinal;
const path2 = this.testInfo.outputPath(`test-${testFailed ? "failed" : "finished"}-${index}${this._extension}`);
return path2;
}
_createTemporaryArtifact(...name) {
const file = import_path.default.join(this._artifactsRecorder._artifactsDir, ...name);
return file;
}
async _snapshotPage(page, temporary) {
if (page[this.testInfo._uniqueSymbol])
return;
page[this.testInfo._uniqueSymbol] = true;
try {
const path2 = temporary ? this._createTemporaryArtifact(createGuid() + this._extension) : this._createAttachmentPath();
await this._doSnapshot(page, path2);
if (temporary)
this._temporary.push(path2);
else
this._attach(path2);
} catch {
}
}
get testInfo() {
return this._artifactsRecorder._testInfo;
}
}
class ArtifactsRecorder {
constructor(playwright, artifactsDir, screenshot) {
this._playwright = playwright;
this._artifactsDir = artifactsDir;
const screenshotOptions = typeof screenshot === "string" ? void 0 : screenshot;
this._startedCollectingArtifacts = Symbol("startedCollectingArtifacts");
this._screenshotRecorder = new SnapshotRecorder(this, normalizeScreenshotMode(screenshot), "screenshot", "image/png", ".png", async (page, path2) => {
await page._wrapApiCall(async () => {
await page.screenshot({ ...screenshotOptions, timeout: 5e3, path: path2, caret: "initial" });
}, { internal: true });
});
}
async willStartTest(testInfo) {
this._testInfo = testInfo;
testInfo._onDidFinishTestFunctionCallbacks.add(() => this.didFinishTestFunction());
this._screenshotRecorder.fixOrdinal();
await Promise.all(this._playwright._allContexts().map((context) => this.didCreateBrowserContext(context)));
const existingApiRequests = Array.from(this._playwright.request._contexts);
await Promise.all(existingApiRequests.map((c) => this.didCreateRequestContext(c)));
}
async didCreateBrowserContext(context) {
await this._startTraceChunkOnContextCreation(context, context.tracing);
}
async willCloseBrowserContext(context) {
await this._stopTracing(context, context.tracing);
await this._screenshotRecorder.captureTemporary(context);
await this._takePageSnapshot(context);
}
async _takePageSnapshot(context) {
if (process.env.PLAYWRIGHT_NO_COPY_PROMPT)
return;
if (this._testInfo.errors.length === 0)
return;
if (this._testInfo.errors.some((e) => e.errorContext))
return;
if (this._pageSnapshot)
return;
const page = context.pages()[0];
if (!page)
return;
try {
await page._wrapApiCall(async () => {
this._pageSnapshot = await page.ariaSnapshot({ mode: "ai", timeout: 5e3 });
}, { internal: true });
} catch {
}
}
async didCreateRequestContext(context) {
await this._startTraceChunkOnContextCreation(context, context.tracing);
}
async willCloseRequestContext(context) {
await this._stopTracing(context, context.tracing);
}
async didFinishTestFunction() {
await this._screenshotRecorder.maybeCapture();
}
async didFinishTest() {
await this.didFinishTestFunction();
const leftoverContexts = this._playwright._allContexts();
const leftoverApiRequests = Array.from(this._playwright.request._contexts);
await Promise.all(leftoverContexts.map(async (context2) => {
await this._stopTracing(context2, context2.tracing);
}).concat(leftoverApiRequests.map(async (context2) => {
await this._stopTracing(context2, context2.tracing);
})));
await this._screenshotRecorder.persistTemporary();
const context = leftoverContexts[0];
if (context)
await this._takePageSnapshot(context);
if (this._testInfo.errors.length > 0) {
const hasMatcherAriaSnapshot = this._testInfo.errors.some((e) => e.errorContext);
const errorContextContent = (0, import_errorContext.buildErrorContext)({
titlePath: this._testInfo.titlePath,
location: { file: this._testInfo.file, line: this._testInfo.line, column: this._testInfo.column },
errors: this._testInfo.errors,
pageSnapshot: hasMatcherAriaSnapshot ? void 0 : this._pageSnapshot
});
if (errorContextContent) {
const filePath = this._testInfo.outputPath("error-context.md");
await import_fs.default.promises.writeFile(filePath, errorContextContent, "utf8");
this._testInfo._attach({
name: "error-context",
contentType: "text/markdown",
path: filePath
}, void 0);
}
}
}
async _startTraceChunkOnContextCreation(channelOwner, tracing2) {
await channelOwner._wrapApiCall(async () => {
const options = this._testInfo._tracing.traceOptions();
if (options) {
const title = this._testInfo._tracing.traceTitle();
const name = this._testInfo._tracing.generateNextTraceRecordingName();
if (!tracing2[kTracingStarted]) {
await tracing2.start({ ...options, title, name });
tracing2[kTracingStarted] = true;
} else {
await tracing2.startChunk({ title, name });
}
} else {
if (tracing2[kTracingStarted]) {
tracing2[kTracingStarted] = false;
await tracing2.stop();
}
}
}, { internal: true });
}
async _stopTracing(channelOwner, tracing2) {
await channelOwner._wrapApiCall(async () => {
if (tracing2[this._startedCollectingArtifacts])
return;
tracing2[this._startedCollectingArtifacts] = true;
if (this._testInfo._tracing.traceOptions() && tracing2[kTracingStarted])
await tracing2.stopChunk({ path: this._testInfo._tracing.maybeGenerateNextTraceRecordingPath() });
}, { internal: true });
}
}
async function installScreencastTitleUpdater(testInfo, context, testAnnotate) {
if (!testAnnotate)
return;
const testTitle = testAnnotate.level === "file" ? [testInfo.titlePath[0]] : testInfo.titlePath;
const stepStack = [];
const overlays = /* @__PURE__ */ new Map();
const position = testAnnotate.position ?? "top-left";
const fontSize = testAnnotate.fontSize ?? 14;
const level = testAnnotate.level ?? "step";
const updateOverlay = async () => {
const parts = level === "step" ? [...testTitle, ...stepStack] : testTitle;
const html = createTestOverlay(parts, position, fontSize);
for (const page of context.pages()) {
await overlays.get(page)?.dispose();
overlays.delete(page);
const disposable = await page.screencast.showOverlay(html);
overlays.set(page, disposable);
}
};
testInfo._onUserStepBegin = async (title) => {
stepStack.push(title);
await updateOverlay();
};
testInfo._onUserStepEnd = async () => {
stepStack.pop();
await updateOverlay();
};
context.on("page", async () => {
void updateOverlay();
});
await updateOverlay();
}
function createTestOverlay(parts, position, fontSize) {
const positionStyles = {
"top-left": "top: 6px; left: 6px;",
"top": "top: 6px; left: 50%; transform: translateX(-50%);",
"top-right": "top: 6px; right: 6px;",
"bottom-left": "bottom: 6px; left: 6px;",
"bottom": "bottom: 6px; left: 50%; transform: translateX(-50%);",
"bottom-right": "bottom: 6px; right: 6px;"
};
const posStyle = positionStyles[position] ?? positionStyles["top-left"];
return `<div style="white-space: nowrap; font-size: ${fontSize}px; padding: 3px 6px; background: rgba(0,0,0,0.5); color: white; border-radius: 4px; position: absolute; ${posStyle}">
${parts.map((p) => `<div>${escapeHTML(p)}</div>`).join("")}
</div>`;
}
function renderTitle(type, method, params, title) {
const prefix = renderTitleForCall({ title, type, method, params });
let selector;
if (params?.["selector"] && typeof params.selector === "string")
selector = asLocatorDescription("javascript", params.selector);
return prefix + (selector ? ` ${selector}` : "");
}
function tracing() {
return test.info()._tracing;
}
const test = _utilityTest.extend(playwrightFixtures);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
_baseTest,
_utilityTest,
defineConfig,
expect,
mergeExpects,
mergeTests,
test
});

260
frontend/node_modules/playwright/lib/isomorphic.js generated vendored Normal file
View File

@@ -0,0 +1,260 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// packages/playwright/src/isomorphic/index.ts
var index_exports = {};
__export(index_exports, {
TestServerConnection: () => TestServerConnection,
TestServerConnectionClosedError: () => TestServerConnectionClosedError,
WebSocketTestServerTransport: () => WebSocketTestServerTransport
});
module.exports = __toCommonJS(index_exports);
// packages/playwright/src/isomorphic/events.ts
var Disposable;
((Disposable2) => {
function disposeAll(disposables) {
for (const disposable of disposables.splice(0))
disposable.dispose();
}
Disposable2.disposeAll = disposeAll;
})(Disposable || (Disposable = {}));
var EventEmitter = class {
constructor() {
this._listeners = /* @__PURE__ */ new Set();
this.event = (listener, disposables) => {
this._listeners.add(listener);
let disposed = false;
const self = this;
const result = {
dispose() {
if (!disposed) {
disposed = true;
self._listeners.delete(listener);
}
}
};
if (disposables)
disposables.push(result);
return result;
};
}
fire(event) {
const dispatch = !this._deliveryQueue;
if (!this._deliveryQueue)
this._deliveryQueue = [];
for (const listener of this._listeners)
this._deliveryQueue.push({ listener, event });
if (!dispatch)
return;
for (let index = 0; index < this._deliveryQueue.length; index++) {
const { listener, event: event2 } = this._deliveryQueue[index];
listener.call(null, event2);
}
this._deliveryQueue = void 0;
}
dispose() {
this._listeners.clear();
if (this._deliveryQueue)
this._deliveryQueue = [];
}
};
// packages/playwright/src/isomorphic/testServerConnection.ts
var TestServerConnectionClosedError = class extends Error {
};
var WebSocketTestServerTransport = class {
constructor(url) {
this._ws = new WebSocket(url);
}
onmessage(listener) {
this._ws.addEventListener("message", (event) => listener(event.data.toString()));
}
onopen(listener) {
this._ws.addEventListener("open", listener);
}
onerror(listener) {
this._ws.addEventListener("error", listener);
}
onclose(listener) {
this._ws.addEventListener("close", listener);
}
send(data) {
this._ws.send(data);
}
close() {
this._ws.close();
}
};
var TestServerConnection = class {
constructor(transport) {
this._onCloseEmitter = new EventEmitter();
this._onReportEmitter = new EventEmitter();
this._onStdioEmitter = new EventEmitter();
this._onTestFilesChangedEmitter = new EventEmitter();
this._onLoadTraceRequestedEmitter = new EventEmitter();
this._onTestPausedEmitter = new EventEmitter();
this._lastId = 0;
this._callbacks = /* @__PURE__ */ new Map();
this._isClosed = false;
this.onClose = this._onCloseEmitter.event;
this.onReport = this._onReportEmitter.event;
this.onStdio = this._onStdioEmitter.event;
this.onTestFilesChanged = this._onTestFilesChangedEmitter.event;
this.onLoadTraceRequested = this._onLoadTraceRequestedEmitter.event;
this.onTestPaused = this._onTestPausedEmitter.event;
this._transport = transport;
this._transport.onmessage((data) => {
const message = JSON.parse(data);
const { id, result, error, method, params } = message;
if (id) {
const callback = this._callbacks.get(id);
if (!callback)
return;
this._callbacks.delete(id);
if (error)
callback.reject(new Error(error));
else
callback.resolve(result);
} else {
this._dispatchEvent(method, params);
}
});
const pingInterval = setInterval(() => this._sendMessage("ping").catch(() => {
}), 3e4);
this._connectedPromise = new Promise((f, r) => {
this._transport.onopen(f);
this._transport.onerror(r);
});
this._transport.onclose(() => {
this._isClosed = true;
this._onCloseEmitter.fire();
clearInterval(pingInterval);
for (const callback of this._callbacks.values())
callback.reject(callback.error);
this._callbacks.clear();
});
}
isClosed() {
return this._isClosed;
}
async _sendMessage(method, params) {
const logForTest = globalThis.__logForTest;
logForTest?.({ method, params });
await this._connectedPromise;
const id = ++this._lastId;
const message = { id, method, params };
const error = new TestServerConnectionClosedError(`${method}: test server connection closed`);
this._transport.send(JSON.stringify(message));
return new Promise((resolve, reject) => {
this._callbacks.set(id, { resolve, reject, error });
});
}
_sendMessageNoReply(method, params) {
this._sendMessage(method, params).catch(() => {
});
}
_dispatchEvent(method, params) {
if (method === "report")
this._onReportEmitter.fire(params);
else if (method === "stdio")
this._onStdioEmitter.fire(params);
else if (method === "testFilesChanged")
this._onTestFilesChangedEmitter.fire(params);
else if (method === "loadTraceRequested")
this._onLoadTraceRequestedEmitter.fire(params);
else if (method === "testPaused")
this._onTestPausedEmitter.fire(params);
}
async initialize(params) {
await this._sendMessage("initialize", params);
}
async ping(params) {
await this._sendMessage("ping", params);
}
async pingNoReply(params) {
this._sendMessageNoReply("ping", params);
}
async watch(params) {
await this._sendMessage("watch", params);
}
watchNoReply(params) {
this._sendMessageNoReply("watch", params);
}
async open(params) {
await this._sendMessage("open", params);
}
openNoReply(params) {
this._sendMessageNoReply("open", params);
}
async resizeTerminal(params) {
await this._sendMessage("resizeTerminal", params);
}
resizeTerminalNoReply(params) {
this._sendMessageNoReply("resizeTerminal", params);
}
async checkBrowsers(params) {
return await this._sendMessage("checkBrowsers", params);
}
async installBrowsers(params) {
await this._sendMessage("installBrowsers", params);
}
async runGlobalSetup(params) {
return await this._sendMessage("runGlobalSetup", params);
}
async runGlobalTeardown(params) {
return await this._sendMessage("runGlobalTeardown", params);
}
async clearCache(params) {
return await this._sendMessage("clearCache", params);
}
async listFiles(params) {
return await this._sendMessage("listFiles", params);
}
async listTests(params) {
return await this._sendMessage("listTests", params);
}
async runTests(params) {
return await this._sendMessage("runTests", params);
}
async findRelatedTestFiles(params) {
return await this._sendMessage("findRelatedTestFiles", params);
}
async stopTests(params) {
await this._sendMessage("stopTests", params);
}
stopTestsNoReply(params) {
this._sendMessageNoReply("stopTests", params);
}
async closeGracefully(params) {
await this._sendMessage("closeGracefully", params);
}
close() {
try {
this._transport.close();
} catch {
}
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
TestServerConnection,
TestServerConnectionClosedError,
WebSocketTestServerTransport
});

View File

@@ -0,0 +1,9 @@
# packages/playwright/lib/isomorphic.js
# total: 8.0 KB
## Inlined (3)
1.3 KB packages/playwright/src/isomorphic/events.ts
0.3 KB packages/playwright/src/isomorphic/index.ts
5.3 KB packages/playwright/src/isomorphic/testServerConnection.ts
## External (0)

View File

@@ -0,0 +1,34 @@
"use strict";
// packages/playwright/src/loader/loaderProcessEntry.ts
var import_common2 = require("../common");
// packages/playwright/src/loader/loaderMain.ts
var import_common = require("../common");
var LoaderMain = class extends import_common.ProcessRunner {
constructor(serializedConfig) {
super();
this._poolBuilder = import_common.poolBuilder.PoolBuilder.createForLoader();
this._serializedConfig = serializedConfig;
}
_config() {
if (!this._configPromise)
this._configPromise = import_common.configLoader.deserializeConfig(this._serializedConfig);
return this._configPromise;
}
async loadTestFile(params) {
const testErrors = [];
const config = await this._config();
const fileSuite = await import_common.testLoader.loadTestFile(params.file, config, testErrors);
this._poolBuilder.buildPools(fileSuite);
return { fileSuite: fileSuite._deepSerialize(), testErrors };
}
async getCompilationCacheFromLoader() {
await import_common.esm.incorporateCompilationCache();
return import_common.cc.serializeCompilationCache();
}
};
var create = (config) => new LoaderMain(config);
// packages/playwright/src/loader/loaderProcessEntry.ts
(0, import_common2.startProcessRunner)(create);

View File

@@ -0,0 +1,9 @@
# packages/playwright/lib/loader/loaderProcessEntry.js
# total: 1.2 KB
## Inlined (2)
1.0 KB packages/playwright/src/loader/loaderMain.ts
0.1 KB packages/playwright/src/loader/loaderProcessEntry.ts
## External (1)
../common

13050
frontend/node_modules/playwright/lib/matchers/expect.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,693 @@
packages/playwright/lib/matchers/expect.js
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
The following npm packages are inlined into this bundle.
- @babel/code-frame@7.29.0 (https://github.com/babel/babel)
- @babel/helper-validator-identifier@7.28.5 (https://github.com/babel/babel)
- @jest/diff-sequences@30.0.1 (https://github.com/jestjs/jest)
- @jest/expect-utils@30.2.0 (https://github.com/jestjs/jest)
- @jest/get-type@30.1.0 (https://github.com/jestjs/jest)
- ansi-styles@4.3.0 (https://github.com/chalk/ansi-styles)
- ansi-styles@5.2.0 (https://github.com/chalk/ansi-styles)
- braces@3.0.3 (https://github.com/micromatch/braces)
- chalk@4.1.2 (https://github.com/chalk/chalk)
- color-convert@2.0.1 (https://github.com/Qix-/color-convert)
- color-name@1.1.4 (https://github.com/colorjs/color-name)
- escape-string-regexp@2.0.0 (https://github.com/sindresorhus/escape-string-regexp)
- fill-range@7.1.1 (https://github.com/jonschlinkert/fill-range)
- graceful-fs@4.2.11 (https://github.com/isaacs/node-graceful-fs)
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
- is-number@7.0.0 (https://github.com/jonschlinkert/is-number)
- jest-diff@30.2.0 (https://github.com/jestjs/jest)
- jest-matcher-utils@30.2.0 (https://github.com/jestjs/jest)
- jest-message-util@30.2.0 (https://github.com/jestjs/jest)
- js-tokens@4.0.0 (https://github.com/lydell/js-tokens)
- micromatch@4.0.8 (https://github.com/micromatch/micromatch)
- picocolors@1.1.1 (https://github.com/alexeyraspopov/picocolors)
- picomatch@2.3.2 (https://github.com/micromatch/picomatch)
- pretty-format@30.2.0 (https://github.com/jestjs/jest)
- react-is@18.3.1 (https://github.com/facebook/react)
- slash@3.0.0 (https://github.com/sindresorhus/slash)
- stack-utils@2.0.6 (https://github.com/tapjs/stack-utils)
- supports-color@7.2.0 (https://github.com/chalk/supports-color)
- to-regex-range@5.0.1 (https://github.com/micromatch/to-regex-range)
%% @babel/code-frame@7.29.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/code-frame@7.29.0 NOTICES AND INFORMATION
%% @babel/helper-validator-identifier@7.28.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF @babel/helper-validator-identifier@7.28.5 NOTICES AND INFORMATION
%% @jest/diff-sequences@30.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jest/diff-sequences@30.0.1 NOTICES AND INFORMATION
%% @jest/expect-utils@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jest/expect-utils@30.2.0 NOTICES AND INFORMATION
%% @jest/get-type@30.1.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF @jest/get-type@30.1.0 NOTICES AND INFORMATION
%% ansi-styles@4.3.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF ansi-styles@4.3.0 NOTICES AND INFORMATION
%% ansi-styles@5.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF ansi-styles@5.2.0 NOTICES AND INFORMATION
%% braces@3.0.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF braces@3.0.3 NOTICES AND INFORMATION
%% chalk@4.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF chalk@4.1.2 NOTICES AND INFORMATION
%% color-convert@2.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF color-convert@2.0.1 NOTICES AND INFORMATION
%% color-name@1.1.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2015 Dmitry Ivanov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF color-name@1.1.4 NOTICES AND INFORMATION
%% escape-string-regexp@2.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF escape-string-regexp@2.0.0 NOTICES AND INFORMATION
%% fill-range@7.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF fill-range@7.1.1 NOTICES AND INFORMATION
%% graceful-fs@4.2.11 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License
Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF graceful-fs@4.2.11 NOTICES AND INFORMATION
%% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF has-flag@4.0.0 NOTICES AND INFORMATION
%% is-number@7.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF is-number@7.0.0 NOTICES AND INFORMATION
%% jest-diff@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF jest-diff@30.2.0 NOTICES AND INFORMATION
%% jest-matcher-utils@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF jest-matcher-utils@30.2.0 NOTICES AND INFORMATION
%% jest-message-util@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF jest-message-util@30.2.0 NOTICES AND INFORMATION
%% js-tokens@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF js-tokens@4.0.0 NOTICES AND INFORMATION
%% micromatch@4.0.8 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2014-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF micromatch@4.0.8 NOTICES AND INFORMATION
%% picocolors@1.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
ISC License
Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF picocolors@1.1.1 NOTICES AND INFORMATION
%% picomatch@2.3.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2017-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF picomatch@2.3.2 NOTICES AND INFORMATION
%% pretty-format@30.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright Contributors to the Jest project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF pretty-format@30.2.0 NOTICES AND INFORMATION
%% react-is@18.3.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF react-is@18.3.1 NOTICES AND INFORMATION
%% slash@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF slash@3.0.0 NOTICES AND INFORMATION
%% stack-utils@2.0.6 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2016-2022 Isaac Z. Schlueter <i@izs.me>, James Talmage <james@talmage.io> (github.com/jamestalmage), and Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF stack-utils@2.0.6 NOTICES AND INFORMATION
%% supports-color@7.2.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF supports-color@7.2.0 NOTICES AND INFORMATION
%% to-regex-range@5.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2015-present, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF to-regex-range@5.0.1 NOTICES AND INFORMATION
SUMMARY
=========================================
Total Packages: 29
=========================================

View File

@@ -0,0 +1,72 @@
# packages/playwright/lib/matchers/expect.js
# total: 513.7 KB
## Inlined (64)
7.9 KB node_modules/@babel/code-frame/lib/index.js
12.6 KB node_modules/@babel/helper-validator-identifier/lib/identifier.js
1.6 KB node_modules/@babel/helper-validator-identifier/lib/index.js
1.7 KB node_modules/@babel/helper-validator-identifier/lib/keyword.js
15.9 KB node_modules/@jest/diff-sequences/build/index.js
24.9 KB node_modules/@jest/expect-utils/build/index.js
0.8 KB node_modules/@jest/expect-utils/build/index.mjs
1.8 KB node_modules/@jest/get-type/build/index.js
4.8 KB node_modules/ansi-styles/index.js
1.9 KB node_modules/braces/index.js
1.7 KB node_modules/braces/lib/compile.js
2.1 KB node_modules/braces/lib/constants.js
3.1 KB node_modules/braces/lib/expand.js
7.0 KB node_modules/braces/lib/parse.js
0.9 KB node_modules/braces/lib/stringify.js
2.4 KB node_modules/braces/lib/utils.js
3.1 KB node_modules/chalk/node_modules/supports-color/index.js
5.8 KB node_modules/chalk/source/index.js
3.9 KB node_modules/chalk/source/templates.js
1.3 KB node_modules/chalk/source/util.js
18.7 KB node_modules/color-convert/conversions.js
1.8 KB node_modules/color-convert/index.js
2.1 KB node_modules/color-convert/route.js
5.2 KB node_modules/color-name/index.js
6.8 KB node_modules/fill-range/index.js
0.4 KB node_modules/has-flag/index.js
0.4 KB node_modules/is-number/index.js
53.2 KB node_modules/jest-diff/build/index.js
25.2 KB node_modules/jest-matcher-utils/build/index.js
2.7 KB node_modules/jest-matcher-utils/build/index.mjs
15.3 KB node_modules/jest-message-util/build/index.js
0.5 KB node_modules/jest-message-util/build/index.mjs
0.7 KB node_modules/jest-message-util/node_modules/graceful-fs/clone.js
12.2 KB node_modules/jest-message-util/node_modules/graceful-fs/graceful-fs.js
3.0 KB node_modules/jest-message-util/node_modules/graceful-fs/legacy-streams.js
9.3 KB node_modules/jest-message-util/node_modules/graceful-fs/polyfills.js
1.4 KB node_modules/js-tokens/index.js
5.8 KB node_modules/micromatch/index.js
0.2 KB node_modules/micromatch/node_modules/picomatch/index.js
5.3 KB node_modules/micromatch/node_modules/picomatch/lib/constants.js
33.9 KB node_modules/micromatch/node_modules/picomatch/lib/parse.js
5.3 KB node_modules/micromatch/node_modules/picomatch/lib/picomatch.js
9.6 KB node_modules/micromatch/node_modules/picomatch/lib/scan.js
2.2 KB node_modules/micromatch/node_modules/picomatch/lib/utils.js
3.1 KB node_modules/picocolors/picocolors.js
42.7 KB node_modules/pretty-format/build/index.js
4.4 KB node_modules/pretty-format/node_modules/ansi-styles/index.js
7.7 KB node_modules/pretty-format/node_modules/react-is/cjs/react-is.development.js
3.3 KB node_modules/pretty-format/node_modules/react-is/cjs/react-is.production.min.js
0.3 KB node_modules/pretty-format/node_modules/react-is/index.js
0.4 KB node_modules/slash/index.js
7.6 KB node_modules/stack-utils/index.js
0.4 KB node_modules/stack-utils/node_modules/escape-string-regexp/index.js
6.8 KB node_modules/to-regex-range/index.js
10.3 KB packages/playwright/src/matchers/expect.ts
45.2 KB packages/playwright/src/matchers/expectLibrary.ts
3.3 KB packages/playwright/src/matchers/matcherHint.ts
16.0 KB packages/playwright/src/matchers/matchers.ts
1.3 KB packages/playwright/src/matchers/toBeTruthy.ts
2.1 KB packages/playwright/src/matchers/toEqual.ts
2.4 KB packages/playwright/src/matchers/toHaveURL.ts
5.6 KB packages/playwright/src/matchers/toMatchAriaSnapshot.ts
15.1 KB packages/playwright/src/matchers/toMatchSnapshot.ts
3.0 KB packages/playwright/src/matchers/toMatchText.ts
## External (2)
playwright-core/lib/coreBundle
playwright-core/lib/utilsBundle

View File

@@ -0,0 +1,125 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var browserBackend_exports = {};
__export(browserBackend_exports, {
createCustomMessageHandler: () => createCustomMessageHandler,
runDaemonForContext: () => runDaemonForContext
});
module.exports = __toCommonJS(browserBackend_exports);
var import_crypto = __toESM(require("crypto"));
const { stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
function createCustomMessageHandler(testInfo, context) {
let backend;
const config = { capabilities: ["testing"] };
let tools;
context.once("close", () => {
void backend?.dispose();
backend = void 0;
});
return async (data) => {
if (!tools)
({ tools } = require("playwright-core/lib/coreBundle"));
const toolList = tools.filteredTools(config);
if (data.initialize) {
if (backend)
throw new Error("MCP backend is already initialized");
backend = new tools.BrowserBackend(config, context, toolList);
await backend.initialize(data.initialize.clientInfo);
const pausedMessage = await generatePausedMessage(tools, testInfo, context);
return { initialize: { pausedMessage } };
}
if (data.callTool) {
if (!backend)
throw new Error("MCP backend is not initialized");
return { callTool: await backend.callTool(data.callTool.name, data.callTool.arguments) };
}
if (data.close) {
await backend?.dispose();
backend = void 0;
return { close: {} };
}
throw new Error("Unknown MCP request");
};
}
async function generatePausedMessage(tools, testInfo, context) {
const lines = [];
if (testInfo.errors.length) {
lines.push(`### Paused on error:`);
for (const error of testInfo.errors)
lines.push(stripAnsiEscapes(error.message || ""));
} else {
lines.push(`### Paused at end of test. ready for interaction`);
}
for (let i = 0; i < context.pages().length; i++) {
const page = context.pages()[i];
const stateSuffix = context.pages().length > 1 ? i + 1 + " of " + context.pages().length : "state";
lines.push(
"",
`### Page ${stateSuffix}`,
`- Page URL: ${page.url()}`,
`- Page Title: ${await page.title()}`.trim()
);
let console2 = testInfo.errors.length ? await tools.Tab.collectConsoleMessages(page) : [];
console2 = console2.filter((msg) => msg.type === "error");
if (console2.length) {
lines.push("- Console Messages:");
for (const message of console2)
lines.push(` - ${message.toString()}`);
}
lines.push(
`- Page Snapshot:`,
"```yaml",
await page.ariaSnapshot({ mode: "ai" }),
"```"
);
}
lines.push("");
if (testInfo.errors.length)
lines.push(`### Task`, `Try recovering from the error prior to continuing`);
return lines.join("\n");
}
async function runDaemonForContext(testInfo, context) {
if (testInfo._configInternal.configCLIOverrides.debug !== "cli")
return false;
const sessionName = `tw-${import_crypto.default.randomBytes(3).toString("hex")}`;
await context.browser().bind(sessionName, { workspaceDir: testInfo.project.testDir });
console.log([
`### The test is currently paused at the start`,
``,
`### Debugging Instructions`,
`- Run "playwright-cli attach ${sessionName}" to attach to this test`
].join("\n"));
await context.debugger.requestPause();
return true;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
createCustomMessageHandler,
runDaemonForContext
});

View File

@@ -0,0 +1,122 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var generatorTools_exports = {};
__export(generatorTools_exports, {
generatorReadLog: () => generatorReadLog,
generatorWriteTest: () => generatorWriteTest,
setupPage: () => setupPage
});
module.exports = __toCommonJS(generatorTools_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_testTool = require("./testTool");
var import_testContext = require("./testContext");
const z = require("playwright-core/lib/utilsBundle").z;
const { isPathInside, resolveWithinRoot } = require("playwright-core/lib/coreBundle").utils;
const setupPage = (0, import_testTool.defineTestTool)({
schema: {
name: "generator_setup_page",
title: "Setup generator page",
description: "Setup the page for test.",
inputSchema: z.object({
plan: z.string().describe("The plan for the test. This should be the actual test plan with all the steps."),
project: z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
seedFile: z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
}),
type: "readOnly"
},
handle: async (context, params, signal) => {
const seed = await context.getOrCreateSeedFile(params.seedFile, params.project);
context.generatorJournal = new import_testContext.GeneratorJournal(context.rootPath, params.plan, seed);
const { output, status } = await context.runSeedTest(seed.file, seed.projectName, signal);
return { content: [{ type: "text", text: output }], isError: status !== "paused" };
}
});
const generatorReadLog = (0, import_testTool.defineTestTool)({
schema: {
name: "generator_read_log",
title: "Retrieve test log",
description: "Retrieve the performed test log",
inputSchema: z.object({}),
type: "readOnly"
},
handle: async (context) => {
if (!context.generatorJournal)
throw new Error(`Please setup page using "${setupPage.schema.name}" first.`);
const result = context.generatorJournal.journal();
return { content: [{
type: "text",
text: result
}] };
}
});
const generatorWriteTest = (0, import_testTool.defineTestTool)({
schema: {
name: "generator_write_test",
title: "Write test",
description: "Write the generated test to the test file",
inputSchema: z.object({
fileName: z.string().describe("The file to write the test to"),
code: z.string().describe("The generated test code")
}),
type: "readOnly"
},
handle: async (context, params) => {
if (!context.generatorJournal)
throw new Error(`Please setup page using "${setupPage.schema.name}" first.`);
const testRunner = context.existingTestRunner();
if (!testRunner)
throw new Error("No test runner found, please setup page and perform actions first.");
const config = await testRunner.loadConfig();
const resolvedFile = resolveWithinRoot(context.rootPath, params.fileName);
const dirs = [];
for (const project of config.projects) {
const projectTestDir = project.project.testDir;
if (resolvedFile && isPathInside(projectTestDir, resolvedFile)) {
await import_fs.default.promises.mkdir(import_path.default.dirname(resolvedFile), { recursive: true });
await import_fs.default.promises.writeFile(resolvedFile, params.code);
return {
content: [{
type: "text",
text: `### Result
Test written to ${params.fileName}`
}]
};
}
dirs.push(import_path.default.relative(context.rootPath, projectTestDir).replace(/\\/g, "/"));
}
throw new Error(`Test file did not match any of the test dirs: ${dirs.join(", ")}`);
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
generatorReadLog,
generatorWriteTest,
setupPage
});

View File

@@ -0,0 +1,150 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var plannerTools_exports = {};
__export(plannerTools_exports, {
saveTestPlan: () => saveTestPlan,
setupPage: () => setupPage,
submitTestPlan: () => submitTestPlan
});
module.exports = __toCommonJS(plannerTools_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_testTool = require("./testTool");
const z = require("playwright-core/lib/utilsBundle").z;
const { resolveWithinRoot } = require("playwright-core/lib/coreBundle").utils;
const setupPage = (0, import_testTool.defineTestTool)({
schema: {
name: "planner_setup_page",
title: "Setup planner page",
description: "Setup the page for test planning",
inputSchema: z.object({
project: z.string().optional().describe('Project to use for setup. For example: "chromium", if no project is provided uses the first project in the config.'),
seedFile: z.string().optional().describe('A seed file contains a single test that is used to setup the page for testing, for example: "tests/seed.spec.ts". If no seed file is provided, a default seed file is created.')
}),
type: "readOnly"
},
handle: async (context, params, signal) => {
const seed = await context.getOrCreateSeedFile(params.seedFile, params.project);
const { output, status } = await context.runSeedTest(seed.file, seed.projectName, signal);
return { content: [{ type: "text", text: output }], isError: status !== "paused" };
}
});
const planSchema = z.object({
overview: z.string().describe("A brief overview of the application to be tested"),
suites: z.array(z.object({
name: z.string().describe("The name of the suite"),
seedFile: z.string().describe("A seed file that was used to setup the page for testing."),
tests: z.array(z.object({
name: z.string().describe("The name of the test"),
file: z.string().describe('The file the test should be saved to, for example: "tests/<suite-name>/<test-name>.spec.ts".'),
steps: z.array(z.object({
perform: z.string().optional().describe(`Action to perform. For example: 'Click on the "Submit" button'.`),
expect: z.string().array().describe(`Expected result of the action where appropriate. For example: 'The page should show the "Thank you for your submission" message'`)
}))
}))
}))
});
const submitTestPlan = (0, import_testTool.defineTestTool)({
schema: {
name: "planner_submit_plan",
title: "Submit test plan",
description: "Submit the test plan to the test planner",
inputSchema: planSchema,
type: "readOnly"
},
handle: async (context, params) => {
return {
content: [{
type: "text",
text: JSON.stringify(params, null, 2)
}]
};
}
});
const saveTestPlan = (0, import_testTool.defineTestTool)({
schema: {
name: "planner_save_plan",
title: "Save test plan as markdown file",
description: "Save the test plan as a markdown file",
inputSchema: planSchema.extend({
name: z.string().describe('The name of the test plan, for example: "Test Plan".'),
fileName: z.string().describe('The file to save the test plan to, for example: "spec/test.plan.md". Relative to the workspace root.')
}),
type: "readOnly"
},
handle: async (context, params) => {
const lines = [];
lines.push(`# ${params.name}`);
lines.push(``);
lines.push(`## Application Overview`);
lines.push(``);
lines.push(params.overview);
lines.push(``);
lines.push(`## Test Scenarios`);
for (let i = 0; i < params.suites.length; i++) {
lines.push(``);
const suite = params.suites[i];
lines.push(`### ${i + 1}. ${suite.name}`);
lines.push(``);
lines.push(`**Seed:** \`${suite.seedFile}\``);
for (let j = 0; j < suite.tests.length; j++) {
lines.push(``);
const test = suite.tests[j];
lines.push(`#### ${i + 1}.${j + 1}. ${test.name}`);
lines.push(``);
lines.push(`**File:** \`${test.file}\``);
lines.push(``);
lines.push(`**Steps:**`);
for (let k = 0; k < test.steps.length; k++) {
lines.push(` ${k + 1}. ${test.steps[k].perform ?? "-"}`);
for (const expect of test.steps[k].expect)
lines.push(` - expect: ${expect}`);
}
}
}
lines.push(``);
const resolvedFile = resolveWithinRoot(context.rootPath, params.fileName);
if (!resolvedFile)
throw new Error(`Plan file name must be a relative path inside the workspace: ${params.fileName}`);
await import_fs.default.promises.mkdir(import_path.default.dirname(resolvedFile), { recursive: true });
await import_fs.default.promises.writeFile(resolvedFile, lines.join("\n"));
return {
content: [{
type: "text",
text: `Test plan saved to ${params.fileName}`
}]
};
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
saveTestPlan,
setupPage,
submitTestPlan
});

82
frontend/node_modules/playwright/lib/mcp/test/seed.js generated vendored Normal file
View File

@@ -0,0 +1,82 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var seed_exports = {};
__export(seed_exports, {
defaultSeedFile: () => defaultSeedFile,
ensureSeedFile: () => ensureSeedFile,
findSeedFile: () => findSeedFile,
seedFileContent: () => seedFileContent,
seedProject: () => seedProject
});
module.exports = __toCommonJS(seed_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_runner = require("../../runner");
const { mkdirIfNeeded } = require("playwright-core/lib/coreBundle").utils;
function seedProject(fullConfig, projectName) {
if (!projectName)
return import_runner.projectUtils.findTopLevelProjects(fullConfig)[0];
const project = fullConfig.projects.find((p) => p.project.name === projectName);
if (!project)
throw new Error(`Project ${projectName} not found`);
return project;
}
async function findSeedFile(project) {
const files = await import_runner.projectUtils.collectFilesForProject(project);
return files.find((file) => import_path.default.basename(file).includes("seed"));
}
function defaultSeedFile(project) {
const testDir = project.project.testDir;
return import_path.default.resolve(testDir, "seed.spec.ts");
}
async function ensureSeedFile(project) {
const seedFile = await findSeedFile(project);
if (seedFile)
return seedFile;
const seedFilePath = defaultSeedFile(project);
await mkdirIfNeeded(seedFilePath);
await import_fs.default.promises.writeFile(seedFilePath, seedFileContent);
return seedFilePath;
}
const seedFileContent = `import { test, expect } from '@playwright/test';
test.describe('Test group', () => {
test('seed', async ({ page }) => {
// generate code here.
});
});
`;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
defaultSeedFile,
ensureSeedFile,
findSeedFile,
seedFileContent,
seedProject
});

View File

@@ -0,0 +1,44 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var streams_exports = {};
__export(streams_exports, {
StringWriteStream: () => StringWriteStream
});
module.exports = __toCommonJS(streams_exports);
var import_stream = require("stream");
var import_util = require("../../util");
class StringWriteStream extends import_stream.Writable {
constructor(output, stdio) {
super();
this._output = output;
this._prefix = stdio === "stdout" ? "" : "[err] ";
}
_write(chunk, encoding, callback) {
let text = (0, import_util.stripAnsiEscapes)(chunk.toString());
if (text.endsWith("\n"))
text = text.slice(0, -1);
if (text)
this._output.push(this._prefix + text);
callback();
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
StringWriteStream
});

View File

@@ -0,0 +1,99 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testBackend_exports = {};
__export(testBackend_exports, {
TestServerBackend: () => TestServerBackend,
testServerBackendTools: () => testServerBackendTools
});
module.exports = __toCommonJS(testBackend_exports);
var import_events = __toESM(require("events"));
var import_coreBundle = require("playwright-core/lib/coreBundle");
var import_testContext = require("./testContext");
var testTools = __toESM(require("./testTools.js"));
var generatorTools = __toESM(require("./generatorTools.js"));
var plannerTools = __toESM(require("./plannerTools.js"));
const zod = require("playwright-core/lib/utilsBundle").z;
const typesWithIntent = ["action", "assertion", "input"];
const testServerBackendTools = [
plannerTools.saveTestPlan,
plannerTools.setupPage,
plannerTools.submitTestPlan,
generatorTools.setupPage,
generatorTools.generatorReadLog,
generatorTools.generatorWriteTest,
testTools.listTests,
testTools.runTests,
testTools.debugTest,
...import_coreBundle.tools.browserTools.map((tool) => wrapBrowserTool(tool))
];
class TestServerBackend extends import_events.default {
constructor(configPath, options) {
super();
this.name = "Playwright";
this.version = "0.0.1";
this._options = options || {};
this._configPath = configPath;
}
async initialize(clientInfo) {
this._context = new import_testContext.TestContext(clientInfo, this._configPath, this._options);
}
async callTool(name, args, signal) {
const tool = testServerBackendTools.find((tool2) => tool2.schema.name === name);
if (!tool)
throw new Error(`Tool not found: ${name}. Available tools: ${testServerBackendTools.map((tool2) => tool2.schema.name).join(", ")}`);
try {
return await tool.handle(this._context, tool.schema.inputSchema.parse(args || {}), signal);
} catch (e) {
return { content: [{ type: "text", text: String(e) }], isError: true };
}
}
async dispose() {
await this._context?.close();
}
}
function wrapBrowserTool(tool) {
const inputSchema = typesWithIntent.includes(tool.schema.type) ? tool.schema.inputSchema.extend({
intent: zod.string().describe("The intent of the call, for example the test step description plan idea")
}) : tool.schema.inputSchema;
return {
schema: {
...tool.schema,
inputSchema
},
handle: async (context, params, _signal) => {
const response = await context.sendMessageToPausedTest({ callTool: { name: tool.schema.name, arguments: params } });
return response.callTool;
}
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
TestServerBackend,
testServerBackendTools
});

View File

@@ -0,0 +1,302 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testContext_exports = {};
__export(testContext_exports, {
GeneratorJournal: () => GeneratorJournal,
TestContext: () => TestContext,
createScreen: () => createScreen
});
module.exports = __toCommonJS(testContext_exports);
var import_fs = __toESM(require("fs"));
var import_os = __toESM(require("os"));
var import_path = __toESM(require("path"));
var import_coreBundle = require("playwright-core/lib/coreBundle");
var import_runner = require("../../runner");
var import_streams = require("./streams");
var import_util = require("../../util");
var import_seed = require("./seed");
var import_common = require("../../common");
const debug = require("playwright-core/lib/utilsBundle").debug;
const { noColors } = require("playwright-core/lib/coreBundle").iso;
const { ManualPromise, signalToPromise } = require("playwright-core/lib/coreBundle").iso;
const { escapeRegExp } = require("playwright-core/lib/coreBundle").iso;
const { toPosixPath } = require("playwright-core/lib/coreBundle").utils;
class GeneratorJournal {
constructor(rootPath, plan, seed) {
this._rootPath = rootPath;
this._plan = plan;
this._seed = seed;
this._steps = [];
}
logStep(title, code) {
if (title)
this._steps.push({ title, code });
}
journal() {
const result = [];
result.push(`# Plan`);
result.push(this._plan);
result.push(`# Seed file: ${toPosixPath(import_path.default.relative(this._rootPath, this._seed.file))}`);
result.push("```ts");
result.push(this._seed.content);
result.push("```");
result.push(`# Steps`);
result.push(this._steps.map((step) => `### ${step.title}
\`\`\`ts
${step.code}
\`\`\``).join("\n\n"));
result.push(bestPracticesMarkdown);
return result.join("\n\n");
}
}
class TestContext {
constructor(clientInfo, configPath, options) {
this._testOpQueue = Promise.resolve();
this._clientInfo = clientInfo;
this._configLocation = import_common.configLoader.resolveConfigLocation(configPath || clientInfo.cwd);
this.rootPath = clientInfo.cwd || this._configLocation.configDir;
if (options?.headless !== void 0)
this.computedHeaded = !options.headless;
else
this.computedHeaded = !process.env.CI && !(import_os.default.platform() === "linux" && !process.env.DISPLAY);
}
async _enqueue(fn) {
const next = this._testOpQueue.then(fn);
this._testOpQueue = next.then(() => {
});
return await next;
}
existingTestRunner() {
return this._testRunnerAndScreen?.testRunner;
}
async _cleanupTestRunner() {
if (!this._testRunnerAndScreen)
return;
await this._testRunnerAndScreen.testRunner.stopTests();
this._testRunnerAndScreen.claimStdio();
try {
await this._testRunnerAndScreen.testRunner.runGlobalTeardown();
} finally {
this._testRunnerAndScreen.releaseStdio();
this._testRunnerAndScreen = void 0;
}
}
async createTestRunner() {
await this._cleanupTestRunner();
const runner = new import_runner.testRunner.TestRunner(this._configLocation, {});
await runner.initialize({});
const testPaused = new ManualPromise();
const testRunnerAndScreen = {
...createScreen(),
testRunner: runner,
waitForTestPaused: () => testPaused
};
this._testRunnerAndScreen = testRunnerAndScreen;
runner.on(import_runner.testRunner.TestRunnerEvent.TestPaused, (params) => {
testRunnerAndScreen.sendMessageToPausedTest = params.sendMessage;
testPaused.resolve();
});
return testRunnerAndScreen;
}
async getOrCreateSeedFile(seedFile, projectName) {
const configDir = this._configLocation.configDir;
const { testRunner: runner } = await this.createTestRunner();
const config = await runner.loadConfig();
const project = (0, import_seed.seedProject)(config, projectName);
if (!seedFile) {
seedFile = await (0, import_seed.ensureSeedFile)(project);
} else {
const candidateFiles = [];
const testDir = project.project.testDir;
candidateFiles.push(import_path.default.resolve(testDir, seedFile));
candidateFiles.push(import_path.default.resolve(configDir, seedFile));
candidateFiles.push(import_path.default.resolve(this.rootPath, seedFile));
let resolvedSeedFile;
for (const candidateFile of candidateFiles) {
if (await (0, import_util.fileExistsAsync)(candidateFile)) {
resolvedSeedFile = candidateFile;
break;
}
}
if (!resolvedSeedFile)
throw new Error("seed test not found.");
seedFile = resolvedSeedFile;
}
const seedFileContent = await import_fs.default.promises.readFile(seedFile, "utf8");
return {
file: seedFile,
content: seedFileContent,
projectName: project.project.name
};
}
async runSeedTest(seedFile, projectName, signal) {
const result = await this.runTestsWithGlobalSetupAndPossiblePause({
headed: this.computedHeaded,
locations: ["/" + escapeRegExp(seedFile) + "/"],
projects: [projectName],
timeout: 0,
workers: 1,
pauseAtEnd: true,
disableConfigReporters: true,
failOnLoadErrors: true
}, signal);
if (result.status === "passed")
result.output += "\nError: seed test not found.";
else if (result.status !== "paused")
result.output += "\nError while running the seed test.";
return result;
}
async runTestsWithGlobalSetupAndPossiblePause(params, signal) {
return this._enqueue(() => this._runTestsImpl(params, signal));
}
async _runTestsImpl(params, signal) {
const configDir = this._configLocation.configDir;
const testRunnerAndScreen = await this.createTestRunner();
const { testRunner: runner, screen, claimStdio, releaseStdio } = testRunnerAndScreen;
claimStdio();
try {
const setupReporter = new MCPListReporter({ configDir, screen, includeTestId: true });
const { status: status2 } = await runner.runGlobalSetup([setupReporter]);
if (status2 !== "passed")
return { output: testRunnerAndScreen.output.join("\n"), status: status2 };
} finally {
releaseStdio();
}
let status = "passed";
const cleanup = async () => {
claimStdio();
try {
const result = await runner.runGlobalTeardown();
if (status === "passed")
status = result.status;
} finally {
releaseStdio();
}
};
const abortPromise = signal ? signalToPromise(signal).promise.then(() => "interrupted") : new Promise(() => {
});
try {
const reporter = new MCPListReporter({ configDir, screen, includeTestId: true });
status = await Promise.race([
runner.runTests(reporter, params).then((result) => result.status),
testRunnerAndScreen.waitForTestPaused().then(() => "paused"),
abortPromise
]);
if (status === "interrupted") {
await runner.stopTests();
await cleanup();
return { output: testRunnerAndScreen.output.join("\n"), status };
}
if (status === "paused") {
const response = await testRunnerAndScreen.sendMessageToPausedTest({ request: { initialize: { clientInfo: this._clientInfo } } });
if (response.error)
throw new Error(response.error.message);
testRunnerAndScreen.output.push(response.response.initialize.pausedMessage);
return { output: testRunnerAndScreen.output.join("\n"), status };
}
} catch (e) {
status = "failed";
testRunnerAndScreen.output.push(String(e));
await cleanup();
return { output: testRunnerAndScreen.output.join("\n"), status };
}
await cleanup();
return { output: testRunnerAndScreen.output.join("\n"), status };
}
async close() {
await this._enqueue(() => this._cleanupTestRunner()).catch((e) => debug("pw:mcp:error")(e));
}
async sendMessageToPausedTest(request) {
const sendMessage = this._testRunnerAndScreen?.sendMessageToPausedTest;
if (!sendMessage)
throw new Error("Must setup test before interacting with the page");
const result = await sendMessage({ request });
if (result.error)
throw new Error(result.error.message);
if (typeof request?.callTool?.arguments?.["intent"] === "string") {
const response = import_coreBundle.tools.parseResponse(result.response.callTool);
if (response && !response.isError && response.code)
this.generatorJournal?.logStep(request.callTool.arguments["intent"], response.code);
}
return result.response;
}
}
function createScreen() {
const output = [];
const stdout = new import_streams.StringWriteStream(output, "stdout");
const stderr = new import_streams.StringWriteStream(output, "stderr");
const screen = {
...import_runner.base.terminalScreen,
isTTY: false,
colors: noColors,
stdout,
stderr
};
const originalStdoutWrite = process.stdout.write;
const originalStderrWrite = process.stderr.write;
const claimStdio = () => {
process.stdout.write = (chunk) => {
stdout.write(chunk);
return true;
};
process.stderr.write = (chunk) => {
stderr.write(chunk);
return true;
};
};
const releaseStdio = () => {
process.stdout.write = originalStdoutWrite;
process.stderr.write = originalStderrWrite;
};
return { screen, claimStdio, releaseStdio, output };
}
const bestPracticesMarkdown = `
# Best practices
- Do not improvise, do not add directives that were not asked for
- Use clear, descriptive assertions to validate the expected behavior
- Use reliable locators from this log
- Use local variables for locators that are used multiple times
- Use Playwright waiting assertions and best practices from this log
- NEVER! use page.waitForLoadState()
- NEVER! use page.waitForNavigation()
- NEVER! use page.waitForTimeout()
- NEVER! use page.evaluate()
`;
class MCPListReporter extends import_runner.ListReporter {
async onTestPaused() {
await new Promise(() => {
});
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
GeneratorJournal,
TestContext,
createScreen
});

View File

@@ -0,0 +1,30 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testTool_exports = {};
__export(testTool_exports, {
defineTestTool: () => defineTestTool
});
module.exports = __toCommonJS(testTool_exports);
function defineTestTool(tool) {
return tool;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
defineTestTool
});

View File

@@ -0,0 +1,98 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testTools_exports = {};
__export(testTools_exports, {
debugTest: () => debugTest,
listTests: () => listTests,
runTests: () => runTests
});
module.exports = __toCommonJS(testTools_exports);
var import_runner = require("../../runner");
var import_testTool = require("./testTool");
const z = require("playwright-core/lib/utilsBundle").z;
const listTests = (0, import_testTool.defineTestTool)({
schema: {
name: "test_list",
title: "List tests",
description: "List tests",
inputSchema: z.object({}),
type: "readOnly"
},
handle: async (context) => {
const { testRunner, screen, output } = await context.createTestRunner();
const reporter = new import_runner.ListModeReporter({ screen, includeTestId: true });
await testRunner.listTests(reporter, {});
return { content: output.map((text) => ({ type: "text", text })) };
}
});
const runTests = (0, import_testTool.defineTestTool)({
schema: {
name: "test_run",
title: "Run tests",
description: "Run tests",
inputSchema: z.object({
locations: z.array(z.string()).optional().describe('Folder, file or location to run: "test/e2e" or "test/e2e/file.spec.ts" or "test/e2e/file.spec.ts:20"'),
projects: z.array(z.string()).optional().describe('Projects to run, projects from playwright.config.ts, by default runs all projects. Running with "chromium" is a good start')
}),
type: "readOnly"
},
handle: async (context, params, signal) => {
const { output } = await context.runTestsWithGlobalSetupAndPossiblePause({
locations: params.locations ?? [],
projects: params.projects,
disableConfigReporters: true
}, signal);
return { content: [{ type: "text", text: output }] };
}
});
const debugTest = (0, import_testTool.defineTestTool)({
schema: {
name: "test_debug",
title: "Debug single test",
description: "Debug single test",
inputSchema: z.object({
test: z.object({
id: z.string().describe("Test ID to debug."),
title: z.string().describe("Human readable test title for granting permission to debug the test.")
})
}),
type: "readOnly"
},
handle: async (context, params, signal) => {
const { output, status } = await context.runTestsWithGlobalSetupAndPossiblePause({
headed: context.computedHeaded,
locations: [],
// we can make this faster by passing the test's location, so we don't need to scan all tests to find the ID
testIds: [params.test.id],
// For automatic recovery
timeout: 0,
workers: 1,
pauseOnError: true,
disableConfigReporters: true,
actionTimeout: 5e3
}, signal);
return { content: [{ type: "text", text: output }], isError: status !== "paused" && status !== "passed" };
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
debugTest,
listTests,
runTests
});

47
frontend/node_modules/playwright/lib/package.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var package_exports = {};
__export(package_exports, {
libPath: () => libPath,
packageJSON: () => packageJSON,
packageRoot: () => packageRoot
});
module.exports = __toCommonJS(package_exports);
var import_path = __toESM(require("path"));
const packageRoot = import_path.default.join(__dirname, "..");
const packageJSON = require(import_path.default.join(packageRoot, "package.json"));
function libPath(...parts) {
return import_path.default.join(packageRoot, "lib", ...parts);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
libPath,
packageJSON,
packageRoot
});

217
frontend/node_modules/playwright/lib/program.js generated vendored Normal file
View File

@@ -0,0 +1,217 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var program_exports = {};
__export(program_exports, {
program: () => program
});
module.exports = __toCommonJS(program_exports);
var import_bootstrap = require("playwright-core/lib/bootstrap");
var import_coreBundle = require("playwright-core/lib/coreBundle");
var import_common = require("./common");
var import_testActions = require("./cli/testActions");
var import_reportActions = require("./cli/reportActions");
var import_testBackend = require("./mcp/test/testBackend");
var import_generateAgents = require("./agents/generateAgents");
var import_package = require("./package");
const { program } = require("playwright-core/lib/utilsBundle");
const { gracefullyProcessExitDoNotHang } = require("playwright-core/lib/coreBundle").utils;
import_coreBundle.libCli.decorateProgram(program);
function addTestCommand(program2) {
const command = program2.command("test [test-filter...]");
command.description("run tests with Playwright Test");
const options = testOptions.sort((a, b) => a[0].replace(/-/g, "").localeCompare(b[0].replace(/-/g, "")));
options.forEach(([name, { description, choices, preset }]) => {
const option = command.createOption(name, description);
if (choices)
option.choices(choices);
if (preset)
option.preset(preset);
command.addOption(option);
return command;
});
command.action(async (args, opts) => {
try {
await (0, import_testActions.runTests)(args, opts);
} catch (e) {
console.error(e);
gracefullyProcessExitDoNotHang(1);
}
});
command.addHelpText("afterAll", `
Arguments [test-filter...]:
Pass arguments to filter test files. Each argument is treated as a regular expression. Matching is performed against the absolute file paths.
Examples:
$ npx playwright test my.spec.ts
$ npx playwright test some.spec.ts:42
$ npx playwright test --headed
$ npx playwright test --project=webkit`);
}
function addClearCacheCommand(program2) {
const command = program2.command("clear-cache");
command.description("clears build and test caches");
command.option("-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
command.action(async (opts) => {
await (0, import_testActions.clearCache)(opts);
});
}
function addTestServerCommand(program2) {
const command = program2.command("test-server", { hidden: true });
command.description("start test server");
command.option("-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
command.option("--host <host>", "Host to start the server on", "localhost");
command.option("--port <port>", "Port to start the server on", "0");
command.action(async (opts) => {
await (0, import_testActions.runTestServerAction)(opts);
});
}
function addShowReportCommand(program2) {
const command = program2.command("show-report [report]");
command.description("show HTML report");
command.action(async (report, options) => {
await (0, import_reportActions.showReport)(report, options.host, +options.port);
});
command.option("--host <host>", "Host to serve report on", "localhost");
command.option("--port <port>", "Port to serve report on", "9323");
command.addHelpText("afterAll", `
Arguments [report]:
When specified, opens given report, otherwise opens last generated report.
Accepts a directory or a .zip archive whose top-level entry is "index.html" (e.g. one downloaded from a CI artifact).
Examples:
$ npx playwright show-report
$ npx playwright show-report playwright-report
$ npx playwright show-report playwright-report.zip`);
}
function addMergeReportsCommand(program2) {
const command = program2.command("merge-reports [dir]");
command.description("merge multiple blob reports (for sharded tests) into a single report");
command.action(async (dir, options) => {
try {
await (0, import_reportActions.mergeReports)(dir, options);
} catch (e) {
console.error(e);
gracefullyProcessExitDoNotHang(1);
}
});
command.option("-c, --config <file>", `Configuration file. Can be used to specify additional configuration for the output report.`);
command.option("--reporter <reporter>", `Reporter to use, comma-separated, can be ${import_common.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_common.config.defaultReporter}")`);
command.addHelpText("afterAll", `
Arguments [dir]:
Directory containing blob reports.
Examples:
$ npx playwright merge-reports playwright-report`);
}
function addTestMCPServerCommand(program2) {
const command = program2.command("run-test-mcp-server", { hidden: true });
command.description("Interact with the test runner over MCP");
command.option("--headless", "run browser in headless mode, headed by default");
command.option("-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`);
command.option("--host <host>", "host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.");
command.option("--port <port>", "port to listen on for SSE transport.");
command.action(async (options) => {
import_coreBundle.tools.setupExitWatchdog();
const factory = {
name: "Playwright Test Runner",
nameInConfig: "playwright-test-runner",
version: import_package.packageJSON.version,
toolSchemas: import_testBackend.testServerBackendTools.map((tool) => tool.schema),
create: async () => new import_testBackend.TestServerBackend(options.config, { muteConsole: options.port === void 0, headless: options.headless }),
disposed: async () => {
}
};
await import_coreBundle.tools.start(factory, { port: options.port === void 0 ? void 0 : +options.port, host: options.host });
});
}
function addInitAgentsCommand(program2) {
const command = program2.command("init-agents");
command.description("Initialize repository agents");
const option = command.createOption("--loop <loop>", "Agentic loop provider");
option.choices(["claude", "copilot", "opencode", "vscode", "vscode-legacy"]);
command.addOption(option);
command.option("-c, --config <file>", `Configuration file to find a project to use for seed test`);
command.option("--project <project>", "Project to use for seed test");
command.option("--prompts", "Whether to include prompts in the agent initialization");
command.action(async (opts) => {
const loadedConfig = await import_common.configLoader.loadConfigFromFile(opts.config);
if (opts.loop === "opencode") {
await import_generateAgents.OpencodeGenerator.init(loadedConfig, opts.project, opts.prompts);
} else if (opts.loop === "vscode-legacy") {
await import_generateAgents.VSCodeGenerator.init(loadedConfig, opts.project);
} else if (opts.loop === "claude") {
await import_generateAgents.ClaudeGenerator.init(loadedConfig, opts.project, opts.prompts);
} else {
await import_generateAgents.CopilotGenerator.init(loadedConfig, opts.project, opts.prompts);
return;
}
});
}
const kTraceModes = ["on", "off", "on-first-retry", "on-all-retries", "retain-on-failure", "retain-on-first-failure", "retain-on-failure-and-retries"];
const testOptions = [
/* deprecated */
["--browser <browser>", { description: `Browser to use for tests, one of "all", "chromium", "firefox" or "webkit" (default: "chromium")` }],
["-c, --config <file>", { description: `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"` }],
["--debug [mode]", { description: `Run tests with Playwright Inspector. Shortcut for "PWDEBUG=1" environment variable and "--timeout=0 --max-failures=1 --headed --workers=1" options`, choices: ["inspector", "cli"], preset: "inspector" }],
["--fail-on-flaky-tests", { description: `Fail if any test is flagged as flaky (default: false)` }],
["--forbid-only", { description: `Fail if test.only is called (default: false)` }],
["--fully-parallel", { description: `Run all tests in parallel (default: false)` }],
["--global-timeout <timeout>", { description: `Maximum time this test suite can run in milliseconds (default: unlimited)` }],
["-g, --grep <grep>", { description: `Only run tests matching this regular expression (default: ".*")` }],
["--grep-invert <grep>", { description: `Only run tests that do not match this regular expression` }],
["--headed", { description: `Run tests in headed browsers (default: headless)` }],
["--ignore-snapshots", { description: `Ignore screenshot and snapshot expectations` }],
["--last-failed", { description: `Only re-run the failures` }],
["--list", { description: `Collect all the tests and report them, but do not run` }],
["--max-failures <N>", { description: `Stop after the first N failures` }],
["--no-deps", { description: `Do not run project dependencies` }],
["--output <dir>", { description: `Folder for output artifacts (default: "test-results")` }],
["--only-changed [ref]", { description: `Only run test files that have been changed between 'HEAD' and 'ref'. Defaults to running all uncommitted changes. Only supports Git.` }],
["--pass-with-no-tests", { description: `Makes test run succeed even if no tests were found` }],
["--project <project-name...>", { description: `Only run tests from the specified list of projects, supports '*' wildcard (default: run all projects)` }],
["--quiet", { description: `Suppress stdio` }],
["--repeat-each <N>", { description: `Run each test N times (default: 1)` }],
["--reporter <reporter>", { description: `Reporter to use, comma-separated, can be ${import_common.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_common.config.defaultReporter}")` }],
["--retries <retries>", { description: `Maximum retry count for flaky tests, zero for no retries (default: no retries)` }],
["--run-agents <mode>", { description: `Run agents to generate the code for page.perform`, choices: ["missing", "all", "none"], preset: "none" }],
["--shard <shard>", { description: `Shard tests and execute only the selected shard, specify in the form "current/all", 1-based, for example "3/5"` }],
["--test-list <file>", { description: `Path to a file containing a list of tests to run. See https://playwright.dev/docs/test-cli for more details.` }],
["--test-list-invert <file>", { description: `Path to a file containing a list of tests to skip. See https://playwright.dev/docs/test-cli for more details.` }],
["--timeout <timeout>", { description: `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${import_common.config.defaultTimeout})` }],
["--trace <mode>", { description: `Force tracing mode`, choices: kTraceModes }],
["--tsconfig <path>", { description: `Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately)` }],
["--ui", { description: `Run tests in interactive UI mode` }],
["--ui-host <host>", { description: `Host to serve UI on; specifying this option opens UI in a browser tab` }],
["--ui-port <port>", { description: `Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab` }],
["-u, --update-snapshots [mode]", { description: `Update snapshots with actual results. Running tests without the flag defaults to "missing"`, choices: ["all", "changed", "missing", "none"], preset: "changed" }],
["--update-source-method <method>", { description: `Chooses the way source is updated (default: "patch")`, choices: ["overwrite", "3way", "patch"] }],
["-j, --workers <workers>", { description: `Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%)` }],
["-x", { description: `Stop after the first failure` }]
];
addTestCommand(program);
addShowReportCommand(program);
addMergeReportsCommand(program);
addClearCacheCommand(program);
addTestMCPServerCommand(program);
addTestServerCommand(program);
addInitAgentsCommand(program);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
program
});

8035
frontend/node_modules/playwright/lib/runner/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
# packages/playwright/lib/runner/index.js
# total: 288.6 KB
## Inlined (45)
1.3 KB packages/playwright/src/isomorphic/events.ts
0.1 KB packages/playwright/src/isomorphic/folders.ts
0.9 KB packages/playwright/src/isomorphic/stringInternPool.ts
15.1 KB packages/playwright/src/isomorphic/teleReceiver.ts
3.9 KB packages/playwright/src/isomorphic/teleSuiteUpdater.ts
4.8 KB packages/playwright/src/isomorphic/testServerConnection.ts
0.0 KB packages/playwright/src/isomorphic/testTree.ts
5.0 KB packages/playwright/src/plugins/gitCommitInfoPlugin.ts
8.6 KB packages/playwright/src/plugins/webServerPlugin.ts
20.7 KB packages/playwright/src/reporters/base.ts
4.0 KB packages/playwright/src/reporters/blob.ts
2.3 KB packages/playwright/src/reporters/dot.ts
0.1 KB packages/playwright/src/reporters/empty.ts
3.5 KB packages/playwright/src/reporters/github.ts
26.2 KB packages/playwright/src/reporters/html.ts
3.1 KB packages/playwright/src/reporters/internalReporter.ts
7.1 KB packages/playwright/src/reporters/json.ts
10.3 KB packages/playwright/src/reporters/junit.ts
3.8 KB packages/playwright/src/reporters/line.ts
8.6 KB packages/playwright/src/reporters/list.ts
1.4 KB packages/playwright/src/reporters/listModeReporter.ts
18.5 KB packages/playwright/src/reporters/merge.ts
2.5 KB packages/playwright/src/reporters/multiplexer.ts
2.0 KB packages/playwright/src/reporters/reporterV2.ts
8.7 KB packages/playwright/src/reporters/teleEmitter.ts
19.0 KB packages/playwright/src/runner/dispatcher.ts
1.5 KB packages/playwright/src/runner/fsWatcher.ts
0.5 KB packages/playwright/src/runner/index.ts
1.2 KB packages/playwright/src/runner/lastRun.ts
1.6 KB packages/playwright/src/runner/loaderHost.ts
12.5 KB packages/playwright/src/runner/loadUtils.ts
5.8 KB packages/playwright/src/runner/processHost.ts
7.8 KB packages/playwright/src/runner/projectUtils.ts
5.5 KB packages/playwright/src/runner/rebase.ts
3.5 KB packages/playwright/src/runner/reporters.ts
1.6 KB packages/playwright/src/runner/sigIntWatcher.ts
3.5 KB packages/playwright/src/runner/taskRunner.ts
14.4 KB packages/playwright/src/runner/tasks.ts
3.6 KB packages/playwright/src/runner/testGroups.ts
13.9 KB packages/playwright/src/runner/testRunner.ts
8.8 KB packages/playwright/src/runner/testServer.ts
0.2 KB packages/playwright/src/runner/uiModeReporter.ts
1.7 KB packages/playwright/src/runner/vcs.ts
13.1 KB packages/playwright/src/runner/watchMode.ts
2.1 KB packages/playwright/src/runner/workerHost.ts
## External (8)
../common
../loader/loaderProcessEntry.js
../transform/babelBundle
../util
../worker/workerProcessEntry.js
playwright-core
playwright-core/lib/coreBundle
playwright-core/lib/utilsBundle

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,325 @@
# packages/playwright/lib/transform/babelBundle.js
# total: 2724.2 KB
## Inlined (319)
5.7 KB node_modules/@ampproject/remapping/dist/remapping.umd.js
7.9 KB node_modules/@babel/code-frame/lib/index.js
0.5 KB node_modules/@babel/compat-data/data/native-modules.json
18.6 KB node_modules/@babel/compat-data/data/plugins.json
0.2 KB node_modules/@babel/compat-data/native-modules.js
0.1 KB node_modules/@babel/compat-data/plugins.js
8.3 KB node_modules/@babel/core/lib/config/caching.js
20.1 KB node_modules/@babel/core/lib/config/config-chain.js
7.6 KB node_modules/@babel/core/lib/config/config-descriptors.js
11.6 KB node_modules/@babel/core/lib/config/files/configuration.js
0.2 KB node_modules/@babel/core/lib/config/files/import.cjs
2.1 KB node_modules/@babel/core/lib/config/files/index.js
8.0 KB node_modules/@babel/core/lib/config/files/module-types.js
1.8 KB node_modules/@babel/core/lib/config/files/package.js
8.4 KB node_modules/@babel/core/lib/config/files/plugins.js
1.0 KB node_modules/@babel/core/lib/config/files/utils.js
12.1 KB node_modules/@babel/core/lib/config/full.js
3.1 KB node_modules/@babel/core/lib/config/helpers/config-api.js
0.7 KB node_modules/@babel/core/lib/config/helpers/deep-array.js
0.4 KB node_modules/@babel/core/lib/config/helpers/environment.js
3.7 KB node_modules/@babel/core/lib/config/index.js
2.1 KB node_modules/@babel/core/lib/config/item.js
5.8 KB node_modules/@babel/core/lib/config/partial.js
1.3 KB node_modules/@babel/core/lib/config/pattern-to-regex.js
1.1 KB node_modules/@babel/core/lib/config/plugin.js
3.3 KB node_modules/@babel/core/lib/config/printer.js
1.8 KB node_modules/@babel/core/lib/config/resolve-targets.js
1.1 KB node_modules/@babel/core/lib/config/util.js
11.0 KB node_modules/@babel/core/lib/config/validation/option-assertions.js
8.6 KB node_modules/@babel/core/lib/config/validation/options.js
2.4 KB node_modules/@babel/core/lib/config/validation/plugins.js
2.6 KB node_modules/@babel/core/lib/config/validation/removed.js
0.6 KB node_modules/@babel/core/lib/errors/config-error.js
3.6 KB node_modules/@babel/core/lib/errors/rewrite-stack-trace.js
3.1 KB node_modules/@babel/core/lib/gensync-utils/async.js
0.7 KB node_modules/@babel/core/lib/gensync-utils/fs.js
1.6 KB node_modules/@babel/core/lib/gensync-utils/functional.js
6.5 KB node_modules/@babel/core/lib/index.js
1.6 KB node_modules/@babel/core/lib/parse.js
2.5 KB node_modules/@babel/core/lib/parser/index.js
14.1 KB node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js
5.0 KB node_modules/@babel/core/lib/tools/build-external-helpers.js
1.8 KB node_modules/@babel/core/lib/transform-ast.js
1.2 KB node_modules/@babel/core/lib/transform-file.js
1.7 KB node_modules/@babel/core/lib/transform.js
2.3 KB node_modules/@babel/core/lib/transformation/block-hoist-plugin.js
0.2 KB node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs
6.8 KB node_modules/@babel/core/lib/transformation/file/file.js
2.6 KB node_modules/@babel/core/lib/transformation/file/generate.js
1.0 KB node_modules/@babel/core/lib/transformation/file/merge-map.js
3.3 KB node_modules/@babel/core/lib/transformation/index.js
4.1 KB node_modules/@babel/core/lib/transformation/normalize-file.js
1.8 KB node_modules/@babel/core/lib/transformation/normalize-opts.js
1.4 KB node_modules/@babel/core/lib/transformation/plugin-pass.js
1.9 KB node_modules/@babel/core/lib/transformation/util/clone-deep.js
44.8 KB node_modules/@babel/core/lib/vendor/import-meta-resolve.js
38.4 KB node_modules/@babel/core/node_modules/semver/semver.js
7.1 KB node_modules/@babel/generator/lib/buffer.js
3.1 KB node_modules/@babel/generator/lib/generators/base.js
6.8 KB node_modules/@babel/generator/lib/generators/classes.js
2.5 KB node_modules/@babel/generator/lib/generators/deprecated.js
9.5 KB node_modules/@babel/generator/lib/generators/expressions.js
18.9 KB node_modules/@babel/generator/lib/generators/flow.js
4.3 KB node_modules/@babel/generator/lib/generators/index.js
3.5 KB node_modules/@babel/generator/lib/generators/jsx.js
7.0 KB node_modules/@babel/generator/lib/generators/methods.js
9.7 KB node_modules/@babel/generator/lib/generators/modules.js
8.1 KB node_modules/@babel/generator/lib/generators/statements.js
1.3 KB node_modules/@babel/generator/lib/generators/template-literals.js
6.1 KB node_modules/@babel/generator/lib/generators/types.js
21.5 KB node_modules/@babel/generator/lib/generators/typescript.js
4.6 KB node_modules/@babel/generator/lib/index.js
2.5 KB node_modules/@babel/generator/lib/node/index.js
11.4 KB node_modules/@babel/generator/lib/node/parentheses.js
0.8 KB node_modules/@babel/generator/lib/nodes.js
29.0 KB node_modules/@babel/generator/lib/printer.js
3.4 KB node_modules/@babel/generator/lib/source-map.js
6.4 KB node_modules/@babel/generator/lib/token-map.js
0.7 KB node_modules/@babel/helper-annotate-as-pure/lib/index.js
1.2 KB node_modules/@babel/helper-compilation-targets/lib/debug.js
2.7 KB node_modules/@babel/helper-compilation-targets/lib/filter-items.js
8.7 KB node_modules/@babel/helper-compilation-targets/lib/index.js
0.6 KB node_modules/@babel/helper-compilation-targets/lib/options.js
1.2 KB node_modules/@babel/helper-compilation-targets/lib/pretty.js
0.8 KB node_modules/@babel/helper-compilation-targets/lib/targets.js
2.2 KB node_modules/@babel/helper-compilation-targets/lib/utils.js
38.5 KB node_modules/@babel/helper-compilation-targets/node_modules/semver/semver.js
5.1 KB node_modules/@babel/helper-create-class-features-plugin/lib/decorators-2018-09.js
59.9 KB node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js
7.3 KB node_modules/@babel/helper-create-class-features-plugin/lib/features.js
43.4 KB node_modules/@babel/helper-create-class-features-plugin/lib/fields.js
11.1 KB node_modules/@babel/helper-create-class-features-plugin/lib/index.js
4.9 KB node_modules/@babel/helper-create-class-features-plugin/lib/misc.js
0.8 KB node_modules/@babel/helper-create-class-features-plugin/lib/typescript.js
38.5 KB node_modules/@babel/helper-create-class-features-plugin/node_modules/semver/semver.js
0.4 KB node_modules/@babel/helper-globals/data/builtin-lower.json
1.0 KB node_modules/@babel/helper-globals/data/builtin-upper.json
14.3 KB node_modules/@babel/helper-member-expression-to-functions/lib/index.js
4.6 KB node_modules/@babel/helper-module-imports/lib/import-builder.js
12.0 KB node_modules/@babel/helper-module-imports/lib/import-injector.js
1.3 KB node_modules/@babel/helper-module-imports/lib/index.js
0.3 KB node_modules/@babel/helper-module-imports/lib/is-module.js
1.9 KB node_modules/@babel/helper-module-transforms/lib/dynamic-import.js
1.9 KB node_modules/@babel/helper-module-transforms/lib/get-module-name.js
14.7 KB node_modules/@babel/helper-module-transforms/lib/index.js
1.2 KB node_modules/@babel/helper-module-transforms/lib/lazy-modules.js
14.6 KB node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js
14.8 KB node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js
0.8 KB node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
1.2 KB node_modules/@babel/helper-optimise-call-expression/lib/index.js
2.8 KB node_modules/@babel/helper-plugin-utils/lib/index.js
11.6 KB node_modules/@babel/helper-replace-supers/lib/index.js
1.2 KB node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js
8.9 KB node_modules/@babel/helper-string-parser/lib/index.js
12.6 KB node_modules/@babel/helper-validator-identifier/lib/identifier.js
1.6 KB node_modules/@babel/helper-validator-identifier/lib/index.js
1.7 KB node_modules/@babel/helper-validator-identifier/lib/keyword.js
0.9 KB node_modules/@babel/helper-validator-option/lib/find-suggestion.js
0.6 KB node_modules/@babel/helper-validator-option/lib/index.js
1.7 KB node_modules/@babel/helper-validator-option/lib/validator.js
117.4 KB node_modules/@babel/helpers/lib/helpers-generated.js
4.1 KB node_modules/@babel/helpers/lib/index.js
556.4 KB node_modules/@babel/parser/lib/index.js
1.6 KB node_modules/@babel/plugin-proposal-decorators/lib/index.js
9.0 KB node_modules/@babel/plugin-proposal-decorators/lib/transformer-legacy.js
0.6 KB node_modules/@babel/plugin-syntax-async-generators/lib/index.js
3.2 KB node_modules/@babel/plugin-syntax-decorators/lib/index.js
1.5 KB node_modules/@babel/plugin-syntax-import-attributes/lib/index.js
0.6 KB node_modules/@babel/plugin-syntax-json-strings/lib/index.js
0.7 KB node_modules/@babel/plugin-syntax-jsx/lib/index.js
0.6 KB node_modules/@babel/plugin-syntax-object-rest-spread/lib/index.js
0.6 KB node_modules/@babel/plugin-syntax-optional-catch-binding/lib/index.js
1.4 KB node_modules/@babel/plugin-syntax-typescript/lib/index.js
0.9 KB node_modules/@babel/plugin-transform-class-properties/lib/index.js
6.6 KB node_modules/@babel/plugin-transform-class-static-block/lib/index.js
23.5 KB node_modules/@babel/plugin-transform-destructuring/lib/index.js
7.3 KB node_modules/@babel/plugin-transform-explicit-resource-management/lib/index.js
1.9 KB node_modules/@babel/plugin-transform-export-namespace-from/lib/index.js
2.0 KB node_modules/@babel/plugin-transform-logical-assignment-operators/lib/index.js
0.9 KB node_modules/@babel/plugin-transform-modules-commonjs/lib/dynamic-import.js
1.3 KB node_modules/@babel/plugin-transform-modules-commonjs/lib/hooks.js
8.8 KB node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js
1.5 KB node_modules/@babel/plugin-transform-modules-commonjs/lib/lazy.js
2.5 KB node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js
1.0 KB node_modules/@babel/plugin-transform-numeric-separator/lib/index.js
9.9 KB node_modules/@babel/plugin-transform-optional-chaining/lib/index.js
0.9 KB node_modules/@babel/plugin-transform-private-methods/lib/index.js
24.0 KB node_modules/@babel/plugin-transform-react-jsx/lib/create-plugin.js
0.4 KB node_modules/@babel/plugin-transform-react-jsx/lib/index.js
2.5 KB node_modules/@babel/plugin-transform-typescript/lib/const-enum.js
11.0 KB node_modules/@babel/plugin-transform-typescript/lib/enum.js
1.2 KB node_modules/@babel/plugin-transform-typescript/lib/global-types.js
19.8 KB node_modules/@babel/plugin-transform-typescript/lib/index.js
7.2 KB node_modules/@babel/plugin-transform-typescript/lib/namespace.js
6.3 KB node_modules/@babel/preset-typescript/lib/index.js
1.4 KB node_modules/@babel/preset-typescript/package.json
2.7 KB node_modules/@babel/template/lib/builder.js
1.8 KB node_modules/@babel/template/lib/formatters.js
1.0 KB node_modules/@babel/template/lib/index.js
2.2 KB node_modules/@babel/template/lib/literal.js
3.3 KB node_modules/@babel/template/lib/options.js
5.2 KB node_modules/@babel/template/lib/parse.js
4.9 KB node_modules/@babel/template/lib/populate.js
0.7 KB node_modules/@babel/template/lib/string.js
1.2 KB node_modules/@babel/traverse/lib/cache.js
3.7 KB node_modules/@babel/traverse/lib/context.js
0.5 KB node_modules/@babel/traverse/lib/hub.js
2.9 KB node_modules/@babel/traverse/lib/index.js
4.1 KB node_modules/@babel/traverse/lib/path/ancestry.js
1.8 KB node_modules/@babel/traverse/lib/path/comments.js
8.2 KB node_modules/@babel/traverse/lib/path/context.js
23.4 KB node_modules/@babel/traverse/lib/path/conversion.js
12.3 KB node_modules/@babel/traverse/lib/path/evaluation.js
11.8 KB node_modules/@babel/traverse/lib/path/family.js
12.0 KB node_modules/@babel/traverse/lib/path/index.js
4.8 KB node_modules/@babel/traverse/lib/path/inference/index.js
5.2 KB node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
7.4 KB node_modules/@babel/traverse/lib/path/inference/inferers.js
0.8 KB node_modules/@babel/traverse/lib/path/inference/util.js
14.2 KB node_modules/@babel/traverse/lib/path/introspection.js
6.0 KB node_modules/@babel/traverse/lib/path/lib/hoister.js
1.5 KB node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
5.0 KB node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js
1.9 KB node_modules/@babel/traverse/lib/path/lib/virtual-types.js
8.9 KB node_modules/@babel/traverse/lib/path/modification.js
2.2 KB node_modules/@babel/traverse/lib/path/removal.js
10.1 KB node_modules/@babel/traverse/lib/path/replacement.js
2.3 KB node_modules/@babel/traverse/lib/scope/binding.js
34.9 KB node_modules/@babel/traverse/lib/scope/index.js
4.3 KB node_modules/@babel/traverse/lib/scope/lib/renamer.js
2.1 KB node_modules/@babel/traverse/lib/scope/traverseForScope.js
1.0 KB node_modules/@babel/traverse/lib/traverse-node.js
8.7 KB node_modules/@babel/traverse/lib/visitors.js
0.6 KB node_modules/@babel/types/lib/asserts/assertNode.js
49.7 KB node_modules/@babel/types/lib/asserts/generated/index.js
0.6 KB node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
1.2 KB node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
1.0 KB node_modules/@babel/types/lib/builders/generated/index.js
96.2 KB node_modules/@babel/types/lib/builders/generated/lowercase.js
28.6 KB node_modules/@babel/types/lib/builders/generated/uppercase.js
0.4 KB node_modules/@babel/types/lib/builders/productions.js
0.9 KB node_modules/@babel/types/lib/builders/react/buildChildren.js
0.8 KB node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
0.3 KB node_modules/@babel/types/lib/clone/clone.js
0.4 KB node_modules/@babel/types/lib/clone/cloneDeep.js
0.4 KB node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
3.7 KB node_modules/@babel/types/lib/clone/cloneNode.js
0.4 KB node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
0.5 KB node_modules/@babel/types/lib/comments/addComment.js
0.6 KB node_modules/@babel/types/lib/comments/addComments.js
0.4 KB node_modules/@babel/types/lib/comments/inheritInnerComments.js
0.4 KB node_modules/@babel/types/lib/comments/inheritLeadingComments.js
0.7 KB node_modules/@babel/types/lib/comments/inheritsComments.js
0.4 KB node_modules/@babel/types/lib/comments/inheritTrailingComments.js
0.4 KB node_modules/@babel/types/lib/comments/removeComments.js
6.5 KB node_modules/@babel/types/lib/constants/generated/index.js
2.9 KB node_modules/@babel/types/lib/constants/index.js
0.4 KB node_modules/@babel/types/lib/converters/ensureBlock.js
2.6 KB node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
0.5 KB node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
0.9 KB node_modules/@babel/types/lib/converters/toBlock.js
0.5 KB node_modules/@babel/types/lib/converters/toComputedKey.js
0.9 KB node_modules/@babel/types/lib/converters/toExpression.js
0.8 KB node_modules/@babel/types/lib/converters/toIdentifier.js
1.2 KB node_modules/@babel/types/lib/converters/toKeyAlias.js
0.7 KB node_modules/@babel/types/lib/converters/toSequenceExpression.js
1.1 KB node_modules/@babel/types/lib/converters/toStatement.js
3.2 KB node_modules/@babel/types/lib/converters/valueToNode.js
61.0 KB node_modules/@babel/types/lib/definitions/core.js
0.4 KB node_modules/@babel/types/lib/definitions/deprecated-aliases.js
3.4 KB node_modules/@babel/types/lib/definitions/experimental.js
18.1 KB node_modules/@babel/types/lib/definitions/flow.js
3.1 KB node_modules/@babel/types/lib/definitions/index.js
4.8 KB node_modules/@babel/types/lib/definitions/jsx.js
0.9 KB node_modules/@babel/types/lib/definitions/misc.js
1.2 KB node_modules/@babel/types/lib/definitions/placeholders.js
18.5 KB node_modules/@babel/types/lib/definitions/typescript.js
10.8 KB node_modules/@babel/types/lib/definitions/utils.js
18.1 KB node_modules/@babel/types/lib/index.js
0.6 KB node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
2.2 KB node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
0.9 KB node_modules/@babel/types/lib/modifications/inherits.js
0.7 KB node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
0.9 KB node_modules/@babel/types/lib/modifications/removeProperties.js
0.5 KB node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
2.3 KB node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js
1.4 KB node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
3.3 KB node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
2.0 KB node_modules/@babel/types/lib/retrievers/getFunctionName.js
0.5 KB node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
1.4 KB node_modules/@babel/types/lib/traverse/traverse.js
1.1 KB node_modules/@babel/types/lib/traverse/traverseFast.js
1.4 KB node_modules/@babel/types/lib/utils/deprecationWarning.js
0.4 KB node_modules/@babel/types/lib/utils/inherit.js
1.4 KB node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
0.5 KB node_modules/@babel/types/lib/utils/shallowEqual.js
0.5 KB node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
105.3 KB node_modules/@babel/types/lib/validators/generated/index.js
0.9 KB node_modules/@babel/types/lib/validators/is.js
0.9 KB node_modules/@babel/types/lib/validators/isBinding.js
0.5 KB node_modules/@babel/types/lib/validators/isBlockScoped.js
0.6 KB node_modules/@babel/types/lib/validators/isImmutable.js
0.5 KB node_modules/@babel/types/lib/validators/isLet.js
0.4 KB node_modules/@babel/types/lib/validators/isNode.js
1.7 KB node_modules/@babel/types/lib/validators/isNodesEquivalent.js
0.6 KB node_modules/@babel/types/lib/validators/isPlaceholderType.js
3.0 KB node_modules/@babel/types/lib/validators/isReferenced.js
0.6 KB node_modules/@babel/types/lib/validators/isScope.js
0.5 KB node_modules/@babel/types/lib/validators/isSpecifierDefault.js
0.6 KB node_modules/@babel/types/lib/validators/isType.js
0.8 KB node_modules/@babel/types/lib/validators/isValidES3Identifier.js
0.7 KB node_modules/@babel/types/lib/validators/isValidIdentifier.js
0.5 KB node_modules/@babel/types/lib/validators/isVar.js
1.6 KB node_modules/@babel/types/lib/validators/matchesPattern.js
0.3 KB node_modules/@babel/types/lib/validators/react/isCompatTag.js
0.5 KB node_modules/@babel/types/lib/validators/react/isReactComponent.js
1.7 KB node_modules/@babel/types/lib/validators/validate.js
12.8 KB node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js
5.8 KB node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js
16.9 KB node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
21.4 KB node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js
0.4 KB node_modules/browserslist/error.js
37.3 KB node_modules/browserslist/index.js
14.3 KB node_modules/browserslist/node.js
2.1 KB node_modules/browserslist/parse.js
28.2 KB node_modules/caniuse-lite/data/agents.js
0.4 KB node_modules/caniuse-lite/data/browsers.js
2.8 KB node_modules/caniuse-lite/data/browserVersions.js
0.5 KB node_modules/caniuse-lite/dist/lib/statuses.js
0.3 KB node_modules/caniuse-lite/dist/lib/supported.js
1.7 KB node_modules/caniuse-lite/dist/unpacker/agents.js
0.2 KB node_modules/caniuse-lite/dist/unpacker/browsers.js
0.2 KB node_modules/caniuse-lite/dist/unpacker/browserVersions.js
1.6 KB node_modules/caniuse-lite/dist/unpacker/feature.js
0.7 KB node_modules/caniuse-lite/dist/unpacker/region.js
6.8 KB node_modules/convert-source-map/index.js
4.6 KB node_modules/debug/src/browser.js
5.8 KB node_modules/debug/src/common.js
0.3 KB node_modules/debug/src/index.js
4.2 KB node_modules/debug/src/node.js
4.2 KB node_modules/electron-to-chromium/versions.js
9.3 KB node_modules/gensync/index.js
0.4 KB node_modules/has-flag/index.js
1.4 KB node_modules/js-tokens/index.js
9.1 KB node_modules/jsesc/jsesc.js
0.3 KB node_modules/json5/lib/index.js
20.2 KB node_modules/json5/lib/parse.js
6.8 KB node_modules/json5/lib/stringify.js
15.5 KB node_modules/json5/lib/unicode.js
0.9 KB node_modules/json5/lib/util.js
8.2 KB node_modules/lru-cache/index.js
2.8 KB node_modules/ms/index.js
33.0 KB node_modules/node-releases/data/processed/envs.json
2.3 KB node_modules/node-releases/data/release-schedule/release-schedule.json
3.1 KB node_modules/picocolors/picocolors.js
3.4 KB node_modules/supports-color/index.js
0.3 KB node_modules/yallist/iterator.js
9.7 KB node_modules/yallist/yallist.js
3.5 KB packages/playwright/src/transform/babelBundle.ts
## External (0)

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,335 @@
packages/playwright/lib/transform/esmLoader.js
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
The following npm packages are inlined into this bundle.
- balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
- brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
- buffer-from@1.1.2 (https://github.com/LinusU/buffer-from)
- concat-map@0.0.1 (https://github.com/substack/node-concat-map)
- debug@4.4.3 (https://github.com/debug-js/debug)
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
- json5@2.2.3 (https://github.com/json5/json5)
- mime@3.0.0 (https://github.com/broofa/mime)
- minimatch@3.1.5 (https://github.com/isaacs/minimatch)
- ms@2.1.3 (https://github.com/vercel/ms)
- source-map-support@0.5.21 (https://github.com/evanw/node-source-map-support)
- source-map@0.6.1 (https://github.com/mozilla/source-map)
- supports-color@8.1.1 (https://github.com/chalk/supports-color)
%% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
(MIT)
Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF balanced-match@1.0.2 NOTICES AND INFORMATION
%% brace-expansion@1.1.12 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF brace-expansion@1.1.12 NOTICES AND INFORMATION
%% buffer-from@1.1.2 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) 2016, 2018 Linus Unnebäck
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF buffer-from@1.1.2 NOTICES AND INFORMATION
%% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
This software is released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF concat-map@0.0.1 NOTICES AND INFORMATION
%% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF debug@4.4.3 NOTICES AND INFORMATION
%% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF has-flag@4.0.0 NOTICES AND INFORMATION
%% json5@2.2.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) 2012-2018 Aseem Kishore, and [others].
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[others]: https://github.com/json5/json5/contributors
=========================================
END OF json5@2.2.3 NOTICES AND INFORMATION
%% mime@3.0.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF mime@3.0.0 NOTICES AND INFORMATION
%% minimatch@3.1.5 NOTICES AND INFORMATION BEGIN HERE
=========================================
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=========================================
END OF minimatch@3.1.5 NOTICES AND INFORMATION
%% ms@2.1.3 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2020 Vercel, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF ms@2.1.3 NOTICES AND INFORMATION
%% source-map-support@0.5.21 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2014 Evan Wallace
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
=========================================
END OF source-map-support@0.5.21 NOTICES AND INFORMATION
%% source-map@0.6.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2009-2011, Mozilla Foundation and contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the names of the Mozilla Foundation nor the names of project
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================
END OF source-map@0.6.1 NOTICES AND INFORMATION
%% supports-color@8.1.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF supports-color@8.1.1 NOTICES AND INFORMATION
SUMMARY
=========================================
Total Packages: 13
=========================================

View File

@@ -0,0 +1,55 @@
# packages/playwright/lib/transform/esmLoader.js
# total: 245.0 KB
## Inlined (46)
1.5 KB node_modules/balanced-match/index.js
4.4 KB node_modules/brace-expansion/index.js
1.8 KB node_modules/buffer-from/index.js
0.5 KB node_modules/concat-map/index.js
4.6 KB node_modules/debug/src/browser.js
5.8 KB node_modules/debug/src/common.js
0.3 KB node_modules/debug/src/index.js
4.2 KB node_modules/debug/src/node.js
0.4 KB node_modules/has-flag/index.js
0.2 KB node_modules/json5/lib/index.js
20.2 KB node_modules/json5/lib/parse.js
6.8 KB node_modules/json5/lib/stringify.js
15.5 KB node_modules/json5/lib/unicode.js
0.9 KB node_modules/json5/lib/util.js
0.2 KB node_modules/mime/index.js
2.0 KB node_modules/mime/Mime.js
26.8 KB node_modules/mime/types/other.js
10.1 KB node_modules/mime/types/standard.js
20.9 KB node_modules/minimatch/minimatch.js
2.8 KB node_modules/ms/index.js
16.1 KB node_modules/source-map-support/source-map-support.js
2.2 KB node_modules/source-map/lib/array-set.js
1.7 KB node_modules/source-map/lib/base64-vlq.js
1.1 KB node_modules/source-map/lib/base64.js
1.5 KB node_modules/source-map/lib/binary-search.js
1.3 KB node_modules/source-map/lib/mapping-list.js
0.9 KB node_modules/source-map/lib/quick-sort.js
24.0 KB node_modules/source-map/lib/source-map-consumer.js
10.6 KB node_modules/source-map/lib/source-map-generator.js
9.6 KB node_modules/source-map/lib/source-node.js
8.6 KB node_modules/source-map/lib/util.js
0.3 KB node_modules/source-map/source-map.js
3.4 KB node_modules/supports-color/index.js
0.1 KB packages/isomorphic/rtti.ts
0.2 KB packages/isomorphic/stackTrace.ts
0.2 KB packages/isomorphic/stringUtils.ts
6.3 KB packages/playwright/src/transform/compilationCache.ts
3.1 KB packages/playwright/src/transform/esmLoader.ts
1.1 KB packages/playwright/src/transform/pirates.ts
1.1 KB packages/playwright/src/transform/portTransport.ts
9.7 KB packages/playwright/src/transform/transform.ts
2.9 KB packages/playwright/src/transform/tsconfig-loader.ts
4.6 KB packages/playwright/src/util.ts
0.2 KB packages/utils/crypto.ts
0.2 KB packages/utils/debug.ts
0.5 KB packages/utils/env.ts
## External (3)
../globals
../package
playwright-core/package.json

403
frontend/node_modules/playwright/lib/util.js generated vendored Normal file
View File

@@ -0,0 +1,403 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var util_exports = {};
__export(util_exports, {
addSuffixToFilePath: () => addSuffixToFilePath,
ansiRegex: () => ansiRegex,
createFileMatcher: () => createFileMatcher,
createTitleMatcher: () => createTitleMatcher,
debugTest: () => debugTest,
errorWithFile: () => errorWithFile,
expectTypes: () => expectTypes,
fileExistsAsync: () => fileExistsAsync,
fileIsModule: () => fileIsModule,
filterStackFile: () => filterStackFile,
filterStackTrace: () => filterStackTrace,
filteredStackTrace: () => filteredStackTrace,
forceRegExp: () => forceRegExp,
formatLocation: () => formatLocation,
getContainedPath: () => getContainedPath,
getPackageJsonPath: () => getPackageJsonPath,
mergeObjects: () => mergeObjects,
normalizeAndSaveAttachment: () => normalizeAndSaveAttachment,
parseLocationArg: () => parseLocationArg,
relativeFilePath: () => relativeFilePath,
removeDirAndLogToConsole: () => removeDirAndLogToConsole,
resolveImportSpecifierAfterMapping: () => resolveImportSpecifierAfterMapping,
resolveReporterOutputPath: () => resolveReporterOutputPath,
sanitizeFilePathBeforeExtension: () => sanitizeFilePathBeforeExtension,
serializeError: () => serializeError,
stripAnsiEscapes: () => stripAnsiEscapes,
takeFirst: () => takeFirst,
trimLongString: () => trimLongString,
windowsFilesystemFriendlyLength: () => windowsFilesystemFriendlyLength
});
module.exports = __toCommonJS(util_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_url = __toESM(require("url"));
var import_util = __toESM(require("util"));
const debug = require("playwright-core/lib/utilsBundle").debug;
const mime = require("playwright-core/lib/utilsBundle").mime;
const minimatch = require("playwright-core/lib/utilsBundle").minimatch;
const { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
const { sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
const { isRegExp } = require("playwright-core/lib/coreBundle").iso;
const { parseStackFrame, stringifyStackFrames } = require("playwright-core/lib/coreBundle").iso;
const { ansiRegex, isString, stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
const PLAYWRIGHT_TEST_PATH = import_path.default.join(__dirname, "..");
const PLAYWRIGHT_CORE_PATH = import_path.default.dirname(require.resolve("playwright-core/package.json"));
function filterStackTrace(e) {
const name = e.name ? e.name + ": " : "";
const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
if (process.env.PWDEBUGIMPL)
return { message: name + e.message, stack: e.stack || "", cause };
const stackLines = stringifyStackFrames(filteredStackTrace(e.stack?.split("\n") || []));
return {
message: name + e.message,
stack: `${name}${e.message}${stackLines.map((line) => "\n" + line).join("")}`,
cause
};
}
function filterStackFile(file) {
if (process.env.PWDEBUGIMPL)
return true;
if (file.startsWith(PLAYWRIGHT_TEST_PATH))
return false;
if (file.startsWith(PLAYWRIGHT_CORE_PATH))
return false;
return true;
}
function filteredStackTrace(rawStack) {
const frames = [];
for (const line of rawStack) {
const frame = parseStackFrame(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
if (!frame || !frame.file)
continue;
if (!filterStackFile(frame.file))
continue;
frames.push(frame);
}
return frames;
}
function serializeError(error) {
if (error instanceof Error)
return filterStackTrace(error);
return {
value: import_util.default.inspect(error)
};
}
function parseLocationArg(arg) {
const match = /^(.*?):(\d+):?(\d+)?$/.exec(arg);
return {
file: match ? match[1] : arg,
line: match ? parseInt(match[2], 10) : null,
column: match?.[3] ? parseInt(match[3], 10) : null
};
}
function createFileMatcher(patterns) {
const reList = [];
const filePatterns = [];
for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
if (isRegExp(pattern)) {
reList.push(pattern);
} else {
if (!pattern.startsWith("**/"))
filePatterns.push("**/" + pattern);
else
filePatterns.push(pattern);
}
}
return (filePath) => {
for (const re of reList) {
re.lastIndex = 0;
if (re.test(filePath))
return true;
}
if (import_path.default.sep === "\\") {
const fileURL = import_url.default.pathToFileURL(filePath).href;
for (const re of reList) {
re.lastIndex = 0;
if (re.test(fileURL))
return true;
}
}
for (const pattern of filePatterns) {
if (minimatch(filePath, pattern, { nocase: true, dot: true }))
return true;
}
return false;
};
}
function createTitleMatcher(patterns) {
const reList = Array.isArray(patterns) ? patterns : [patterns];
return (value) => {
for (const re of reList) {
re.lastIndex = 0;
if (re.test(value))
return true;
}
return false;
};
}
function mergeObjects(a, b, c) {
const result = { ...a };
for (const x of [b, c].filter(Boolean)) {
for (const [name, value] of Object.entries(x)) {
if (!Object.is(value, void 0))
result[name] = value;
}
}
return result;
}
function forceRegExp(pattern) {
const match = pattern.match(/^\/(.*)\/([gi]*)$/);
if (match)
return new RegExp(match[1], match[2]);
return new RegExp(pattern, "gi");
}
function relativeFilePath(file) {
if (!import_path.default.isAbsolute(file))
return file;
return import_path.default.relative(process.cwd(), file);
}
function formatLocation(location) {
return relativeFilePath(location.file) + ":" + location.line + ":" + location.column;
}
function errorWithFile(file, message) {
return new Error(`${relativeFilePath(file)}: ${message}`);
}
function expectTypes(receiver, types, matcherName) {
if (typeof receiver !== "object" || !types.includes(receiver._apiName)) {
const receiverString = typeof receiver === "object" && receiver !== null ? `${receiver.constructor.name} ${import_util.default.inspect(receiver)}` : String(receiver);
const commaSeparated = types.slice();
const lastType = commaSeparated.pop();
const typesString = commaSeparated.length ? commaSeparated.join(", ") + " or " + lastType : lastType;
throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}, was called with ${receiverString}`);
}
}
const windowsFilesystemFriendlyLength = 60;
function trimLongString(s, length = 100) {
if (s.length <= length)
return s;
const hash = calculateSha1(s);
const middle = `-${hash.substring(0, 5)}-`;
const start = Math.floor((length - middle.length) / 2);
const end = length - middle.length - start;
return s.substring(0, start) + middle + s.slice(-end);
}
function addSuffixToFilePath(filePath, suffix) {
const ext = import_path.default.extname(filePath);
const base = filePath.substring(0, filePath.length - ext.length);
return base + suffix + ext;
}
function sanitizeFilePathBeforeExtension(filePath, ext) {
ext ??= import_path.default.extname(filePath);
const base = filePath.substring(0, filePath.length - ext.length);
return sanitizeForFilePath(base) + ext;
}
function getContainedPath(parentPath, subPath = "") {
const resolvedPath = import_path.default.resolve(parentPath, subPath);
if (resolvedPath === parentPath || resolvedPath.startsWith(parentPath + import_path.default.sep))
return resolvedPath;
return null;
}
const debugTest = debug("pw:test");
const folderToPackageJsonPath = /* @__PURE__ */ new Map();
function getPackageJsonPath(folderPath) {
const cached = folderToPackageJsonPath.get(folderPath);
if (cached !== void 0)
return cached;
const packageJsonPath = import_path.default.join(folderPath, "package.json");
if (import_fs.default.existsSync(packageJsonPath)) {
folderToPackageJsonPath.set(folderPath, packageJsonPath);
return packageJsonPath;
}
const parentFolder = import_path.default.dirname(folderPath);
if (folderPath === parentFolder) {
folderToPackageJsonPath.set(folderPath, "");
return "";
}
const result = getPackageJsonPath(parentFolder);
folderToPackageJsonPath.set(folderPath, result);
return result;
}
function resolveReporterOutputPath(defaultValue, configDir, configValue) {
if (configValue)
return import_path.default.resolve(configDir, configValue);
let basePath = getPackageJsonPath(configDir);
basePath = basePath ? import_path.default.dirname(basePath) : process.cwd();
return import_path.default.resolve(basePath, defaultValue);
}
async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
if (options.path === void 0 && options.body === void 0)
return { name, contentType: "text/plain" };
if ((options.path !== void 0 ? 1 : 0) + (options.body !== void 0 ? 1 : 0) !== 1)
throw new Error(`Exactly one of "path" and "body" must be specified`);
if (options.path !== void 0) {
const hash = calculateSha1(options.path);
if (!isString(name))
throw new Error('"name" should be string.');
const sanitizedNamePrefix = sanitizeForFilePath(name) + "-";
const dest = import_path.default.join(outputPath, "attachments", sanitizedNamePrefix + hash + import_path.default.extname(options.path));
await import_fs.default.promises.mkdir(import_path.default.dirname(dest), { recursive: true });
await import_fs.default.promises.copyFile(options.path, dest);
const contentType = options.contentType ?? (mime.getType(import_path.default.basename(options.path)) || "application/octet-stream");
return { name, contentType, path: dest };
} else {
const contentType = options.contentType ?? (typeof options.body === "string" ? "text/plain" : "application/octet-stream");
return { name, contentType, body: typeof options.body === "string" ? Buffer.from(options.body) : options.body };
}
}
function fileIsModule(file) {
if (file.endsWith(".mjs") || file.endsWith(".mts"))
return true;
if (file.endsWith(".cjs") || file.endsWith(".cts"))
return false;
const folder = import_path.default.dirname(file);
return folderIsModule(folder);
}
function folderIsModule(folder) {
const packageJsonPath = getPackageJsonPath(folder);
if (!packageJsonPath)
return false;
return require(packageJsonPath).type === "module";
}
const packageJsonMainFieldCache = /* @__PURE__ */ new Map();
function getMainFieldFromPackageJson(packageJsonPath) {
if (!packageJsonMainFieldCache.has(packageJsonPath)) {
let mainField;
try {
mainField = JSON.parse(import_fs.default.readFileSync(packageJsonPath, "utf8")).main;
} catch {
}
packageJsonMainFieldCache.set(packageJsonPath, mainField);
}
return packageJsonMainFieldCache.get(packageJsonPath);
}
const kExtLookups = /* @__PURE__ */ new Map([
[".js", [".jsx", ".ts", ".tsx"]],
[".jsx", [".tsx"]],
[".cjs", [".cts"]],
[".mjs", [".mts"]],
["", [".js", ".ts", ".jsx", ".tsx", ".cjs", ".mjs", ".cts", ".mts"]]
]);
function resolveImportSpecifierExtension(resolved) {
if (fileExists(resolved))
return resolved;
for (const [ext, others] of kExtLookups) {
if (!resolved.endsWith(ext))
continue;
for (const other of others) {
const modified = resolved.substring(0, resolved.length - ext.length) + other;
if (fileExists(modified))
return modified;
}
break;
}
}
function resolveImportSpecifierAfterMapping(resolved, afterPathMapping) {
const resolvedFile = resolveImportSpecifierExtension(resolved);
if (resolvedFile)
return resolvedFile;
if (dirExists(resolved)) {
const packageJsonPath = import_path.default.join(resolved, "package.json");
if (afterPathMapping) {
const mainField = getMainFieldFromPackageJson(packageJsonPath);
const mainFieldResolved = mainField ? resolveImportSpecifierExtension(import_path.default.resolve(resolved, mainField)) : void 0;
return mainFieldResolved || resolveImportSpecifierExtension(import_path.default.join(resolved, "index"));
}
if (fileExists(packageJsonPath))
return resolved;
const dirImport = import_path.default.join(resolved, "index");
return resolveImportSpecifierExtension(dirImport);
}
}
function fileExists(resolved) {
return import_fs.default.statSync(resolved, { throwIfNoEntry: false })?.isFile();
}
async function fileExistsAsync(resolved) {
try {
const stat = await import_fs.default.promises.stat(resolved);
return stat.isFile();
} catch {
return false;
}
}
function dirExists(resolved) {
return import_fs.default.statSync(resolved, { throwIfNoEntry: false })?.isDirectory();
}
async function removeDirAndLogToConsole(dir) {
try {
if (!import_fs.default.existsSync(dir))
return;
console.log(`Removing ${await import_fs.default.promises.realpath(dir)}`);
await import_fs.default.promises.rm(dir, { recursive: true, force: true });
} catch {
}
}
function takeFirst(...args) {
for (const arg of args) {
if (arg !== void 0)
return arg;
}
return void 0;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
addSuffixToFilePath,
ansiRegex,
createFileMatcher,
createTitleMatcher,
debugTest,
errorWithFile,
expectTypes,
fileExistsAsync,
fileIsModule,
filterStackFile,
filterStackTrace,
filteredStackTrace,
forceRegExp,
formatLocation,
getContainedPath,
getPackageJsonPath,
mergeObjects,
normalizeAndSaveAttachment,
parseLocationArg,
relativeFilePath,
removeDirAndLogToConsole,
resolveImportSpecifierAfterMapping,
resolveReporterOutputPath,
sanitizeFilePathBeforeExtension,
serializeError,
stripAnsiEscapes,
takeFirst,
trimLongString,
windowsFilesystemFriendlyLength
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
# packages/playwright/lib/worker/workerProcessEntry.js
# total: 123.4 KB
## Inlined (12)
4.7 KB packages/playwright/src/util.ts
8.6 KB packages/playwright/src/worker/fixtureRunner.ts
20.8 KB packages/playwright/src/worker/testInfo.ts
11.6 KB packages/playwright/src/worker/testTracing.ts
5.4 KB packages/playwright/src/worker/timeoutManager.ts
0.3 KB packages/playwright/src/worker/util.ts
21.0 KB packages/playwright/src/worker/workerMain.ts
0.1 KB packages/playwright/src/worker/workerProcessEntry.ts
6.0 KB packages/utils/third_party/yauzl/buffer-crc32.js
9.3 KB packages/utils/third_party/yauzl/fd-slicer.js
32.2 KB packages/utils/third_party/yauzl/index.js
1.4 KB packages/utils/third_party/yauzl/pend.js
## External (6)
../common
../globals
../matchers/expect
playwright-core/lib/coreBundle
playwright-core/lib/utilsBundle
playwright-core/package.json