Skip to content

Common Scenarios

Common scenarios are reusable scenario templates that exist at the project level. They allow you to define frequently used test flows once and include them in any QA plan.

Common scenarios are useful for test flows that appear in many plans:

  • Login flows — Authenticate a user before running feature tests.
  • Test data setup — Create prerequisite data (users, resources, configurations).
  • Cleanup routines — Remove test data after execution.

Tell the AI agent what reusable flow you need. The agent will create a common scenario using the appropriate MCP tool.

Example prompt:

“Create a common scenario for logging into the app. It should navigate to the login page, enter email and password, and wait for the dashboard. Use variables for the credentials.”

The agent will create a scenario like this:

{
"name": "Standard Login",
"description": "Logs in with test_email and test_password variables.",
"requires": ["test_email", "test_password", "web_base_url"],
"steps": [
{
"step_key": "login_navigate",
"action": "browser",
"config": {
"steps": [
{ "action": "goto", "url": "{{web_base_url}}/login" },
{ "action": "type", "selector": "#email", "text": "{{test_email}}" },
{ "action": "type", "selector": "#password", "text": "{{test_password}}" },
{ "action": "click", "selector": "button[type='submit']" },
{ "action": "wait_for_url", "url": "/dashboard" }
]
}
}
]
}
ParameterDescription
nameA descriptive name for the scenario.
descriptionExplanation of what the scenario does and when to use it.
requires(optional) List of variable names that must be present for the scenario to run.
stepsThe ordered list of steps that make up the scenario.

When the AI agent creates a QA plan, it can reference existing common scenarios by their ID. You can also ask the agent to include them:

“Create a QA plan for the user profile page. Use the Standard Login scenario for authentication.”

The steps from the common scenario are snapshot-copied into the plan version at that point in time. This means:

  • The plan version gets its own independent copy of the steps.
  • Future changes to the common scenario do not affect existing plan versions.
  • The plan version is self-contained and reproducible.

You can ask the AI agent to list, update, or delete common scenarios:

  • List — “What common scenarios do we have?” — The agent retrieves all common scenarios in the project.
  • Update — “Update the login scenario to use a CSS class selector instead of an ID.” — The agent modifies the scenario’s steps.
  • Delete — “Delete the old cleanup scenario.” — The agent removes it from the project.

Deleting a common scenario does not affect QA plans that have already copied its steps. Since steps are snapshot-copied at the time the plan version is created, the plan versions remain complete and executable even after the source common scenario is removed.