Summary
This chapter covered how to use the Cucumber test runner to execute Gherkin feature files. Gherkin’s plain-English syntax makes this an important technique for bringing automated testing to the wider product development team.
The feature files are backed by step definitions. These step definitions are implemented using the Given
, When
, and Then
functions, which map Gherkin step descriptions to JavaScript code.
You’ve seen how step definitions can re-use the existing Playwright API code to manage browser interactions.
This completes our look at automated testing techniques. In Part 3, we’ll look at how to write unit tests for SvelteKit-specific features, starting with a chapter on strategies for testing authentication.