How to Add AI Scoring and Email Verification to Your E2E Suite
Prerequisites
This is Part 2 of a two-part guide. Part 1 built the three-layer foundation: UI (Playwright browser), API (HTTP), and DB (PostgreSQL). All the infrastructure from Part 1 — world.js, hooks.js, env.js, the cucumber.json profiles — is extended here, never replaced.
Before continuing, make sure Part 1 is complete, and all three profiles pass:
npx cucumber-js --profile uinpx cucumber-js --profile apinpx cucumber-js --profile db
Layer 4: Chat
The login feature from Part 1 was intentionally simple — one endpoint, one page, one table. The chat feature raises the complexity: it spans all three layers and introduces a Background block that shares setup steps across scenarios. This is where the three-layer model starts to pay off. The UI test confirms the interface renders. The API test validates the conversation contract. The DB test checks that messages are stored with the right sender type and order.
Folder Additions
e2e/├── features/│ ├──...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE