feat: Geutebruck GeViScope/GeViSoft Action Mapping System - MVP
This MVP release provides a complete full-stack solution for managing action mappings in Geutebruck's GeViScope and GeViSoft video surveillance systems. ## Features ### Flutter Web Application (Port 8081) - Modern, responsive UI for managing action mappings - Action picker dialog with full parameter configuration - Support for both GSC (GeViScope) and G-Core server actions - Consistent UI for input and output actions with edit/delete capabilities - Real-time action mapping creation, editing, and deletion - Server categorization (GSC: prefix for GeViScope, G-Core: prefix for G-Core servers) ### FastAPI REST Backend (Port 8000) - RESTful API for action mapping CRUD operations - Action template service with comprehensive action catalog (247 actions) - Server management (G-Core and GeViScope servers) - Configuration tree reading and writing - JWT authentication with role-based access control - PostgreSQL database integration ### C# SDK Bridge (gRPC, Port 50051) - Native integration with GeViSoft SDK (GeViProcAPINET_4_0.dll) - Action mapping creation with correct binary format - Support for GSC and G-Core action types - Proper Camera parameter inclusion in action strings (fixes CrossSwitch bug) - Action ID lookup table with server-specific action IDs - Configuration reading/writing via SetupClient ## Bug Fixes - **CrossSwitch Bug**: GSC and G-Core actions now correctly display camera/PTZ head parameters in GeViSet - Action strings now include Camera parameter: `@ PanLeft (Comment: "", Camera: 101028)` - Proper filter flags and VideoInput=0 for action mappings - Correct action ID assignment (4198 for GSC, 9294 for G-Core PanLeft) ## Technical Stack - **Frontend**: Flutter Web, Dart, Dio HTTP client - **Backend**: Python FastAPI, PostgreSQL, Redis - **SDK Bridge**: C# .NET 8.0, gRPC, GeViSoft SDK - **Authentication**: JWT tokens - **Configuration**: GeViSoft .set files (binary format) ## Credentials - GeViSoft/GeViScope: username=sysadmin, password=masterkey - Default admin: username=admin, password=admin123 ## Deployment All services run on localhost: - Flutter Web: http://localhost:8081 - FastAPI: http://localhost:8000 - SDK Bridge gRPC: localhost:50051 - GeViServer: localhost (default port) Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
34
.playwright-mcp/node_modules/playwright/lib/agents/copilot-setup-steps.yml
generated
vendored
Normal file
34
.playwright-mcp/node_modules/playwright/lib/agents/copilot-setup-steps.yml
generated
vendored
Normal 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
|
||||
395
.playwright-mcp/node_modules/playwright/lib/agents/generateAgents.js
generated
vendored
Normal file
395
.playwright-mcp/node_modules/playwright/lib/agents/generateAgents.js
generated
vendored
Normal file
@@ -0,0 +1,395 @@
|
||||
"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_utilsBundle = require("playwright-core/lib/utilsBundle");
|
||||
var import_utils = require("playwright-core/lib/utils");
|
||||
var import_seed = require("../mcp/test/seed");
|
||||
class AgentParser {
|
||||
static async loadAgents() {
|
||||
const files = await import_fs.default.promises.readdir(__dirname);
|
||||
return Promise.all(files.filter((file) => file.endsWith(".agent.md")).map((file) => AgentParser.parseFile(import_path.default.join(__dirname, file))));
|
||||
}
|
||||
static async parseFile(filePath) {
|
||||
const source = await import_fs.default.promises.readFile(filePath, "utf-8");
|
||||
const { header, content } = this.extractYamlAndContent(source);
|
||||
const { instructions, examples } = this.extractInstructionsAndExamples(content);
|
||||
return { header, instructions, examples };
|
||||
}
|
||||
static 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 = import_utilsBundle.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 };
|
||||
}
|
||||
static 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 };
|
||||
}
|
||||
}
|
||||
class ClaudeGenerator {
|
||||
static async init(config, projectName, prompts) {
|
||||
await initRepo(config, projectName, {
|
||||
promptsFolder: prompts ? ".claude/prompts" : void 0
|
||||
});
|
||||
const agents = await AgentParser.loadAgents();
|
||||
await import_fs.default.promises.mkdir(".claude/agents", { recursive: true });
|
||||
for (const agent of agents)
|
||||
await writeFile(`.claude/agents/${agent.header.name}.md`, ClaudeGenerator.agentSpec(agent), "\u{1F916}", "agent definition");
|
||||
await writeFile(".mcp.json", JSON.stringify({
|
||||
mcpServers: {
|
||||
"playwright-test": {
|
||||
command: "npx",
|
||||
args: ["playwright", "run-test-mcp-server"]
|
||||
}
|
||||
}
|
||||
}, 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.header.name,
|
||||
description: agent.header.description + examples,
|
||||
tools: agent.header.tools.map((tool) => asClaudeTool(tool)).join(", "),
|
||||
model: agent.header.model,
|
||||
color: agent.header.color
|
||||
};
|
||||
lines.push(`---`);
|
||||
lines.push(import_utilsBundle.yaml.stringify(header, { lineWidth: 1e5 }) + `---`);
|
||||
lines.push("");
|
||||
lines.push(agent.instructions);
|
||||
return lines.join("\n");
|
||||
}
|
||||
}
|
||||
class OpencodeGenerator {
|
||||
static async init(config, projectName, prompts) {
|
||||
await initRepo(config, projectName, {
|
||||
defaultAgentName: "Build",
|
||||
promptsFolder: prompts ? ".opencode/prompts" : void 0
|
||||
});
|
||||
const agents = await AgentParser.loadAgents();
|
||||
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.header.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.header.name] = {
|
||||
description: agent.header.description,
|
||||
mode: "subagent",
|
||||
prompt: `{file:.opencode/prompts/${agent.header.name}.md}`,
|
||||
tools
|
||||
};
|
||||
for (const tool of agent.header.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(config, projectName, prompts) {
|
||||
await initRepo(config, projectName, {
|
||||
defaultAgentName: "agent",
|
||||
promptsFolder: prompts ? ".github/prompts" : void 0,
|
||||
promptSuffix: "prompt"
|
||||
});
|
||||
const agents = await AgentParser.loadAgents();
|
||||
await import_fs.default.promises.mkdir(".github/agents", { recursive: true });
|
||||
for (const agent of agents)
|
||||
await writeFile(`.github/agents/${agent.header.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.header.name,
|
||||
"description": agent.header.description + examples,
|
||||
"tools": agent.header.tools,
|
||||
"model": "Claude Sonnet 4",
|
||||
"mcp-servers": CopilotGenerator.mcpServers
|
||||
};
|
||||
lines.push(`---`);
|
||||
lines.push(import_utilsBundle.yaml.stringify(header) + `---`);
|
||||
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(config, projectName) {
|
||||
await initRepo(config, projectName, {
|
||||
promptsFolder: void 0
|
||||
});
|
||||
const agents = await AgentParser.loadAgents();
|
||||
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.header.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.header.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.header.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)} ${import_utilsBundle.colors.dim("- " + description)}`);
|
||||
await (0, import_utils.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)} ${import_utilsBundle.colors.dim("- " + description)}`);
|
||||
await import_fs.default.promises.unlink(filePath);
|
||||
}
|
||||
async function initRepo(config, projectName, options) {
|
||||
const project = (0, import_seed.seedProject)(config, 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
|
||||
});
|
||||
31
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md
generated
vendored
Normal file
31
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md
generated
vendored
Normal 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>
|
||||
8
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md
generated
vendored
Normal file
8
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md
generated
vendored
Normal 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`
|
||||
88
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-generator.agent.md
generated
vendored
Normal file
88
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-generator.agent.md
generated
vendored
Normal 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>
|
||||
6
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md
generated
vendored
Normal file
6
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
agent: playwright-test-healer
|
||||
description: Fix tests
|
||||
---
|
||||
|
||||
Run all my tests and fix the failing ones.
|
||||
55
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-healer.agent.md
generated
vendored
Normal file
55
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-healer.agent.md
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
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_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
|
||||
9
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md
generated
vendored
Normal file
9
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md
generated
vendored
Normal 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`
|
||||
72
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-planner.agent.md
generated
vendored
Normal file
72
.playwright-mcp/node_modules/playwright/lib/agents/playwright-test-planner.agent.md
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
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_requests
|
||||
- playwright-test/browser_press_key
|
||||
- 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.
|
||||
Reference in New Issue
Block a user