Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gherkin + Behat Scenario outline throws Behat\Gherkin\Exception\ParserException

Tags:

php

gherkin

behat

I am trying to run registration example and I am getting stuck

Scenario: New user registration; poor password
  Given I am on "/register"
  When I fill in "username" with "admin"
  And I fill in "password1" with "<pw>"
  And I fill in "password2" with "<pw>"
  And I press "Login"
  Then I should be on "/register"
  And I should see an "pwError" element

  Examples:
    |  pw   |
    |  12   |
    |  20   |

Then I get the following error:

[Behat\Gherkin\Exception\ParserException] Expected Comment or Scenario or Outline or Step token, but got Examples

What am I doing wrong? I cannot find any help on behat doc or so.

like image 821
Fatmuemoo Avatar asked Apr 19 '13 17:04

Fatmuemoo


People also ask

What is a gherkin scenario?

Scenario is one of the core Gherkin structures. the Scenario:keyword (or localized one), followed by an optional scenario title. Each feature can have one or more scenarios, and every scenario consists of one or more steps.

What is Behat Gherkin?

Behat is a tool to test the behavior of your application, described in special language called Gherkin. Gherkin is a Business Readable, Domain Specific Languagecreated especially for behavior descriptions. It gives you the ability to remove logic details from behavior tests. Gherkin serves two purposes: serving as your project’s documentation ...

What are the features of Gherkin syntax?

Gherkin Syntax Features Scenarios Scenario Outlines Backgrounds Steps Givens Whens Thens And, But Multiline Arguments Tables PyStrings Tags Gherkin in Many Languages Writing Features - Gherkin Language¶ Behat is a tool to test the behavior of your application, described in special language called Gherkin.

How do I check if Behat and gherkin support my language?

To check if Behat and Gherkin support your language (for example, French), run: behat --story-syntax --lang=fr Note Keep in mind that any language different from enshould be explicitly marked with a #language:...comment at the beginning of your *.featurefile:


1 Answers

With examples, you have to use the "Scenario Outline" instead of "Scenario".

like image 123
Jakub Zalas Avatar answered Oct 20 '22 23:10

Jakub Zalas