lecture 13 of 200 completed

Checking what must not change

An action can do more than it should. Check what must stay the same, and test the No as well as the Yes.

What you'll learn

  • Why checking only the new value misses an edit that erases another field
  • How to read the values that must not change before the action, and check them after
  • How to test a step that asks first: the question, the Cancel path, and the result

Orchard Vet keeps a record for every pet. A nurse opens Biscuit's record, changes the owner's phone number and saves. Your test checks that the list shows the new phone. It passes.

It also passes when the save wipes the owner's email. The developer saved the phone and sent an empty email with it. The list does not show emails, so nothing on screen looks wrong. Next week the clinic tries to email Biscuit's vaccination reminder, and it goes nowhere.

Your test checked what should change. It never checked what must not.

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →