-1

I trying to rewrite my test case in gherkin but I am not familiar with gherkin any body can help me on how to translate my case to gherkin? Thanks

MUS
  • 47
  • 2

1 Answers1

0

Gherkin is a language which is understandable by Cucumber. In Gherkin, you can write in your own language i.e it supports more than 60 commonly spoken languages.

Gherkin serves two purposes — documentation and automated tests. The third is a bonus feature — when it yells in red it’s talking to you, telling you what code you should write.

Like Python and YAML, Gherkin is a line-oriented language that uses indentation to define structure. Line endings terminate statements (eg, steps). Either spaces or tabs may be used for indentation (but spaces are more portable). Most lines start with a keyword.

Example:

In English,

Feature: This is sample feature

    Scenario: First Scenario
    Given the input
    When I do
    Then I see

In Norwegian,

# language: no
Egenskap: Summering
  For å unngå at firmaet går konkurs
  Må regnskapsførerere bruke en regnemaskin for å legge sammen tall

  Scenario: to tall
    Gitt at jeg har tastet inn 5
    Og at jeg har tastet inn 7
    Når jeg summerer
    Så skal resultatet være 12
Aravin
  • 6,605
  • 5
  • 42
  • 58
  • You can go through my document of [getting started with capybara](http://aravin.net/getting-started-capybara-web-application-automation-framework/) – Aravin Apr 22 '16 at 06:51