# Test automation maintenance: broken and flaky tests fixed, every repair reviewed

> Test Automation Maintenance Services | Zapple.Tech. Canonical page: <https://zapple.tech/services/automated-testing-maintenance/>

Your automated tests break with every release or fail at random, and nobody trusts the red build. With test automation maintenance, we take over their upkeep. Each red run is sorted into a real defect, a test fault or an environment fault. Broken tests are repaired, flaky ones are tracked until they are fixed or removed, and self-healing tools are used where your framework supports them. Every repair is opened as a pull request with the reason and reviewed by an engineer before it is merged. It starts with a one-week audit of the suite.

## What you can order

- **Repair of broken and flaky tests**: Tests that fail after a product change are repaired, and tests that fail at random are traced to a cause.
- **[Self-healing set-up with review](https://zapple.tech/services/agentic-e2e-testing/)**: The Playwright healer agent or the CodeceptJS heal plugin, where your framework supports it. Every repair is reviewed.
- **Taking over a suite another team wrote**: A suite nobody on your team understands any more is read, run and sorted before anything is changed.

## Why automated tests break

Most test failures have one of a few causes:

- **The product changed.** A button moved, a field was renamed, a step was added to a flow. Working tests begin to
  fail.
- **A locator no longer matches.** The test looks for an element by an identifier that changed.
- **Timing and waits.** The test checks before the page is ready, and passes on some runs only.
- **Test data.** The data the test expects is gone, changed or shared with another test.
- **The environment.** A service is down, a version differs, or several teams use the same data.

There are two kinds of maintenance. One is repairing working tests that begin to fail. The other is adjusting the
tooling around them as the product and its dependencies move on. Before either, one question decides the work: is
this failure a change in behaviour, a side effect, or a real defect?

## Every red run sorted: defect, test fault or environment fault

Each failed CI run is sorted into one of three.

- **A defect.** The product is wrong. It goes to your tracker.
- **A test fault.** The test is wrong or outdated. It is repaired.
- **An environment fault.** The test and the product are right but the environment is not. It goes to whoever owns
  the environment.

CodeceptJS has an analyze plugin that groups failures with similar error patterns, which helps when one change
turns many tests red at once. For wiring the suite into your pipeline in the first place, see
[CI/CD test automation](/services/tools-integration/).

## Flaky tests: tracked until they are fixed or removed

A flaky test passes and fails on the same code. People re-run it, then ignore it, and then they ignore the red build.
For each flaky test we look for the cause: data, timing, the environment or the way the test is written. The test is
then fixed. A test that is not worth fixing is removed. Until then it is tracked, so it is not a silent problem. We do
not promise that a suite will have no flaky tests, because the environment can cause them from outside the test
code.

## Self-healing tests: what they repair and what an engineer still checks

Self-healing test automation is a technique, not an outcome. Several tools offer it. Two test frameworks ship it as
a feature, and their own documentation says what it does:

- **Playwright's healer agent** replays a failing test and patches it, or marks it skipped if it believes the
  feature is broken.
- **The CodeceptJS heal plugin** heals failing steps on CI and prints a suggested change at the end of execution.
  AI healing needs an AI provider in the configuration, heal recipes and the `--ai` flag. The documentation is plain
  about its reach: it solves one problem, a locator that changed so an action such as a click cannot be performed.
  It works on actions, not on assertions, waits or values the test reads.

If your Playwright suite is not stable yet, [taking over a Playwright suite](/services/playwright-testing/) comes
first; upkeep starts after that.

Zapple.Tech was founded by the founders of CodeceptJS and Codeception, open-source testing frameworks, and of
Testomat.io and Testomat.ai. CodeceptJS ships its own healing; the plugin is part of that framework, not our
product.

We use these tools where your framework supports them. A healed step is a suggestion. It is opened as a pull
request with the reason, and an engineer approves or rejects it before it is merged. That matters because a heal can
pass for the wrong reason: the element that changed may be the bug. The longer description of the agent-driven way
of working is under [end-to-end testing with AI agents](/services/agentic-e2e-testing/).

## Keeping test automation maintenance cheap

Most of the cost of automated test maintenance is decided when a test is written. Tests that are cheap to keep follow a few rules:

- **One behaviour per test,** and small tests, so a failure points at one cause.
- **Decide what to test before how.** A test with no clear purpose is the first to be deleted.
- **Documented test cases,** so a repair can be checked against what the test was meant to do.
- **Naming standards,** so a failed test name says what failed.
- **Stable IDs and page objects,** so a change in the interface is fixed in one place.
- **Work with the developers who change the interface.** A fix made together with the change shortens the feedback
  loop.

New tests written under these rules are covered on the
[automated test script development](/services/automated-scripts-development/) page.

## Taking over a suite someone else wrote

If the person who wrote the suite has left, or a framework nobody on your team understands any more has become the
problem, the audit marks every test keep, rewrite or delete. That gives you a list before anything is changed. When
the cost comes from the structure of the framework, the next step is
[framework rework](/services/custom-framework-development/), scoped separately.

The suite stays your code, in your repository, whichever of us maintains it.

## When test maintenance is the wrong choice

- **You need new tests, not repairs.** See [automated test script development](/services/automated-scripts-development/).
- **You want the whole automation project handed over.** See [test automation outsourcing](/services/automated-qa-outsourcing/).
- **You want to build or extend regression coverage.** See [regression testing](/services/regression-automation-testing/).
- **You want engineers inside your team** to look after the suite. See
  [hire test automation engineers](/services/hire-test-automation-engineers/).
- **You are still comparing kinds of automation work.** The [test automation services](/services/) page lists them.
- **You are not sure what is wrong with the suite.** The one-week [automation audit](/services/audit-and-assessment/)
  comes first.

What we maintain: [web application testing](/services/web-test-automation/) and
[mobile test automation](/services/mobile-test-automation/) suites, and [CodeceptJS support](/codeceptjs/) for teams
on that framework.

## What test maintenance and self-healing do not solve

Maintenance keeps tests correct. It does not decide what is worth testing.

- A healed test can hide a real defect, because the element that changed may be the bug. When Playwright's healer skips a test because it believes the feature is broken, that is a call an engineer confirms, not a repair.
- AI healing in CodeceptJS fixes one kind of failure, a changed locator on an action such as a click. It does not touch assertions, waits or values a test reads, so every other failure still needs a person.
- Unstable test data and shared environments cause flaky tests that no repair on the test side can fix.
- A test that checks the wrong thing passes after every repair. It has to be rewritten, not maintained.
- When the interface changes every day, maintenance only works if your developers keep the test IDs stable or agree changes with us.
- AI healing needs an AI provider your rules allow. If none is allowed, AI healing is not used and repairs are made by hand.

## How each failed CI run is sorted, and where it goes next.

| A red run is | What it means | Where it goes |
| --- | --- | --- |
| A defect | The product is wrong | Your tracker |
| A test fault | The test is wrong or outdated | It is repaired |
| An environment fault | The test and the product are right but the environment is not | Whoever owns the environment |

## How the work runs

1. **Suite audit** (About one week): We run the suite and read the recent CI results. We find out why tests fail and decide with you what to repair first.
2. **Stabilisation pilot** (Two to six weeks): The failing and flaky tests in one product area are repaired, and healing is set up where it fits. You see real pull requests before the work grows.
3. **Ongoing** (Monthly): Every red run is sorted and repairs are reviewed before they are merged. Flaky tests are tracked until they are fixed or removed. You decide after each step whether to continue.

## FAQ

### What is test automation maintenance?

It is the work of keeping automated tests correct and running as the product changes. The classic case is a button that moves after a UI change, so a test that used to pass can no longer find it. It also covers tests that fail at random, and keeping the test tooling working as the product moves on. Automated test maintenance is the same work under another name.

### Why do our automated tests keep breaking?

Usually for one of five reasons. The product changed, a locator no longer matches, a wait is too short, the test data is not what the test expects, or the environment behaves differently. Each red run is sorted into a defect, a test fault or an environment fault, so the cause is known before anything is changed.

### What are self-healing tests, and can we trust them?

Self-healing means a tool repairs a failing test step on its own. Playwright's healer agent replays a failing test and patches it, or marks it skipped if it believes the feature is broken. CodeceptJS has a heal plugin that heals failing steps on CI and prints a suggested change at the end of the run; its AI healing covers a changed locator on an action, not assertions. Treat a healed step as a suggestion. We open it as a pull request with the reason, and an engineer checks that the test still tests what it did before. A heal can hide a defect.

### How do you deal with flaky tests?

We look for the cause first. It is usually test data, timing, the environment or the design of the test. The test is then fixed, or removed if it is not worth keeping. Until then it is tracked, so it does not stay a silent problem. We do not promise zero flakiness, because an unstable environment can cause it from outside the tests.

### Can you take over a suite another team or vendor wrote?

Yes, after the audit. It marks each test keep, rewrite or delete, so you see what is worth keeping before anything is changed.

### Which frameworks can you maintain?

The audit starts from the framework your suite is written in. It reads the suite as it is and says in writing whether repairs are enough, whether the framework itself needs rework, and whether we are the right team for it. That is more useful than a list of tool names.

### Does self-healing send our code or data to an AI service?

Only to a provider you approve, and nothing leaves your environment if your rules say so. CodeceptJS AI healing needs an AI provider in the configuration; its documentation also describes heal recipes that do not use AI. If your rules allow no provider, AI healing is not used and repairs are made by hand.

### How much does test maintenance cost?

Prices are not published. The quote depends on the size of the suite, how often it fails, how often you release and how many frameworks are involved. Describe the suite and you get a scoped quote within one business day.

[Request an audit quote](https://zapple.tech/services/automated-testing-maintenance/#start)
