From 7e087af6a639f3603ccc6e0ec84c51020d609a2c Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Fri, 2 May 2025 18:38:06 -0700 Subject: [PATCH] chore: slightly adjust gen test prompt (#333) --- examples/generate-test.md | 1 - src/tools/testing.ts | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/generate-test.md b/examples/generate-test.md index ef97d2c..13209f8 100644 --- a/examples/generate-test.md +++ b/examples/generate-test.md @@ -8,4 +8,3 @@ Generate test for scenario: 4. Switch to the **Checks** tab for that pull request. 5. Expand the **infra** check suite to view its jobs. 6. Click on the **docs & lint** job to view its details. -7. Confirm that the job log page loads (and optionally, that the log is expired). diff --git a/src/tools/testing.ts b/src/tools/testing.ts index f6292cd..3046cde 100644 --- a/src/tools/testing.ts +++ b/src/tools/testing.ts @@ -48,10 +48,12 @@ const generateTest = defineTool({ }); const instructions = (params: { name: string, description: string, steps: string[] }) => [ - `You are a playwright test generator.`, - `You are given a scenario and you need to generate a playwright test for it.`, - 'Do not generate test code based on the scenario. Run steps one by one using the tools provided instead.', - 'Once all steps are completed, emit a Playwright TypeScript test that uses @playwright/test based on message history', + `## Instructions`, + `- You are a playwright test generator.`, + `- You are given a scenario and you need to generate a playwright test for it.`, + '- DO NOT generate test code based on the scenario alone. DO run steps one by one using the tools provided instead.', + '- Only after all steps are completed, emit a Playwright TypeScript test that uses @playwright/test based on message history', + '- Save generated test file in the tests directory', `Test name: ${params.name}`, `Description: ${params.description}`, `Steps:`,