A database fixture REST API is an HTTP API that loads and unloads predefined test data in a database.
A database fixture REST API loads and unloads predefined test data through HTTP. It keeps Playwright tests independent from database connection details while providing reusable fixture operations across projects. section 9.8.3
Use the API as a separate service in an end-to-end testing setup:
Add a db-fixture-rest-api container to Docker Compose beside the database and application services. section 9.8.3
Loading a fixture before an end-to-end test
A helper can call http://localhost:9000/load-fixture?db=...&fix=... with Axios, first unloading the named fixture and then loading it. Fixture files can export MongoDB documents for a collection; a directory such as two-videos supplies the fixture name, while videos.js identifies the videos collection. section 10.7.1
How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it
How deep it goes
Explains service integration, helper calls, and fixture naming, but defers the REST API’s Node.js and Express internals.
Examples
Uses a Docker Compose container, a loadFixture helper, and a two-videos fixture exporting documents for the videos collection.
What it assumes
Assumes familiarity with Playwright, Docker Compose, HTTP requests, and database testing while treating service internals as optional.
What you can do after
Operate/configure fixture loading for Playwright tests through Docker Compose and a small Axios-based helper.
How it connects
Connects Playwright, Docker Compose, MongoDB, Axios, Express, and microservices.
test fixtureuses · A test fixture is prepared data, state, resources, or setup and cleanup logic that establishes controlled conditions for one or more tests.
RESTkind of · REST is an architectural style for distributed hypermedia systems that organizes interactions around resources and representations through constraints including a uniform interface, stateless communication, cacheability, and layered components.
end-to-end testingused by · End-to-end testing evaluates a complete system workflow across integrated components, from an external or user-relevant input to an observable outcome.
This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.