Skip to main content
Glama

appendScenarioToFile

Append recorded browser scenarios as test code to an existing file, with support for Playwright, Selenium, and Page Object integration.

Instructions

Append scenario as test code to EXISTING file. Supports Page Object integration: 'generate-integrated' generates POM + test using it, 'use-existing' generates test using existing POM file. Use exportScenarioAsCode for new files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageYesTarget test framework and language
testNameNoOverride test name (default: from scenario name)
targetFileYesPath to existing test file to append to (REQUIRED)
scenarioNameYesName of scenario to export
cleanSelectorsNoRemove unstable CSS classes (default: true)
insertPositionNoWhere to insert test: 'end' (default - after all tests), 'before' (before reference test), or 'after' (after reference test)
pageObjectFileNoPath to existing POM file (required for 'use-existing' mode)
pageObjectModeNoPOM integration: 'none' (default), 'generate' (separate POM), 'generate-integrated' (POM + test using it), 'use-existing' (test uses existing POM file)
includeCommentsNoInclude descriptive comments (default: true)
referenceTestNameNoReference test name for 'before'/'after' insertion. Required when insertPosition is 'before' or 'after'
generatePageObjectNoAlso generate Page Object class for the page (default: false). Legacy - use pageObjectMode instead.
pageObjectClassNameNoPage Object class name (optional, auto-generated if not provided)
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears the full burden. It discloses that the tool appends to existing files and describes two Page Object modes, but omits the 'generate' mode behavior (separate POM creation) and does not detail failure conditions or side effects beyond appending. This is adequate but has clear gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise, front-loaded sentences that immediately state the primary purpose and then provide key usage distinctions. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 12 parameters and full schema coverage, the description captures the core workflow (append to existing, use export for new) and key mode differences. It doesn't explain all modes, but the schema fills in details. No output schema is needed for an append operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, giving a baseline of 3. The description adds meaningful context for targetFile (must exist) and clarifies pageObjectMode values like 'generate-integrated' and 'use-existing', going beyond the schema's simple descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool appends scenario code to an existing file, using a specific verb and resource. It also distinguishes from the sibling tool by explicitly directing users to exportScenarioAsCode for new files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit alternative guidance: 'Use exportScenarioAsCode for new files' and implies this tool is for existing files. Also explains Page Object integration modes, giving clear context for when to use different configurations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/docentovich/chrometools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server