Skip to content

Given When Then

Easy — everyone uses thisTesting

ELI5 — The Vibe Check

Given When Then is AAA's cousin from the BDD world. Given = the setup situation. When = what the user/system does. Then = what should happen as a result. It reads more like a user story, which is why product managers can actually understand it.

Real Talk

Given-When-Then is a semi-structured way to write test scenarios, originating from BDD. Given describes the initial context, When describes the action or event, Then describes the expected outcome. It maps naturally to Gherkin syntax and makes tests double as documentation.

Show Me The Code

// Using Gherkin
Given a user has 3 items in their cart
When they apply coupon 'SAVE10'
Then the total should be reduced by 10%
And a success message should be displayed

When You'll Hear This

"Write acceptance criteria in Given-When-Then so QA can convert them directly to tests." / "Given-When-Then scenarios become runnable Cucumber tests."

Made with passive-aggressive love by manoga.digital. Powered by Claude.