lecture 6 of 180 completed

Give each test its own data

An old confirmation looks right when both requests use the same destination. Give each test its own inputs.

What you'll learn

  • Choose values that distinguish an earlier request from a later one.
  • Return fresh data from a function.
  • Predict which object changes when two names refer to it.

reminderFor('Desk') appears twice in a test called “changes the reminder destination”. Both reminders go to Desk. An old confirmation can pass for a new one.

You are testing an invented reading list. It saves a shelf name with each reminder. A reader moves a reminder from Desk to Travel. The confirmation still says Desk.

Start by making the two destinations different. Keep the expected shelf in the test. If you read it from the confirmation, an old value can agree with itself.

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 →