Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/playwright/src/agents/generateAgents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,21 @@ export async function initVSCodeRepo() {
args: commonMcpServers.playwrightTest.args,
};
await writeFile(mcpJsonPath, JSON.stringify(mcpJson, null, 2));

await copyVSCodePrompts();
}

async function copyVSCodePrompts() {
await fs.promises.mkdir('.github/prompts', { recursive: true });
const promptsDir = path.join(__dirname, 'vscode');
const promptFiles = await fs.promises.readdir(promptsDir);
for (const file of promptFiles) {
if (file.endsWith('.prompt.md')) {
const sourcePath = path.join(promptsDir, file);
const content = await fs.promises.readFile(sourcePath, 'utf-8');
await writeFile(`.github/prompts/${file}`, content);
}
}
}

export async function initOpencodeRepo() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
description: Create test plans for web applications.
mode: playwright-test-planner
---

Create 3-5 test scenarios for the project's web application. Ask for more information if you cannot figure it out from the project source code.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
description: Create Playwright tests from a test plan.
mode: playwright-test-generator
---

Convert the test plan scenarios into Playwright tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
description: Debug and fix failing Playwright tests.
mode: playwright-test-healer
---

Fix failing Playwright tests. Keep iterating until all tests pass.
6 changes: 6 additions & 0 deletions utils/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,12 @@ copyFiles.push({
to: 'packages/playwright/lib',
});

copyFiles.push({
files: 'packages/playwright/src/agents/vscode/*.prompt.md',
from: 'packages/playwright/src',
to: 'packages/playwright/lib',
});

if (watchMode) {
// Run TypeScript for type checking.
steps.push(new ProgramStep({
Expand Down
Loading