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

nested scenario outlines in Behat?

Is it possible to have nested scenario outlines in Behat (Gherkin) e.g. do all of the below for a different set of Examples Scenario Outline: Some Outline Given step one with When step two with Then step three Examples: |…
paullb
  • 4,293
  • 6
  • 37
  • 65
0
votes
2 answers

How to access common variables created through Gherkin step definitions in Java without redundancy?

We have a couple of feature files, that share common steps. Login for example is the simplest step that comes to mind, if I want to get the user object that the login step created and was set in the LoginStepDefinitions.java file. Is it in my…
Mohamed Sobhy
  • 385
  • 1
  • 5
  • 17
0
votes
3 answers

Selenium Java Webdriver: Asserting double quotes

A website displays the following text I need to assert: Living Place "123" hasn't been found I have a piece of ghurkin/cucumber on a webpage I need to assert.assertTrue using Selenum Webdriver Java: The text "Living Place "123" hasn't been found"…
user3356141
  • 491
  • 1
  • 14
  • 26
0
votes
1 answer

How to "End call" using Calabash Android

I am newbe in using Calabash. I have basic android app where I can call or send sms to some people from my contact list. Then I press call button in my .apk, it's automatically starts calling to person The problem is - I cant stop this call. Try to…
famoso
  • 13
  • 5
0
votes
2 answers

Behat "I should see" function doesn't detect the links

I'm trying to do a search up on the admin block for Moodle. However, when I use "press 'Search'" and I use the "I should see" function, the function doesn't detect the content even though it's there. Can you please, help me out? This is somewhat…
0
votes
1 answer

How do I test conditional behaviour with Behat/Mink?

I have a condition I'd like to test in my Behat scenario but I can't think how it should be described. I am testing a webpage displaying articles - if there is one sponsored article then there should be two featured articles, if there is no…
Alastair
  • 1,710
  • 2
  • 17
  • 33
0
votes
0 answers

Writing cucumber features/scenarios on an iPhone?

When at home, I use TextMate 2, and the Gherkin syntax highlighting really makes a difference for me. But I'd like to write features at the beach, on my iPhone. I could always open up a text document, but I'm wondering if anyone else had that same…
bluemihai
  • 405
  • 4
  • 15
0
votes
1 answer

Best practices for designing Gherkin based Web Test Automation framework using selenium?

what is the Best practice for designing gherkin based UI Automation framework using selenium Browser instance For Feature wise steps definitions or page wise. Exception handling Logging functionality Execution According to feature or Scenario…
shiv
  • 497
  • 3
  • 17
0
votes
1 answer

Multiple elements on website

i use Behat with Mink and Selenium 2. The Problem is that i have a element twice... "Settings". First element is (for example) Settings and the second thing is a quick link in non visible menu
PatrickB
  • 3,225
  • 5
  • 31
  • 55
0
votes
1 answer

Can we integrate Gherkin feature files with testcomplete

Can we integrate Gherkin feature files with TestComplete Is there is an available plugin for TestComplete with Gherkin
shiv
  • 497
  • 3
  • 17
0
votes
1 answer

Parsing gherkin into json

I am sure this is a very stupid question but I cannot get my head around it. I have following ruby code: sample_test = "Feature: Some terse yet descriptive text of what is desired Textual description of the business value of this feature Business…
gok
  • 1,137
  • 1
  • 9
  • 30
0
votes
1 answer

Why does IntelliJ use "([^"]*)" when creating a ruby step?

When asked, IntelliJ automatically creates a ruby step for this Gherkin from a .feature file And I "foo" bar as this in a .rb file When /^I "([^"]*)" bar$/ do |arg| pending end I'm puzzled as to [^"]* instead of .* I also had a coworker mention…
Jazzepi
  • 5,259
  • 11
  • 55
  • 81
0
votes
2 answers

Is passing gherkin table value to IList rather than a regular string property supported?

I have a table written in gherkin for an object that I'm passing values to as such: | Description | Perils | | foo | 6 | There are much more values being passed but these two above are taken for example. In the binding, I'm …
LaRae White
  • 1,222
  • 3
  • 17
  • 35
0
votes
0 answers

"-" character is converted to ? in console for gherkin language used in cucumber feature file

I am using cucumber feature file to execute or write my test cases. Issue is that I am using data table as : | abc | 1234567890 | | defg | New Activation – Monthly (Credit in store) | Now issue is this that console…
0
votes
1 answer

Calabash, Detect UIButton pressed state

I want to know is there a way to detect UIButton state from calabash/ruby. Ex. Imagine I have a iphone app which contains a view with a round rect UIButton. This button will hold its state(if you pressed it, it will be on pressed state until you…