Workflows
This page describes the patterns that work well when collaborating with a coding agent on Cycle tests. Each workflow is described as a conversation: what you say, and what the agent does on your behalf via the Cycle MCP server.
These flows assume you have already followed the Setup instructions and your agent is connected to the Cycle MCP server.
Drafting a New Web Test from a Description
This is the most common workflow. You describe the desired test in plain language and let the agent author a .feature file by exploring the live application.
You say:
Create a new Cycle project at
C:\Users\me\Documents\CycleProjectscalledCatalogSmokeTestand write a test that searches our staging storefront athttps://staging.example.comfor "wireless headphones", opens the top result, adds it to the cart, and verifies the cart count goes from 0 to 1.
The agent does:
- Calls
create_projectto scaffoldCatalogSmokeTest.cycprojand the standard project tree. - Calls
cycle://authoring-guideto refresh on syntax conventions. - Calls
run_stepto launch Chrome and navigate tohttps://staging.example.com. - Calls
run_stepwithstep_id: "WebDriver.snapshotPage"to read the live accessibility tree and finds:- The search field at
id:search-input - The submit button at
id:search-submit
- The search field at
- Drives the page interactively (further
run_stepcalls for type, click, navigate) to verify the locators work. - Lands on the product page, snapshots again via
WebDriver.snapshotPage, findsid:add-to-cart. - Writes the
.featurefile under the project'sTest Cases/directory. - Calls
validate_featureto confirm the syntax is clean. - Optionally calls
run_testfor an end-to-end execution and reports the result.
You review the resulting .feature file in your editor and iterate.
This works because the agent never guesses at locators. It inspects the live page via run_step with WebDriver.snapshotPage before writing each one. This catches issues that pure-text-prompt-based authoring misses: dynamic IDs, accessibility-name mismatches, elements hidden behind iframes, etc.
This step-by-step inspection currently only applies to web testing because it uses the WebDriver plugin (due to requiring steps using the plugin architecture).
Debugging a Failing Test
When a test fails, the agent has the structured-error tooling to give you a focused fix instead of generic advice.
You say:
My
LoginAndPlaceOrder.featureis failing on the third step. Run it, find out why, and propose a fix.
The agent does:
- Calls
run_testwith the feature path. The tool returns the exit code, truncated console output, and the directory containing the results.dbfile. - Calls
get_run_errorswith that directory. This returns:- The failing step text and step ID
- The exception class and message
- The stack trace
- A list of artifacts (screenshots, logs) saved during the run
- If the failure is "element not found," the agent re-launches the browser via
run_step, navigates to the same screen, and snapshots it viaWebDriver.snapshotPageto compare what the test expected with what's actually rendered. - If the failure is "UnknownStep," the agent calls
search_stepsandget_stepto find the correct step ID and parameter shape. - Proposes a specific edit to the
.featurefile and waits for your approval before applying it.
Directly asking the agent for artifacts can assist with debugging. Cycle saves a screenshot at the moment of failure. If your agent supports image inputs (Claude, Copilot in VS Code, Cursor), say "show me the failure screenshot" and the agent can read the PNG path from get_run_errors, open it, and reason about what went wrong visually.
Exploring an Unfamiliar Application
When you're testing an application you don't know well, the agent can explore it with you.
You say:
Open the order management screen at
https://staging.example.com/orders, walk through the filters at the top, and tell me what controls are there and how I'd set the date range.
The agent does:
- Calls
run_stepto start a browser and navigate to the URL. - Calls
run_stepwithWebDriver.snapshotPageto read the page's accessibility tree. - Reports what it sees in plain language: the filter combobox names, what options each one accepts, where the date pickers are.
- Optionally calls
browser_screenshotto send you the rendered view. - Suggests a
.featurefile structure that mirrors what it found.
This is faster and more accurate than the agent describing the page from screenshots alone, because the accessibility tree contains element roles and accessible names that screenshots don't.
Bulk-Updating an Existing Test Suite
When a UI change breaks dozens of feature files, the agent can scan the failures and apply consistent fixes.
You say:
The
Sign Inbutton on the login page is now labeledLog In. Run all features underTest Cases/Login/, find the ones that fail because of this, and update them.
The agent does:
- Reads the directory listing.
- For each
.featurefile, callsrun_testand checks the result. - For files that fail with the expected mismatch, edits the file (using the agent's normal file-edit tools) to replace
Sign InwithLog In. - Calls
validate_featureafter each edit. - Re-runs the full set to confirm the fix.
- Reports a summary: which files were edited, which still fail (and why).
You approve or revise the changes file-by-file as the agent works through them.
Authoring a Step Plugin (Advanced)
If you write your own step plugins (see Creating New Steps), the agent can help you author tests that use those steps once the plugin is installed in cycle-cli's plugins/ directory.
You say:
I just installed the
magic-powers-plugin. Show me what new steps it added and write a smoke test that uses each one.
The agent does:
- Calls
cycle://categoriesto see the new plugin's category. - Calls
list_stepsfor that category to enumerate the new steps. - Calls
get_stepfor each one to learn the parameter shape. - Writes a
.featurefile that exercises each step in sequence. - Validates and runs the feature.
The Cycle MCP server picks up plugins from the standard plugins/ directory next to cycle-cli.exe, so newly-installed plugins become available to the agent automatically without any config change. Restart the agent after installing a plugin so the server reloads.
Tips for Working with the Agent Effectively
- Be specific about state. "Add an item to my cart" vs. "Add the top search result for 'wireless headphones' to the cart and verify the cart count goes from 0 to 1." The second is testable; the first is wishy-washy and the agent will pick something arbitrary.
- Always ask for validation before execution. A
validate_featureround trip is cheap; arun_testround trip can take minutes if the test does anything substantial. - Use the live browser for any non-trivial UI. If the agent skips the page snapshot (
WebDriver.snapshotPageviarun_step) and writes locators from imagination, push back and tell it to inspect the page first. The setup-recommended rules file (Setup) prevents this, but rules drift — confirm the agent is using the live tooling. - Treat the agent's
.featurefiles as a starting point. Read them. The agent is good at structure but may pick less-readable variable names or include redundant assertions. The CycleScript authoring guide is the source of truth for style. - Commit early, commit often. When the agent makes a change you like, save it to source control immediately. If the next iteration goes wrong, you can roll back without losing progress.