Amikoo Blog

False Green Tests in Playwright: How to Catch Real Defects

Written by The Amikoo Team | Nov 12, 2026, 6:22:17 PM

A passing test is a false green when it checks what the app says instead of what the app does. To catch one, assert the real outcome where it is stored (database, API or downstream system), break the app on purpose to confirm the test fails, and review every repair so it keeps the original assertions.

Key takeaways

  • A passing test only proves what it checks.
  • Checking a confirmation message is not the same as checking a saved order.
  • Planting a bug on purpose is the fastest way to see if a test protects you.
  • Every test repair should keep the original assertion.

     

What is a false green test?

A false green is a test that passes while the product is broken. It usually happens when a test checks a signal on screen, like a confirmation message or a redirect, instead of the result the business depends on. The suite stays green, and customers find the bug first.

As AI coding agents write more tests in seconds, this gets easier to miss. A test can look complete, run cleanly and still ask the wrong question.

What happened when we planted a bug in a checkout? 

We built a small coffee store app and planted one bug: payment goes through, but the order is never saved. Then we ran two Playwright tests against the same checkout.

Weak test

Strong test

Checked that the "Order confirmed" message appeared

Checked that exactly one order was saved

Passed

Failed

The customer was charged and no order existed

Caught the real defect before a customer did

Same flow. Same bug. Different question.

// Weak: checks what the app says
await expect(page.getByText('Order confirmed')).toBeVisible();

// Strong: checks what the app did
expect(orders, 'there must be exactly 1 saved order').toHaveLength(1);

How do you catch a false green fast?

Three habits make the biggest difference:

  1. Define a trusted oracle. Check the outcome where it is stored, not the message on screen.
  2. Test known-bad behavior. Break the app on purpose (seed a bug or disable a backend call) and confirm the test fails.
  3. Inspect repair diffs. A fix may change how a test reaches the page, never what it checks.

By making triage an agent's job instead of a person's.

What else makes a test trustworthy?

The checklist adds three more checks that separate a green test from a trustworthy one, plus a quick score to see where your suite stands.

 

See it on your own app

Amikoo is an AI QA agent that writes Playwright tests in your repo for your team to review. When a test fails, it tells you whether it's the product, the test or the environment, and proposes repairs your team reviews before merge.

 

FAQ

What is a false green test? 

A false green is a test that passes while the product is broken. It usually happens when the test checks a message on screen, like "Order confirmed", instead of the real result, like a saved order.

How do you test known-bad behavior in Playwright?

Break the app on purpose (seed a bug, disable a backend call or return a wrong value) and run the test. If it still passes, the test is not protecting that flow.

Why should you review test repairs? 

An automatic fix can make a failing test pass by loosening or removing the assertion that caught the bug. Reviewing the diff makes sure the fix changes how the test reaches the page, not what it checks.

How does Amikoo handle test repairs?

Amikoo proposes repairs as changes your team reviews before merge. It also classifies each failure as a product defect, a test problem or an environment issue, so real defects are not hidden by a retry or a fix.