Behavior-Driven Living Requirements - The Universal Standard for Scalable Test Automation.
This document defines the framework-agnostic language used to describe BDR scenarios and behaviors. It is designed to be readable by humans, LLMs, and easily mapped to any programming language.
Focus: Business intent and outcome.
SCENARIO "Scenario Name"
ACTOR "Role/User Type"
// Setup (optional)
GIVEN Actor.hasCondition(param)
// Execution
DO Actor.businessAction(param)
// Verification
VERIFY Actor.hasState(expectedValue)
SCENARIO "User buys a backpack"
ACTOR "Customer"
GIVEN Customer.isLoggedIn()
DO Customer.addItemToCart("Backpack")
DO Customer.checkout()
VERIFY Customer.hasPurchased("Backpack")
Focus: Orchestrating business flows and steps.
ACTION Actor.businessAction(param)
STEP "Human readable description for reporting"
FLOW ModuleName.atomicAction(param)
FLOW AnotherModule.confirmAction()
ACTION Customer.addItemToCart(name)
STEP "Customer adds {name} to the cart"
FLOW Inventory.selectItem(name)
FLOW Cart.confirmAddition()
Focus: Bridging Domain to technical components.
FLOW ModuleName.atomicAction(param)
STEP "Interacting with technical component"
UI Component.performAction(param)
API Service.sendRequest(data)
DB Repository.saveRecord(entity)
FLOW Cart.confirmAddition()
STEP "Press Add to Cart button"
UI CartPage.addButton.click()
UI CartPage.cartBadge.waitForIncrease()
Focus: Native tool interaction (Playwright, Selenium, etc).
UI Component.performAction(param)
NATIVE tool.click(this.selector)
NATIVE tool.fill(this.selector, param)
API Service.sendRequest(data)
NATIVE httpClient.post(this.endpoint, data)
DB Repository.saveRecord(entity)
NATIVE database.insert(this.table, entity)
UI Component.click()
STEP "Perform native click"
NATIVE tool.click(this.selector)
| Keyword | Layer | Description |
|---|---|---|
| SCENARIO | 3 | Starts a test scenario. |
| ACTOR | 3 | Defines the entity performing actions (User, Admin). |
| GIVEN | 3 | Optional setup condition (pre-condition). |
| DO | 3 | Executes a business-level action. |
| VERIFY | 3 | Asserts a condition. |
| ACTION | 2 | Defines a domain-level behavior. |
| STEP | 2, 1 | Marks a block for reporting (Allure step). |
| FLOW | 2, 1 | Calls an atomic interaction. |
| UI | 1, 0 | Points to the UI technical layer. |
| API | 1, 0 | Points to the API technical layer. |
| DB | 1, 0 | Points to the database layer. |
| NATIVE | 0 | Direct call to the underlying tool (Playwright/Selenium). |
This pseudo-code standard ensures that BDR specifications remain readable and portable across different technology stacks.