🎞️ Videos Write Less, Achieve More: How to build a living document with Cucumber JS and PACT

Description

This session explores strategies for writing robust and efficient end-to-end tests, focusing on stability and speed. The speaker delves into the challenges of traditional unit testing and proposes an alternative approach using Cucumber and Gherkin to define system environments and preconditions. The talk demonstrates how to leverage Pact to mock entire servers, ensuring reliable and predictable test outcomes, even with dynamic backend behavior. Using a practical example of building a rock-paper-scissors game, the speaker illustrates how this method allows for comprehensive UI testing within a minute per test case, while maintaining high reliability. The session also touches upon the importance of documenting business rules and functionalities through tests, reducing reliance on individual team members and mitigating the risks associated with legacy code. Learn how to create more effective and maintainable tests that contribute to overall software quality and team collaboration.

Chapters

  • Introduction and Initial Hiccups 0:00
  • The Importance of End-to-End Testing 0:22
  • Writing Stable and Fast End-to-End Tests 0:40
  • Why Software Testing Matters 1:22
  • The Cost of Testing and the Limits of Unit Testing 2:23
  • Introduction to Effective Test Writing with Cucumber 3:12
  • Session Goal: Fast and Reliable End-to-End Tests 4:23
  • Documenting Business Rules and System Functionality 5:57
  • Escaping the Bottleneck: Documentation as Testing 7:45
  • Black Box Testing and Reducing Coupling 8:37
  • Using Cucumber and Gherkin for Requirements and Testing 9:09
  • Using Cucumber to Precondition Backends 10:02
  • Mocking Servers with PACT 11:00
  • Common Mistakes When Using Cucumber: It's Not Just Test Cases 12:09
  • Why Cucumber? Addressing System Dynamics in Integration Tests 14:48
  • Model-Based Testing and Its Complexities 17:06
  • The Need for Effective Testing Patterns 18:41
  • Building a Rock-Paper-Scissors Game: A Practical Example 19:01
  • Tech Stack: PACT, Test Containers, CucumberJS, Bun, and Elysia 20:13
  • Building the Rock-Paper-Scissors Application 22:05
  • Project Structure and Consumer-Driven Contract Testing 24:07
  • Beginning the Acceptance Test and Consumer-Driven Contracts 26:37
  • Writing Feature Files and Defining Rules and Scenarios 28:00
  • The Challenge of End-to-End Testing with Random Server Responses 29:18
  • Building the UI and API for the Game 30:40
  • Setting up the Automation Tests with Cucumber.js and PACT 33:35
  • The 'When' Clause: Performing Actions and Setting Up Mock Servers 37:36
  • How PACT Works: Building and Verifying Contracts 38:38
  • Starting the PACT Stub Server and Game Client 39:16
  • Reviewing Test Results and the Importance of Contracts 40:26
  • Q&A and Closing Remarks 41:44

Transcript

These community-maintained transcripts may contain inaccuracies. Select any text to report issues instantly, or edit on GitHub for advanced changes.

Internal server errorBad Gateway