Given-When-Then
A structured format for describing a test scenario in terms of an initial context, an action, and an expected outcome.
What is Given-When-Then?
What is Given-When-Then?
Given-When-Then is a template for writing clear, behavior-focused scenarios: Given some starting context, When an action occurs, Then a specific outcome should follow. It comes from behavior-driven development and gives business, QA, and engineering a shared, unambiguous way to describe expected behavior. Because each clause maps cleanly onto setup, interaction, and assertion, these scenarios translate directly into automated tests. A recorded user flow essentially captures a Given-When-Then story in executable form.