TLDR
- A dark factory ships code that no person writes or reviews, so a test suite that needs someone every time a button moves becomes the bottleneck.
- Lights-out QA is a loop of five steps: write, run, heal, debug, fix. The first three need nobody.
- Self-healing finds an element again and updates its locator. It never changes what the test checks, so a real bug still fails the run.
- Every heal shows the element's path before and after, so a person reviews a short list of healed steps, not a red suite.
- When a failure is real, the run explains itself and the test gets fixed in place, without starting over.
A dark factory runs with the lights off because nobody works the floor. In software, the term describes a pipeline where agents write, test and ship code, and no person writes or reviews it. Dan Shapiro made it level 5 of his AI coding ladder, and StrongDM has described building one.
A pipeline like that needs self-healing end-to-end tests, because agents change the UI many times a day. Each change can turn a classic suite red for no reason at all: a renamed button, a new wrapper div, a field that slid below the fold.
In a normal team, someone fixes the selector over coffee. In a dark factory, there is no someone. A suite that needs a person every time a button moves becomes the bottleneck.
Healing on its own won't cut it, though. The suite has to write itself, run on every change, adapt when the app moves, explain itself when it breaks, and get fixed fast when the break is real.
What are self-healing end-to-end tests?
Self-healing end-to-end tests find an element again when the UI changes, then update their own locator. They never change what the test checks. A renamed button heals. A wrong total fails.
That second half is the hard part, and most of this article is about it.
The loop, in five steps
Lights-out QA works as a loop:
- Write the test from intent.
- Run it on every change.
- Heal it when the app moved but nothing broke.
- Debug it when something did break.
- Fix it, then run again.
Steps 1 to 3 need nobody. Steps 4 and 5 are where a real failure gets handled, by an engineer or a coding agent, with half the work already done.
Self-healing test automation usually means step 3 alone. Autonomous testing takes all five. A heal is no use if the test was never written, or if the real failure sits unread until morning.
Want the coding agent to handle steps 4 and 5 itself? Connect it to thunders.ai over MCP. It can create tests, trigger runs, pull the failed runs and read their evidence.
1. Write: start from intent, not selectors
A test that starts life as a pile of XPaths is already fragile. It encodes how the page was built last Tuesday, not what the user is trying to do.
In thunders.ai, a test starts from intent. Describe the flow in plain English ("log in as an admin, create an invoice, check the total includes VAT"), or click through it once in the live browser and every action becomes a step. Each step keeps the sentence that says what it means.
That sentence is what makes the rest of the loop possible. When the page changes, the runner still knows what the step was for. A raw selector can't tell you that.
In a dark factory, the author is often the coding agent that built the feature. It can create the test over MCP, from the same requirement it built from.
2. Run: on every change, in a real browser or on a real device
A dark factory ships far more often than a human team, so the suite has to run on every change, not every night. Tests run in real browsers and on real mobile devices, from CI/CD or straight from a coding agent. That second route is agentic testing in the plain sense: the agent that changed the app runs the tests itself.
Speed comes from caching. The first time a step passes, thunders.ai stores the exact actions and selectors it used. The next run replays them deterministically. No model call, no guessing. AI only comes back in when the cached path no longer fits the page.
That's the right default. A test that asks an LLM to find the login button on every run is slow, costly and, worse, a little different every time.
3. Heal: adapt when the app moved, and say so
Every cached step carries a fingerprint of its element: its attributes and its place in the page, or the native element tree on mobile. Before replaying a step, the runner checks that fingerprint against the live page.
If it still matches, the step replays as cached. If it doesn't, the runner re-resolves the element from the step's intent, starting with fast deterministic matching and escalating to a model or to vision only when it has to. If the action then passes, the new selector replaces the old one in the cache. The next run is deterministic again.
Say the checkout button ships as #submit-order on Monday and as button[data-testid="place-order"] on Tuesday. The step still says "click Place order". The runner finds the button from that sentence, clicks it, and caches the new selector.
That's self-healing. The button got renamed, the test found it anyway, nobody got paged.
And it never happens silently. A healed step carries a Self-healed marker. Click it and you see the path to the element in the recorded run and in this run, with the part that changed marked, and a screenshot of the element in each. The run summary shows how many steps self-healed. A step that only passed because the page was slow gets marked Waited longer instead, so a slow network never passes for a broken selector.
A heal also never changes the verdict. It can find the element an action targets again. It can't turn a failed check into a pass, and nobody has to approve it for the run to continue.
4. Debug: the failure explains itself
Some failures are real. The total is wrong, the checkout throws, the modal never opens. Self-healing must not touch these, and it won't: there's nothing to heal. The app is broken.
What the dark factory needs here is speed to diagnosis. In thunders.ai, a failed step has a "Why did this step fail?" button. The AI reads the run's own evidence (steps, expected and actual results, screenshots, environment, persona) and explains what went wrong at that step. You can ask follow-ups: "summarize this run", "why did step 4 fail?".
A coding agent doesn't need the button. Over MCP, it reads the same run evidence, step screenshots included, and works out the cause itself.
If it's a real bug, it goes straight to your tracker with the context attached: test case, run, failed step, expected result, actual result. Whoever picks it up, engineer or coding agent, starts from the evidence, not from "it's red, can you check?"
5. Fix: in place, without starting over
Sometimes the test is what's wrong. The flow changed on purpose, and the test should follow. The slowest part of fixing a test used to be the restart: change one step, rerun the whole case, wait to get back to step 12.
That restart is gone.
- If a click failed, the browser stays open on the failure. Click the right element yourself and each interaction becomes a step in place of the failed one. Finish the correction and the run picks up from the next step, same browser.
- If a check failed, turn on Pause on failure. The run stops at the first failed assertion with the browser still open. Edit the check, hit Resume, and only that step onward runs again.
- On mobile, a failed step no longer releases the device. It stays live, so you can take control and fix the step there, and nothing gets reinstalled or reprovisioned.
A coding agent has its own route: over MCP, it updates the failed step and continues the same run from there, on Chrome or Chromium, while the browser session is still open.
Then the loop closes: the fixed step passes, its new selectors get cached, and the next run is back to step 2.
When should a test heal, and when should it fail?
A self-healing tool that heals too eagerly is worse than one that doesn't heal at all. If it can quietly adapt its way past a real bug, a green run means nothing. And in a dark factory, nobody reviews the code. The test result is the review.
The useful question is where healing stops. thunders.ai draws the line in three places.
- Only the locator heals, never the expectation. Healing finds an element again. It never rewrites what the step checks, so an AI check like "verify the total includes VAT" has nothing to heal from. If it fails, the run fails.
- Noise isn't a heal. If the page shifted but the cached selector still points at the same element, nothing gets marked.
- Every heal can be reviewed. A heal can land on the wrong element and still pass, and no tool can rule that out (anyone claiming otherwise is selling something). So each heal shows the before and the after, and the run tells you which steps adapted. After a big redesign you check the three healed steps, not all forty.
That short list is the one job lights-out QA leaves for a person. It's three steps with the evidence attached, not a red suite to dig through.
We'd take a suite that occasionally asks for a look over one that is always green and sometimes lying.
Lights-out doesn't mean nobody looks
It means nobody babysits. The suite stays quiet until something is truly broken. When it does speak up, it brings the evidence and lets you fix the test in place.
That's the QA layer a dark factory can run on. The agents can ship as fast as they like. The tests will keep up.





