Stop Doing E2E Tests! Write Better Tests with Contract
summary
Claims that end-to-end tests break down in microservices and that mocking gives false confidence; instead use Specmatic to run a stub server from OpenAPI specs and run Playwright tests that hit HTTP stubs. Demo builds a Next.js app plus shopping-list, rating and product services, pushes/pulls contracts to a repo, seeds data, starts Specmatic stubs, and validates contracts; it catches a renamed field and prevents a production break, reducing flakiness and preserving independent deploys.
AI-written summary · about
chapters (25)
- 0:00Contract testing alternatives
- 1:09Why E2E tests fail
- 3:36E2E testing problems
- 6:06Mocking false confidence
- 9:43Mocking SSR limits
- 11:51Contract-driven microservices
- 13:42Pact vs Specmatic
- 16:34From end-to-end to app testing
- 18:01Demo: Next.js and microservices
- 20:13OpenAPI for contracts
- 22:23Specmatic contract tests
- 23:26Early contract violations
- 24:30Pushing contracts to repo
- 25:15Testing with stopped servers
- 27:24Playwright with contract data
- 28:30Validating consumer contracts
- 29:13Breaking change detection
- 30:58Contract testing benefits
- 31:40Summary
- 32:04Q&A
- 32:50Q&A: Versioning and breaks
- 33:30Q&A: Testing vs versioning
- 34:14Q&A: Coverage and pain points
- 35:19Q&A: Convincing teams
- 36:00Closing remarks
related talks
51mContract-Driven Development-Escape Microservices Integration & Deployment Hell
27mFullstack testing
11mHow to make cheap e2e tests
01h 02mWriting better tests for your JavaScript app
40mStrategic Business Functionality Testing: Accelerating Development Through Mocking
50mRun Specs & Avoid Wrecks — A "Speed With Seatbelts" Lab
22mMicro Testing Pains
24mUsing API spec as an Executable Contract To Mock and Test Microservices
