Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cucumber Guidelines

Avatar for Elena Elena
August 02, 2018

Cucumber Guidelines

Short introduction into Cucumber

Avatar for Elena

Elena

August 02, 2018

Other Decks in Programming

Transcript

  1. Agenda • Mobile testing @XING • Short introduction into Cucumber

    • Cucumber guidelines • How do we measure it? 02.08.2018 Elena Ivan
  2. Startpage Unleashing… the beast Platform Events Contacts News Groups Mobile

    Releases Team XING APP Etc. 02.08.2018 Elena Ivan
  3. • 2 weeks release cycle • each team responsible for

    its codebase and its automated tests • each team needs to adhere to standards and guidelines from the community • release train testing every Monday • automated tests are integrated into the PR (unit, snapshot and functional)
  4. Automated functional tests • Calabash • automated acceptance testing framework

    for iOS and Android • Cucumber • tool that enables specifications to be written in natural language and executed • Ruby • programming language 02.08.2018 Elena Ivan
  5. Cucumber • tool to support Behaviour Driven Development (BDD) •

    offers a way to write tests in a natural language, that anybody can understand, regardless of their technical knowledge • language is Gherkin • each test is called Scenario, and the tests are grouped into Features 02.08.2018 Elena Ivan
  6. Given, When, Then, And Given - prerequisites for the test

    When - the action that the user performs Then - the expected outcome And - replacing couple of Given, When and Then in a row 02.08.2018 Elena Ivan
  7. • everyone was afraid of them (to write them, to

    check what is wrong, why they are failing) • not enough knowledge was distributed into the teams • everybody was writing their tests in their own way • we didn't know how to communicate with each other, also remotely • low readability of the tests 02.08.2018 Elena Ivan
  8. Eat your own cat food • Take a random test

    and go through it together • Evaluate it together • End up coming with the guidelines together 02.08.2018 Elena Ivan
  9. Feature • Name of the file is descriptive • Feature

    file contains description • Feature file doesn't contain duplicates or tests that extend each other • Feature doesn't contain commented or unclear steps and tests • Background steps were used where it makes sense Feature: Bookmarking events As an user I want to be able to bookmark the event I am interested in and un-bookmark it if I am no longer interested 02.08.2018 Elena Ivan
  10. Test (scenario) • Every test covers only one functionality •

    Test is as short as possible • Test is readable (even for an external reviewer) • Test has a clear outcome (assertion in the end of the test) • Given/When/Then/And order is correct 02.08.2018 Elena Ivan
  11. • Test data created on the fly using API calls

    when possible and makes sense • Test doesn't contain redundant steps (Then I am on … screen…) • No dependencies between tests • Single test run should be between 60-90 seconds 02.08.2018 Elena Ivan
  12. Use tags • split the tests in a logical manner

    • run each test individually @team @feature_name @feature_name_number 02.08.2018 Elena Ivan Split features in separate files
  13. How can you measure it? • Execution time on Jenkins

    • Execution time in the generated Cucumber report • Cucumber score (run ruby ../../cuke_sniffer.rb in the tests folder, and check html cuke_sniffer_result.html ) 02.08.2018 Elena Ivan
  14. Thank you! • Agile Tester • iOS Developer • Java

    Software Developer And, we’re hiring :D 02.08.2018 Elena Ivan