InsightWorker Logo

BugHunter Pro: QA automation that writes, runs, and fixes tests

← All posts
QA Automation May 26, 2026 by Hitesh Talesra 9 min read

The hardest part of regression testing is not clicking through the app. It is keeping the test suite honest after the product changes. A checkout flow gets a new validation rule, the backend returns a slightly different status code, a route moves, and suddenly the tests either miss the bug or fail in a way nobody has time to investigate.

BugHunter Pro is our answer to that loop. It acts like an automated QA engineer inside InsightWorker: it reads the frontend and backend repositories, generates Playwright tests from the actual application structure, runs those tests in Chromium against the live app, traces failures back to source code, applies targeted application fixes, and re-runs the suite until the app is clean or the fix-iteration limit is reached.

The QA loop we wanted to remove

Most teams know they need stronger coverage, but the work lands in awkward gaps between developers, QA, and release managers:

  • Exploration is manual. Someone has to crawl the app, understand routes, inspect forms, and remember which backend endpoints each page calls.
  • Tests fall behind. Playwright specs are useful, but writing and maintaining them competes with feature work.
  • Failures are expensive. A failed browser test is only the start. The team still has to decide whether the bug is frontend state, backend validation, bad test data, or an outdated assertion.
  • Fixes are reactive. Bugs get found in staging or production, where context switching is highest and confidence is lowest.

BugHunter Pro turns that into a single workflow with evidence at every step.

What the workflow needs

The workflow starts with the same context a QA engineer would ask for: the running frontend URL, the running backend URL, and local paths to the frontend and backend source code. If the app needs authentication, the user can provide a login URL and test credentials. If they only care about one area, they can provide a target route such as /dashboard; otherwise BugHunter crawls the app up to the configured page limit.

frontend_url: http://localhost:5173 backend_url: http://localhost:9000 frontend_path: ./frontend backend_path: ./backend target_page: /dashboard max_pages: 30

That input shape matters. BugHunter does not guess from screenshots alone. It correlates the live app with the source code that produced it.

Step 1 — Explore the repositories

BugHunter first reads the frontend and backend project structure. It looks for entry points, routes, page components, API handlers, models, validation logic, and shared utilities. The output is a structured repository analysis: tech stack, routes, components, endpoints, and the likely user flows worth testing.

When a target page is supplied, exploration narrows to that page and its related backend calls. That keeps the run focused for teams trying to harden a specific release path instead of testing the entire product every time.

Step 2 — Generate Playwright tests

Once the app shape is known, BugHunter creates a real tests/ directory with package.json, playwright.config.ts, and generated .spec.ts files. For a full-app run, it covers route loading, API responses, UI interactions, form validation, error states, and end-to-end happy paths.

The important constraint is that the tests reflect the app, not a generic checklist. A settings page with toggles gets interaction tests. A create-user form gets validation and submission paths. A dashboard with network calls gets API intercept checks. The generated suite is meant to be reviewed and kept, not thrown away after the demo.

Step 3 — Execute in a real browser

BugHunter runs the generated suite with Playwright in Chromium against the live frontend and backend. It captures pass/fail counts, skipped tests, failure details, screenshots, and the raw JSON reporter output. It also produces an Excel report so product and QA stakeholders can review the run without reading terminal logs.

npx playwright test --reporter=json

This is where the workflow becomes more than test generation. The browser either confirms the app behavior or produces concrete failure evidence.

Step 4 — Trace failures back to source code

For each failing test, BugHunter reads the assertion, the browser error, the network response if relevant, and the source files that own the route or endpoint. Then it decides whether the issue is in application code. Common fixes include adding missing validation, correcting conditional logic, normalizing error handling, returning the right HTTP status, or making the UI handle an empty/error state gracefully.

The workflow intentionally fixes the application, not the generated tests. That is the safety line that keeps it from hiding real bugs by weakening assertions.

Step 5 — Re-test until the result improves

After fixes are applied, BugHunter re-runs the suite. If tests still fail, it can repeat the fix-and-test loop up to three iterations. The final report shows the initial pass rate, the final pass rate, what changed, which tests remain failing if any, and what needs human attention.

The ideal run ends at 100% pass rate. A still-failing run is not a failure of the workflow if it hands the team a narrowed, reproducible issue with source-code context and a clear escalation note.

What gets delivered

A BugHunter run produces artifacts QA and engineering teams can keep:

  • Repository analysis JSON with architecture, routes, endpoints, and components.
  • Playwright test files written to disk, plus a markdown summary of what was generated.
  • Execution results JSON with pass/fail counts and failure details.
  • Excel report for reviewing test results, screenshots, and fix outcomes.
  • Fix changelog documenting every application code change with before/after context.
  • Final re-test report with iteration count, final pass rate, remaining risks, and recommendations.

Where the boundaries are

BugHunter is for functional web application bugs. It does not perform load testing, penetration testing, mobile-native testing, database migrations, deployment changes, or third-party integration work that requires unavailable credentials. It also escalates when the running app and local source paths do not appear to match, because fixing the wrong checkout is worse than not fixing anything.

Those boundaries make the workflow useful in day-to-day release testing: it has enough authority to write tests and fix source code, but not enough authority to reshape infrastructure or mask production risks.

Where it fits

The first place to use BugHunter is the boring one: before a deployment. Point it at the release candidate, let it crawl the high-value paths, and review the generated suite and changelog. It also fits legacy refactors, MVP launch checks, CI/CD regression gates, and teams that want Playwright coverage but do not have enough QA engineering time to build the first suite by hand.

That is the shift we care about. QA moves from "who has time to write tests?" to "what did the browser prove, what did the agent fix, and what still needs a human call?"

Starting prompt

Please test my web app with BugHunter Pro. The frontend is running at http://localhost:5173 and the backend API is at http://localhost:9000. The frontend code is in ./frontend and the backend code is in ./backend. Start with the /dashboard page, crawl up to 30 pages, generate Playwright tests, run them in Chromium, fix any application bugs you find, and re-test until the suite passes or you hit the fix-iteration limit.

The full use-case page includes the step-by-step workflow and screenshots of repository exploration, test generation, browser execution, failure reporting, automatic fixes, and the final Excel report.