Questions tagged [gherkin]

Gherkin is the language used to write specifications for Cucumber, Specflow and similar BDD frameworks. It is a business-readable, domain-specific language that lets you describe your software’s behaviour without detailing how that behaviour is implemented.

Gherkin is the language used to write specifications for Cucumber, Specflow and similar BDD frameworks. It is a business-readable, domain-specific language that lets you describe your software’s behaviour without detailing how that behaviour is implemented.

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.

Gherkin’s grammar is defined in the Treetop grammar that is part of the Cucumber codebase. The grammar exists in different flavours for many spoken languages (37 at the time of writing), so that your team can use the keywords in your own language.

There are a few conventions:

  • A single Gherkin source file contains a description of a single feature.
  • Source files have the extension .feature.
  • There is a fundamental pattern to each Gherkin scenario, with a context: (Given), an event (When), and an outcome (Then).

Gherkin was invented by Alsak Hellesoy.

You can read more about Gherkin here: https://github.com/cucumber/gherkin/wiki

Documentation of Cucumber and Gherkin: https://www.cucumber.io/

.NET implementation: http://www.specflow.org/

Python implementation: https://behave.readthedocs.io/

1169 questions
0
votes
1 answer

Installing Teambox on Ubuntu. Failing on Gherkin 2.3.3 installation

I haven't found Teambox's support forum so I'm asking here. Note that I am completely new to Linux and its commandline syntax so please understand. :) Anyway, I followed this guide and managed to install all the prerequisites needed. After cloning…
Ian
  • 5,625
  • 11
  • 57
  • 93
0
votes
1 answer

How to describe default state in features and GUI details

I have a button that changes its caption on hover. Im kinda at a loss how to phrase the features to test for that default state. At the moment Im using Scenario: show caption on hover Given I should not see an "Add Website" caption on the…
user1703761
  • 1,086
  • 3
  • 11
  • 23
0
votes
1 answer

Using single characters as parameters with specflow feature

I am having a real hard time figuring out what is going wrong with my spec flow feature in VS2012 and or VS2010 I am simply unable to use a single character as a parameter in a step if that character is contained anywhere else in the expression of…
Kezza
  • 736
  • 9
  • 25
0
votes
1 answer

Intellisense doesnt list the Gherkin statements which are from assembly reference

Intellisense doesnt list the Gherkin statements which are from assembly reference Eg: In Project A "Specific.feature" Project B - included into A as project reference "Commons.feature" When I click on "" In "Specific.feature" file if I do…
Amar HR
  • 153
  • 1
  • 1
  • 7
0
votes
1 answer

test for error-text that's associated with a field

In Capybara + Webkit + Ruby 1.9.3, I have the following HTML simple_form generates the following when there's an error on a specific field. I'm having trouble "getting at" the error-text span and knowing I definitely have the one associated with…
Michael Lang
  • 1,028
  • 12
  • 21
0
votes
4 answers

Gherkin to (not for) Javascript

I am new to BDD and Gherkin. Trying to use Cucumber, which parses Gherkin to Ruby - a language I don't know. Is there any library which converts Gherkin to Javascript ? If I get the Javascript output for Gherkin, I plan to modify the code and call…
dev
  • 11,071
  • 22
  • 74
  • 122
0
votes
1 answer

How to install xGherkin editor in Aptana studio 3 for Behave-BDD tool?

Which plugin should I install in Aptana Studio 3 to view the Gherkin files written in Behave(BDD tool for Python). The Gherkin files have '*.feature' extension. Right now, it treats the *.feature files as text files and does not support them. I am…
nids
  • 925
  • 2
  • 11
  • 16
0
votes
1 answer

Call one step from within another, Spinach

I recall there being a way to execute a step from within another step using spinach. As I recall, such a step would appear similar to the following: ... step "I create a patient as a facility's administrator" do %Q{ Given I am a facility's…
rthbound
  • 1,323
  • 1
  • 17
  • 24
0
votes
1 answer

How to use gherkin language in ThoughtWorks Twist framework?

I am doing BDD. I am working on Visual Studio 2010 - C#. I looked over internet for gherkin-twist integration but I got no solution. Please suggest me how to use gherkin language in ThoughtWorks Twist framework. Please also suggest me recommended…
Ninad More
  • 333
  • 5
  • 11
0
votes
1 answer

How to generate a file consisting of all scenarios tagged by @manual?

I have a bunch of feature files. Some of scenarios and features are tagged with @manual. I'd want to generate a file that will contain all scenarios and features tagged with this tag so that it will be easier to find them out. Obviously I can write…
Andrei Botalov
  • 20,686
  • 11
  • 89
  • 123
0
votes
1 answer

BDD: SpecFlow - Scenario Outline Behaviour Not As Expected

Using scenario outlines in SpecFlow, e.g. Scenario Outline: Invalid Login Details Given some pre-conditions... When user "Larry" enters username and password Then the message "Invalid Login Details" should be…
Tom Tom
  • 422
  • 4
  • 14
0
votes
1 answer

Cucumber steps definitions in spanish: Ambiguous match of "..."

I'm trying to translate the steps definitions of cucumber to spanish but I'm getting this error: Ambiguous match of "que estoy en la página "inicio de sesión"" features/step_definitions/web_steps.rb:3:in `/^que estoy en la página "([^"]*)"$/' …
Bishma Stornelli
  • 2,539
  • 4
  • 22
  • 30
0
votes
2 answers

Specflow scenarion description to long

I used to create scenarios where in scenario name I explain what is scenario. For example: Scenario: When during context switch, context doesn't match and list of facts for delete are shown to user, facts should be deleted if user has selected them…
Vajda
  • 1,795
  • 6
  • 39
  • 49
0
votes
2 answers

Escape a number or quoted string from Gherkin statement

If I have such a clause inside my feature definition: Then I can see the "/relative-url-path" page Cucumber will impose this method: @When("^I can see the \"([^\"]*)\" page$") public void I_open_the_page(String arg1) { // Express the Regexp…
Artem Oboturov
  • 4,344
  • 2
  • 30
  • 48
0
votes
1 answer

Connecting SpecFlow features to steps. The link keeps on breaking

Good morning. I'm having a problem with SpecFlow and I can't figure out how to solve it. Would appreciate any help. So... Lets take a simple SpecFlow feature: Given the JoeDoe user is associated to an existing staff account with the following…
InspiredBy
  • 4,271
  • 6
  • 40
  • 67