13
Adding Cucumber Tests
Up until now, you have seen two types of automated tests: Vitest unit tests and Playwright end-to-end tests. This chapter adds a third type of test: Cucumber (https://cucumber.io).
Just like Playwright, Cucumber has its own test runner, which is typically set up to drive your application in the same way as Playwright does. The difference is that Cucumber tests are not written in JavaScript code.
Cucumber tests are contained within feature files that contain tests formatted in a special syntax known as Gherkin. These tests, known as features and organized into scenarios, read like plain English. That has a couple of advantages.
First, they can be written and understood by the whole team, not just developers. That means ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access