liveBook · Manning

End-to-end testing

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

End-to-end testing evaluates an application through its user-facing interfaces across the components needed to deliver a user-visible behavior.

End-to-end testing checks an application through its frontend, much as a customer would use it. For a microservices application, the test runs against the whole application or a useful cut-down configuration, exercising multiple services behind a visible result. Aim to make that configuration as close to production as practical. section 9.8

These tests sit at the top of the testing pyramid. Starting the application, database, and browser makes them slower than integration or unit tests, but a single test can cover substantial ground. Keep a useful handful alongside larger sets of faster tests; there is no fixed test count for every project. section 9.4 section 9.8.7

A practical Playwright workflow is:

  • Prepare a configuration that builds and runs the needed microservices and database. Use `docker compose up --build` to start them; a cut-down configuration can remain testable when the full application is too large for one computer. section 9.8.4
  • Install Playwright with `npm init playwright@latest` for generated configuration and starter tests. Set its `baseURL` to the running frontend so tests can visit routes without repeating the host address. section 9.8.2
  • Load database fixtures before visiting a page. With Playwright’s `page`, navigate to a route, locate elements in the DOM, and assert their count, text, or links. section 9.8 section 9.8.5
  • Run `npx playwright test` while the application is running. Use `npx playwright test --reporter=list` when terminal results are needed, including for a CI or CD pipeline. section 9.8.5

Check a video list

Start the gateway and metadata services with their database. Load a fixture containing two videos, visit `/`, then locate `#video-list>div` and assert that it contains two entries. Check each entry’s displayed name and link. This verifies that fixture data reaches the frontend, rather than checking the metadata service alone. section 9.8.4 section 9.8.5

Run the same UI test against the full application when it is available. Wait until the gateway is online before invoking the project’s test script: a browser test cannot pass against an application that has not started. section 10.6.2

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Works through application startup, fixtures, browser navigation, DOM assertions, and test commands, while limiting Playwright instruction to basics.
Examples
Uses a two-video fixture to check frontend entries and links, then runs the Playwright test against the full application.
What it assumes
Assumes a runnable microservices application and familiarity with Docker Compose; introduces the Playwright setup and basic page API.
What you can do after
Apply it via Playwright and Docker Compose to test frontend behavior across running microservices.
How it connects
Relates end-to-end tests to the testing pyramid, unit testing, integration testing, database fixtures, and CI/CD pipelines.

Also explained in

Compare how 12 books explain end-to-end testing →

Related concepts

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.