Gherkin.pptx

Embed Size (px)

Citation preview

  • 8/9/2019 Gherkin.pptx

    1/12

    Gherkin A language that Cucumber understands

    Business Readable

    Domain Specifc Language

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    2/12

    Cucumber Sotware Tool or testing other sotware

    Automated acceptance tests

    ritten in a beha!iour"dri!en de!elopment

    st%le

    ritten in Rub% programming language

    Allows the e&ecution o eature documenta

    ritten in Business"'acing Te&t

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    3/12

    Gherkin Describes sotware(s beha!iour without th

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    4/12

    Gherkin " -urpose Documentation

    Automated Tests

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    5/12

    Gherkin . Bonus 'eature hen it %ells in red/ it(s talking to %ou

    Telling %ou what code %ou should write

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    6/12

    Gherkin . Grammar Defned in the TreeTop grammar

    -art o Cucumber Codebase

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    7/12

    Gherkin . S%nta&'eature0 Some terse %et descripti!e te&t o what is desired

    Te&tual description o the business !alue o this eature

    Business rules that go!ern the scope o the eatureAn% additional inormation that will make the eature easier to understand

    Scenario0 Some determinable business situation

    Gi!en some precondition

    And some other precondition

    hen some action b% the actor

    And some other action

    And %et another actionThen some testable outcome is achie!ed

    And something else we can check happens too

    Scenario0 A di1erent situation

    222

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    8/12

    Gherkin . Gi!en hen ThenGi!en

    A 3nown State beore the 4ser starts interacting S%stem

    A!oid talking about 4ser 5nteraction

    67ui!alent to -R6C+8D5T5+8S in 4S6 CAS6S

    6&amples0 Create records #model instances$ 9 set up the database state2

    5t(s ok to call into the la%er )inside, the 45 la%er here #in Rails0 t

    models$2

    Log in a user #An e&ception to the no"interaction recommendatio

    )happened earlier, are ok$2

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    9/12

    Gherkin . Gi!en hen Thenhen

    A 3nown State beore the 4ser starts interacting S%stem

    A!oid talking about 4ser 5nteraction

    67ui!alent to -R6C+8D5T5+8S in 4S6 CAS6S

    6&amples0 Create records #model instances$ 9 set up the database state2

    5t(s ok to call into the la%er )inside, the 45 la%er here #in Rails0 t

    models$2

    Log in a user #An e&ception to the no"interaction recommendatio

    )happened earlier, are ok$2

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    10/12

    Gherkin . 'eature Defnition 6ach eature fle consists o a single eatur

    Starts with ke%word 'eature 'eature contains a list o scenarios

    6!er% scenario consists o a list o steps

    6ach Scenario starts with one o the ke%wo Gi!en

    hen Then

    But

    And

    02/07/2014

  • 8/9/2019 Gherkin.pptx

    11/12

  • 8/9/2019 Gherkin.pptx

    12/12

    Gherkin . 6&ample #;$Feature: 'ivision In order to avoid sill mista(es Cashiers must be able to calculate a raction

    Scenario: )e*ular numbers + I have entered , into the calculator + I press divide

    + I have entered 2 into the calculator + I press e-ual + &he result should be 1. on the screen

    02/07/2014