Module: routes/testEdit

Prompt builder for DIF-007 conversational test editing.

When a chat request arrives with context.mode === "test_edit", the standard workspace-aware system prompt is swapped out for a dedicated test-edit prompt that instructs the model to return a short summary plus exactly one fenced JavaScript code block containing the full updated Playwright test. Keeping this isolated from chat.js avoids bloating that file and makes the test-edit contract easy to unit test.

Source:

Methods

(static) buildTestEditPrompt(context, lastMessage) → {Object}

Build the system + user prompt for a test-edit chat turn.

Parameters:
Name Type Description
context Object

Chat context object from the request body.

Properties
Name Type Attributes Description
testCode string <optional>

Current Playwright source.

testName string <optional>

Human-readable test name.

testSteps Array.<string> <optional>

Ordered step descriptions.

lastMessage Object

The latest user message.

Source:
Returns:
Type
Object