Skip to main content
All insights

A passing test that proves nothing

testingagents

76 of the tests in one of my suites could report a pass without proving anything.

That came out of an audit of my own work, not somebody else's. 30 were scaffolds where the body was a list of comments. 34 ran and asserted nothing. 12 had every assertion inside an if, so a false condition passed the test by skipping it. That was out of 196 test declarations in the source.

A green run told me the suite was healthy. It was telling me the suite had finished.

What the hub is

The E2E Test Hub is one Playwright project that holds the tests for every application I maintain. It has 12 project folders and 114 spec files today. Sign-in is shared, so a forms login and a SAML login are each written once and every project configures them instead of rewriting them.

Two tools sit beside the tests. A scanner crawls an application and maps its pages before anyone writes a test, 100 pages and 5 levels deep by default. A recorder wraps Playwright's own codegen and turns a click-through into a script that uses the page objects already in the project.

The test has to know where it is pointed

The failure that cost me the most time was a saved login. I authenticated against staging while every URL in my head said localhost and the saved session file looked healthy because it had the right cookies with the right names and they were scoped to the wrong host. Nothing in the toolchain said so. It took 4 interactive logins to see it.

So there is a preflight now. It checks that the apps are up, which environment the run resolves to, and whether the saved sessions match the host being tested.

Tests that change data go further. A guard proves the target 3 ways before anything is touched, prints what it found so the run log carries the evidence, and stops the run if any of them disagree. Every settings change made against an environment that is not local is written to a ledger the moment it is made, so there is a list to put back afterward.

What I would ask

An agent can write tests faster than anyone reads them, and every one of them goes green. That makes the two questions matter more.

If somebody shows you a green run, ask what the tests assert. Then ask what stops one from running against production.

Have a Project in Mind?

Every project starts with understanding the problem. Tell us yours.