Acceptance and integration testing with GO

22 September 2016

Gediminas Morkevicius

Senior Gopher at, DATA-DOG

Working at

Today

Cucumber merges specification and test documentation into one cohesive whole.

Gherkin

Gherkin is the language that Cucumber understands. It is a Business Readable,
Domain Specific Language that lets you describe software’s behaviour without
detailing how that behaviour is implemented.

Enter Godog

The cucumber implementation for GO*

Lets write our first product basket feature

Feature: Product basket
  In order to buy products
  As a customer
  I need to be able to put interesting products into a basket

  Rules:
  - VAT is 20%
  - Delivery for basket under £10 is £3
  - Delivery for basket over £10 is £2

  Scenario: Buying two products over £10
    Given there is a "Sith Lord Lightsaber" which costs £10
    And there is a "Jedi Lightsaber" which costs £5
    When I add the "Sith Lord Lightsaber" to the basket
    And I add the "Jedi Lightsaber" to the basket
    Then I should have 2 products in the basket
    And the overall basket price should be £20

  Scenario: Buying a single product under £10
    Given there is a "Sith Lord Lightsaber" which costs £5
    When I add the "Sith Lord Lightsaber" to the basket
    Then I should have 1 product in the basket
    And the overall basket price should be £9

Does it look complex?

Even your manager can understand the behavior described.

Thank you

Gediminas Morkevicius

Senior Gopher at, DATA-DOG

Use the left and right arrow keys or click the left and right edges of the page to navigate between slides.
(Press 'H' or navigate to hide this message.)