5. A single source of truth
Cucumber merges specification and test documentation into one cohesive whole.
Living documentation
Because they're automatically tested by Cucumber, your specifications are always
bang up-to-date.
Focus on the customer
Business and IT don't always understand each other. Cucumber's executable
specifications encourage closer collaboration, helping teams keep the business goal
in mind at all times.
Less rework
When automated testing is this much fun, teams can easily protect themselves from
costly regressions.
5
7. What is the main components of Cucumber and
how to make it grow fast?*
*There is no need for chemicals, just a bit of coding
7
8. - Feature files written in Gherkin (Given, When Then)
- Step Definitions glue plain english to code using
RegEx
- Configuration file, helping you configure testing
environment (setup, cleanup, outcome)
8
9. Feature file
• Tag - let us define execution
path
• Feature - name of the the
component we test
• Description - short description
of what we are testing
• Background - common
behavior for all scenarios
• Scenario - individual test
• Gherkin - Scenario steps
(Given, When, Then)
9
10. Gherkin
• Given - defines initial state of
testing application
• When - action, invoke
methods, calling API,
interacting with UI layer
• Then - Asserting outcome
• And - helper if Given, When,
Then is not enough
10
11. Step Definition
• Sketching out the domain
model
• Annotations defines given,
when, then
• RegEx to glue Feature file to
Java code(or whatever
language you use).
11
15. • DataBase Testing
• Unit or/and Component Testing
• API Testing using frameworks like RestAssured
• Web UI testing using Selenium WebDriver
15
16. Technical features of Cucumber
• Run specific tests (using tags)
• Rerun failed tests
• Parametrized tests (data driving tests)
• Reusable steps (steps showing up in predictive way)
• Detailed report (in case of UI testing we can add
screenshot on fail)
• Configurable test
16
17. Cucumber scenario states
• Failed - scenario failed
• Pending - step definition created but there is no code
implementation yet
• Undefined - there is Gherkin steps, but no step definition
• Skipped - if scenario failed theres is no need to waste
time and executing rest of the steps
• Passed - lucky you :)
17
21. References
• https://cucumber.io/docs
• http://docs.behat.org
• https://relishapp.com
• http://specflow.org/documentation/
• https://www.ibm.com/developerworks/library/a-automating-ria/
• “The Cucumber For Java Book” by Seb Rose, Matt Wynne, & Aslak Helesoy
• “Specification by Example” by Gojko Adzic
• “BDD in Action” by John Ferguson Smart
• Rest-Assured with Cucumber: Using BDD for web services automation https://angiejones.tech/rest-
assured-with-cucumber-using-bdd-for-web-services-automation/ by Angie Jones
• toolsqa.com
21