bdd In 2019

cypress & cucumber

bene@theodo.co.uk
Ben Ellerby

Unit

Integration

End to End

Domain-Driven
DESIGN

 

DDD

Evans, E., 2004. Domain-driven design: tackling complexity in the heart of software. Addison-Wesley Professional.

Ubiquitous Language

Domain-Driven
DESIGN

 

DDD

bEHAVIOR DRIVEN
development

BDD

"Behaviour is a more useful word than test"

https://dannorth.net/introducing-bdd/

"Requirements are behaviour, too"

BDD Trend

BDD

bEHAVIOR DRIVEN
development

BDD

  • Features are defined in stories
  • Stories capture both the behaviour and acceptance criteria
  • The use of a ubiquitous DSL and standardised structure ensure understanding all the way through the process

GIVEN, WHEN, THEN

BDD

Given some context
When some action
Then some result

GIVEN, WHEN, THEN

BDD

Given the account has £10
When the customer requests £20
Then cash is not dispensed
And an error message is displayed
And the card is returned

Narrative

BDD

Story: One line description

As a ROLE
In order to GOAL
I want to BENEFIT

Cypress

Cypress

Text

Cypress

Cypress

Cypress

Cypress

Cypress does not use Selenium

Cypress

describe('My First Test', function() {
  it('Does not do much!', function() {
    expect(true).to.equal(false)
  })
})

Cypress

describe('My First Test', function() {
  it('Does not do much!', function() {
    expect(true).to.equal(false)
  })
})

Cypress

www.cypress.io

Cypress

www.cypress.io

Cucumber

www.cucumber.io

Provides the DSL for writing scenarios with the Gherkin syntax

Helping to provide living documentation

Cypress + Cucumber

https://github.com/TheBrainFamily/cypress-cucumber-preprocessor

+

Cypress + Cucumber

import { Then } from "cypress-cucumber-preprocessor/steps";

Then(`I see {string} in the title`, title => {
  cy.title().should("include", title);
});
https://github.com/TheBrainFamily/cypress-cucumber-example

Cypress + Cucumber

Backlog

Refinement

Tech Refinement

Review

Planning

Cypress + Cucumber

Kaizen

ben@ellerby.tech

https://www.linkedin.com/in/benjaminellerby/

BDD in 2019: Cypress and Cucumber

By Ben Ellerby

BDD in 2019: Cypress and Cucumber

The talk was given at the QE-Roundabout Meetup in London 12/02/19.

  • 888