Skip to content

Using Scenarios

Two concepts keep your agent focused: scenarios and profiles.

Scenarios describe what to test. Profiles describe where to test and how to access it.

Unlike profiles, scenarios are generally written by the coding agent. If you enable Ranger while in Plan Mode, the coding agent should include the scenarios it believes are necessary in the plan for implementation. These can be iterated on until you think they capture the flows correctly. The scenarios are also visible and editable on the Feature Review dashboard.

A scenario is a short, concrete user flow with an expected result. Ranger’s browser agent treats it both as a path to follow and a success condition to verify against.

Scenarios are not entirely deterministic and are guidance more than a script. Like people visiting a site, each agent may take a slightly different path to accomplish the goal it’s given and the amount of variance depends on the specificity of the task.

For instance, “Mark a checklist item as completed. Verify that the text is crossed out and the box is checked.” leaves agents room to choose any non-completed checklist item. They would also successfully toggle a “non-completed only” filter if they had to in order to find an appropriate example.

Each scenario is verified on its own. They are not done in the same browser session (so frontend state does not carry over) or necessarily in the same order. Running a scenario can be backgrounded by the agent, so multiple may be run at once. If they are likely to interfere with each other’s background data, prompt the coding agent to run them serially.

A good scenario names the starting point, the action, and the expected result. Scenarios can contain complex paths through the app, but are generally easiest to verify and understand if they don’t contain multiple conditions.

Clear: “User opens settings, toggles dark mode, page switches to dark theme.”

Vague: “Add dark mode toggle.”

Too many conditions: “A user should see the toggle on the top of the page if they’re logged in and at the bottom otherwise.”

Most feature reviews need only a few scenarios. The scenarios should focus on frontend behaviors and observable UI. A long checklist might be indicative of too many implementation details. The most effective scenarios are focused on what a person would do and see.