Promptles
Testing & Quality

Fixture

intermediate

Definition

A pre-prepared piece of fake data that tests can rely on: like a sample user, a stock list of products, or a saved response. Using the same fixture across many tests keeps them tidy and consistent, instead of every test inventing its own slightly different sample.

In the wild

Lots of tests in a project need an 'admin user' to work with. Instead of each test creating its own admin from scratch, the team writes one shared fixture: 'name: Alice, role: admin.' Every test that needs an admin pulls in this same fixture, so they all start from the exact same known starting point.

More from Testing & Quality