How to use AI with BugBug?
BugBug can be used with AI in two ways:
Built-in BugBug AI improves recording and test execution inside BugBug. It helps with selectors, waiting, scrolling, and clicking. Read more: How BugBug AI works.
AI agents can work with your BugBug project through BugBug Plugin, BugBug MCP, and BugBug Skills. This helps you plan tests, create tests, debug runs, review failures, and maintain test suites from Cursor, Claude Code, VS Code, Codex, and GitHub Copilot.
This page describes common AI-assisted workflows. To connect your AI client first, start with BugBug Plugin: npx @bugbug-io/cli plugin --agent=<agent>. The selected client completes MCP OAuth after installation. You can also read more about BugBug MCP and BugBug Skills.
Plan test coverage
Use this when you want the AI agent to analyze your product, existing BugBug tests, and missing coverage before creating anything.
Suggested prompt:
For <application URL> and <project>, plan BugBug coverage for the login, checkout, and account-settings flows. This is read-only: inspect existing tests, suites, components, profiles, variables, and any available product or repository context. If the URL, environment, project, or flow details are missing, ask me before making assumptions. Return prioritized new tests, reusable components, preconditions, coverage gaps, and the evidence supporting each recommendation. Do not create or update anything.The agent should use read-only BugBug MCP tools such as test, suite, component, profile, and variable listing. If it has browser or repository access, it may also inspect the tested application. If not, provide URLs, screenshots, DOM snippets, route lists, or a product brief.
Create a test from a flow description
Use this when you already know the user flow and want the agent to create a BugBug test.
Suggested prompt:
For <project>, create a BugBug test for this following flow:
1. Open the pricing page.
2. Choose the Pro plan.
3. Fill the signup form with test data.
4. Assert that the confirmation page is displayed.
First inspect relevant existing tests, components, profiles, variables, and the target application. You are authorized to create this test and its steps, then run it once. If selectors, credentials, URLs, secret values, or expected confirmation content are missing, ask me before continuing. Return the created test name and ID, the final steps and assertions, the run result, and evidence for any failure; do not make unrelated changes.The agent should plan first, create the test only after the scope is clear, use stable selectors, add assertions, and then run the test. If the test fails, it should inspect the run evidence before changing steps.
Related docs:
Debug a failed test run
Use this when a BugBug run failed and you want an evidence-based diagnosis.
Suggested prompt:
The agent should inspect the run details and artifacts before proposing changes. It should not rewrite the test unless you explicitly ask it to apply a fix.
Related docs:
Fix a broken selector
Use this when a step fails because BugBug cannot find or interact with an element.
Suggested prompt:
If the tested application can be edited, the best fix may be adding a stable data-testid or ARIA attribute in the application code. Read more: Selectors.
Review visual regression failures
Use this when a visual regression step failed and you need to decide whether the change is a product bug or a new valid baseline.
Suggested prompt:
Related docs:
Refactor existing tests
Use this when your project has duplicate steps, unclear test names, or reusable flows that should become components.
Suggested prompt:
Good refactoring candidates include duplicated login flows, repeated checkout setup, long tests with unrelated assertions, and suites that mix smoke tests with full regression tests.
Related docs:
Create a project status report
Use this when you need a QA or PM summary of test health.
Suggested prompt:
This workflow is useful before releases, after large UI changes, or when deciding which tests need maintenance first.
Work with BugBug YAML
Use this when you export tests as YAML, review generated YAML, or import test definitions from files.
Suggested prompt:
Related docs:
FAQ
Last updated
Was this helpful?
