GithubHelp home page GithubHelp logo

gherkin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gherkin's Issues

Support | in table cells

IIRC Gherkin2 allows escaping of certain characters:

  • \| becomes |
  • \n becomes a newline

I don't remember if there are more. We should investigate this and make sure Gherkin3 behaves in the same way.

Allowed to contribute to ace editor?

I just created a PR against the ace editor to add this repo's js parsing logic. Ace requires me to sign a license agreement as part of their contributor requirements in order to do this. Part of the legalese states: "In brief, by submitting your code to Cloud9, you are granting us a right to use that code under the terms of this Agreement, including providing it to others. You are also certifying that you wrote it, and that you are allowed to license it to us. You are not giving up your copyright in your work."

I wanted to make sure you're ok with me doing this. Since gherkin3 is under MIT I figured it was fine, however I wanted to make sure.

Support different encodings

Cucumber-Ruby and Cucumber-JVM currently supports this:

# encoding: iso-8859-1

We should build support for this into Gherkin3 too I think. If a File object is passed in - read it first as UTF-8. Look for the header, and if it's present and not UTF-8, read the file again with the specified encoding.

The current implementations are here:

https://github.com/cucumber/gherkin/blob/master/lib/gherkin/lexer/encoding.rb
https://github.com/cucumber/gherkin/blob/master/java/src/main/java/gherkin/lexer/Encoding.java

Multilpe line examples, annotated examples and column separator alternative

Hi, I suggest new features for Gherkin language specification:

Multilne in example tables

It's very useful and simple to parse, just use a blank or a dashed line as separator. Like that.

Identation it's important in multiline mode.

Annotations for each example

Like that

And allow use | (\u007C) or ┆ (\u2506) as column separator.

Note: I've tried to make a fork with these changes but I can't understand how gherkin.berp define @TableRow.

Thanks.
Best reggards.

Multiline in examples tables

Scenario: [case]
    Given I need to transpile
    When EcmaScript6=[EcmaScript6]
    Then EcmaScript5=[EcmaScript5]

Examples:
  case             | EcmaScript6              | EcmaScript5
  --------------------------------------------------------------------------------
  arrow function   | var r=arr.map((x)=>x*x); | "use strict";
                   |                          |
                   |                          | var r=arr.map(
                   |                          |   function(x){
                   |                          |     return x*x;
                   |                          | });
  --------------------------------------------------------------------------------
  template strings | var s=`x=${x}            | var s='x='.concat(x).concat('\n')
                   | y=${y}`;                 | .concat('y=').concat(y);

Why:

  • It's very useful
  • Simple to parse, just use a blank or a dashed line before each example.

Note:

  • Identation it's important
  • Allow one or more empty lines between rows for pretty code
  • Sample working here

Python: gherkin-languages.json not packaged

When attempting to use the library when installed via pip

IOError: [Errno 2] No such file or directory: '/home/rof/.virtualenv/local/lib/python2.7/site-packages/gherkin3/gherkin-languages.json'

Readme and Ruby require

I just noticed a small issue in the Readme.md and documentation.
When trying to use the gem as specified in the example:

# Ruby
require 'gherkin3'

I get an error "`require': cannot load such file -- gherkin3 (LoadError)". Replacing it by:

require 'gherkin3/parser'

works like a charm. I prefer not to make a pull request, I ain't sure this comes from our project configuration or a real issue in the documentation.

Cheers.

Scenario.Title vs Name

Similar to Issue #18, but this is the first line of Scenario, Scenario Outline, Background, Examples, Feature, after the keyword.

In the original discussions we agreed on title (https://groups.google.com/d/msg/cukes-devs/RCnkmXsLQEs/GJgi0_bk_K0J) but later in the cucumber-core discussions switched to name (https://groups.google.com/d/msg/cukes-devs/YAdxutcTlYA/Bta1gKfVH0sJ) with the argument that title is too formal.

Now the C# code uses title the others name. We should consolidate this.

Title or Name?

/CC @aslakhellesoy @tooky @mattwynne

Issue with parsing of multiple scenario outlines in a row with tags

There appears to be an issue with Gherkin parsing multiple scenario outlines in a row where there are multiple tags at the top of the second scenario outline. I am running on version 3.1.1. See example file and walk through of code below:

Example file:

@ff001_tc01
@blah
Scenario Outline: blah blah
    Given <blah>
    When blah
    Then blah

    Examples:
        | blah   |
        | blah1 |
        | blah2 |

@ff001_tc02
@blahblah
Scenario Outline: blah blah
    Given blah

The following error gets thrown in the second scenario outline:

expected: #TagLine, #ExamplesLine, #Comment, #Empty, got 'Given blah'

The issue is that when it is processing the Examples rows and then reaches the first tag on the second Scenario Outline, it is in the match_token_at_27 function in parser.rb and hits the match_Tagline. It does the lookahead_0 and ends up putting the @blahblah piece into the context.token_queue. Then, as it continues on, it ends up processing the Scenario Outline line and then reading the @blahblah piece which is where it gets messed up since a tag cannot come after a Scenario Outline.

Separate git repo for each language?

Node.js' npm and PHP's Composer require packages/modules to be defined in the root of a repo. -At least if they are to be consumed as git repos. See #4 and #9 for more details.

My only reservation about splitting this repo into several repos (gherkin-csharp, gherkin-golang etc) is that it might make it more difficult to keep the implementations in sync. But maybe not.

All the language-specific repos would be "linked" to this repo using git submodule (or something similar), and maybe it wouldn't be that much of an issue.

WDYT?

Gherkin javascript astBuilder.reset() Cannot read property 'reset' of undefined

Trying to use the javascript binding and it says reset is not a function on astBuilder()

Here is the code

var Gherkin = require('gherkin');
var parser = new Gherkin.Parser();
var fs = require("fs");

fs.readFile('./ls.feature',function(err,contents){
  var gherkinDoc = contents.toString();
  var feature = parser.parse(gherkinDoc);
  console.log(feature);
});

Separate repo for Objective-C parser

Hello, from your Contributing.md file:

Gherkin3 is implemented in several different languages, and each language implementation lives in a separate git repository.

Is that right? Can I find it in a separate repo? As I need it for one personal project. I'm thinking about how to integrate it as 3rd party without getting the entire gherkin3 repo.

Also is the current implementation ready to be used in real projects, or it is a work in progress?

Thank you.

[JavaScript] NPM Package 3.0.0

As far as I understood, the JavaScript implementation in this repository is supposed to replace this NPM package, which is already released (version 2.12.2) and accessible from here.

Now I'm wondering:

  1. Is this implementation production ready? (cucumber-js is still using this old no-longer-supported JS parser)
  2. When do you plan release of Gherkin NPM package 3.0.0?
  3. Where can I find it's public API documentation?

Looking at src code (especially test suite) it seems that some bits are missing to make it even a release candidate. Anyway, it would be nice to have a reliable status of this library in README.md so we can push release forward.

Parser error when have multi line comment after data table.

Feature: Using calculator to calculate total addition, multiplication of list number

  This feature used to do addition and multiplication for all numbers in the list.
  In this test we just test for integer numbers.

  Background:
    Given I have list of number
      |12|
      |3 |
      |45|
      |2 |        

    # This scenario for addition operation

    """
    This feature used to do addition and multiplication for all numbers in the list.
    In this test we just test for integer numbers.
    """
  Scenario: Add all number in list
    When I add all number in list
    Then the result after adding all number in list should be 62

    # This scenario for multiplication operation
  Scenario: Multiply all number in list
    When I multiply all number in list
    Then the result after multiplying all number in list should be 3240

Throws exception when parse this feature with above content.

Step.Argument and null object pattern, Node base class

Once we mentioned that we want to use a kind of null object pattern for Step.Argument, ie have something like an EmptyStepArgument instance for those steps that neither has a DataTable nor a DocString argument. The current C# version is implemented like this, but the others not.

I would like to consolidate the implementations. Shall I remove the EmptyStepArgument?

This is somewhat related to the Node base class, that has only a Location. As the EmptyStepArgument does not have a location, it cannot be a proper Node.

In general: is the Node base class is part of the AST definition (ie has meaning) or just an implementation helper? In C# i did not need the base class as implementation helper, but I would introduce it if we see this as part of the AST.

Finding the right way to provide the PHP implementation

This issue is meant to continue the discussion started in https://twitter.com/everzet/status/575285360403611648 in a better place than Twitter /cc @everzet @cyaranmcnulty

The current Gherkin parser available in PHP is https://github.com/Behat/Gherkin/. I see 2 different ways to provide the gherkin3-compatible parser for PHP:

  1. keeping behat/gherkin as parser for PHP, but making it run the same acceptance tests than the cucumber/gherkin3 parsers (see #3 which was opened for this reason)
  2. generate a PHP parser in this repo (using a different PHP namespace than Behat given that behat/gherkin is already at version 4 anyway and the generated library would probably not be a drop-in replacement)

The first solution means that all the maintenance of the PHP parser stays on the shoulders of the Behat team, but the acceptance tests would ensure consistency.
The following concerns the second solution

Composer support

The PHP parser MUST be available as a Composer package registered on Packagist (otherwise everyone will hate the library, starting with the Behat team). However, Composer does not play well with repositories containing code for multiple languages:

  • it expects to have the composer.json file at the root of the repository (not that annoying given that it is a single file, but still inconsistent with other languages)
  • Composer will then download the Github archive (or clone the repo depending on the user preference) to get the PHP code, meaning PHP users will download lots of garbage code

A way to handle this is to have the generated PHP parser in a repo containing only the PHP library. There is 2 ways to achieve this:

  • generating it in this repo and then maintaining a subtree repo, which will be used by Packagist. This requires some external server responsible for updating the subtree split automatically on each push to the main repo
  • generating it only in the gherkin-php repo. This requires to think about regenerating this one when updating the parser definitions in the main repo, or having an automated update of the gherkin-php repo. It makes the maintenance work bigger when updating parser definitions here

Impact on Behat

Currently, the Behat\Gherkin node classes (representing the AST) are exposed to userland code (especially the PyStringNode and the TableNode). So Behat itself would have 2 choices to use the new parser:

  • break backward compatibility by dropping behat/gherkin entirely and making userland code use the AST objects generated by the new parser (and then hoping that the cucumber follows semver properly on the gherkin parser so that changes here don't break BC for Behat users by mistake).
  • keep the node classes of behat/gherkin and implement a converter from the new AST objects to the behat/gherkin ones, to use it after parsing a file. This solution is much better IMO, because it means that Behat users would not have to know about the parser change at all (except in case the current behat/gherkin parser has a different parsing behavior of course, but this would happen in any case)

@everzet @aslakhellesoy What would be the preferred approach for the parser itself (for the impact on Behat itself, I think the best solution is quite clear)

Implement a Gherkin parser in C

I started implementing a Gherkin parser using the GLib and json-glib: gherkin C/glib implementation. It is currently able to generate the AST (in json) for simple scenarios without tags (yet), it supports feature/scenario/Step/tables for now. It is just the beginning but I am opening this task basically to know if you would concider that direction good for you?

Also, I started looking at the acceptance tests but it looks like it is just doing diff between expect results and actual results, but the json outputed by json-glib has minor difference in formating (name: value VS name : value for example) so diffing will just fail, am I missing somthing here?

Initialise parser in arbitrary state

Cucumber will need to get a step's keyword in order to generate a stepdef snippet with the right keyword.
Pickles don't contain the step keyword because they can originate from non-gherkin documents (such as Markdown, which doesn't have step keywords).

Pickles contain the path of the source file.

It's possible to parse the source file with Gherkin, iterate over scenarios and find the step for a certain line.

But that's very cumbersome.

It would be better to ask the parser to return a Step AST node directly. This would require initialising the parser in the right state, so that parsing a step doesn't cause a parse error.

Something like this (pseudoish code):

var parser = new Parser();
parser.state = Parser.ScenarioState;
var step = parser.parse('    Given I have 4 cukes');
var keyword = step.keyword;

Thoughts?

Nest comments under parents e.g. feature.comments, step.comments

Hi,

I'm in the process of migrating to the Gherkin 3 JavaScript implementation and dropping my custom Gherkin 2 Visitor. It's really great, thanks. I have noticed that comments are grouped together in a single array, I'd previously implemented them as belonging to a feature, step, example etc.

Would it be possible to have comments belonging to their parents objects so we would end up with feature.comments, background.comments, scenarioDefinition.comments etc? I imagine it might be possible that the logic could be similar to the way tags are attached to features and scenarios.

Thanks,
Jim

Support | (\u007C) or ┆ (\u2506) as column separator.

Scenario: [nth]
   Given [nth]
   When [char]
   Then [name] 

Examples:
    nth    ┆ char ┆ name
    First  ┆  -   ┆ dash
    Second ┆  |   ┆ pipe

Why:

  • It's important when | (\u007C) is part of data and it's pretty than escaping (|)
  • Simple to parse: if line has ┆(\u2506) use it else use | (\u007C) as column separator

Reusing different backgrounds

@jbpros suggested to reopen an issue here.

I suggested many possible solution in the original post, one of them is the following:

Feature: Viewing post pages

  In order to absorb Lachlan's deep insights into man and machine
  I should be able to visit pages and pages and pages of blog posts

  Group:
    Background:
      Given I am logged in

    Scenario: viewing a post when logged in
      When I view the post page
      Then I see the page

    Scenario: viewing a mobile post when logged in
      When I view the mobile post page
      Then I see the page

    Scenario: viewing a mobile post when not logged in
      When I view the mobile post page
      Then I see the page


  Group:
    Background:
      Given I am not logged in

    Scenario: viewing a post when not logged in
      When I view the post page
      Then I see the page

The focus is on reusing multiple different backgrounds here. I think it's worth a discussion.

Step.Text vs Name

I tried to make a research on what we discussed so far.

In the original discussion we agreed on text (against body and name):
https://groups.google.com/d/msg/cukes-devs/RCnkmXsLQEs/J4K8mPxzOw0J

There was also a discussion as part of the cucumber-core, where it went more for the name
https://groups.google.com/forum/#!searchin/cukes-devs/Title/cukes-devs/YAdxutcTlYA/rPREkIzahYUJ

The C# implementation uses text the others name. What should it be then?

/CC @aslakhellesoy @tooky @mattwynne

Background Outline support

Hi,

First of all thanks for cucumber.js! It is working great so far. Im using it to test SOAP, mobile SDks, mobile gui (appium) and more to be added later. Then executing all features in parallel using https://github.com/simondean/parallel-cucumber-js. Its really been fun so far :)

There is however one problem that I cant find a nice way to solve with the existing functionality. We have different flavours or versions for some of our customers and want to run some of the tests on all of them. Most of my scenarios already have outlines so to add the flavour in there to each scenario is not ideal.

Given I want to execute the following scenario for a red and blue cucumber:

Scenario Outline: Eating
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    | 12    |  5   |  7  |
    | 20    |  5   | 15  |

I can add it to the examples:

Scenario Outline: Eating <type>
  Given there are <start> <type> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | type  | start | eat | left |
    | red   | 12    |  5   |  7  |
    | red   | 20    |  5   | 15  |
    | blue  | 12    |  5   |  7  |
    | blue  | 20    |  5   | 15  |

Or duplicate the scenario or feature.

Scenario Outline: Eating red
  Given there are <start> red cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    | 12    |  5   |  7  |
    | 20    |  5   | 15  |

Scenario Outline: Eating blue
  Given there are <start> blue cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    | 12    |  5   |  7  |
    | 20    |  5   | 15  |

Now imagine that you have 100 scenarios and a few examples in each of them..

The better solution would be to allow iteration on the background (please let me know if im missing something). Other benefit is that it will apply to all the scenarios if there is more than one.

Background Outline:
  Given I have a <type> cucumber instance

 Examples:
  | type    |
  | red     |
  | blue    |
  | yellow  |
  | pink    |

Scenario Outline: Eating
  Given there are <start> cucumbers
  When I eat <eat> cucumbers
  Then I should have <left> cucumbers

  Examples:
    | start | eat | left |
    | 12    |  5   |  7  |
    | 20    |  5   | 15  |

This is also very useful for iterating over multiple browsers and mobile devices.

Let me know if there are a better way of doing this and if this is a planned addition to gherkin3/cucumber.js. I think this will be very useful and improve the already awesome tool a lot.

Thank you.

Regards,
Riaan

Objective C Parser not working

Hello I am trying to install the version but I get an error. Can anyone provide me with a little guide What do I need to make it work!

i try this:

GHParser *parser = [GHParser new];
id parsingResult = [parser parse:filename];

but the log says:

2015-11-03 11:59:39.392 Gherki[10534:917811] -[GHParser parse:]: unrecognized selector sent to instance 0x60000002b340
2015-11-03 11:59:39.392 Gherki[10534:917811] *** Canceling drag because exception 'NSInvalidArgumentException' (reason '-[GHParser parse:]: unrecognized selector sent to instance 0x60000002b340') was raised during a dragging session

Greetz

AST for Example Placeholders and implicit Step Parameters

I was wondering why the gherkin parser doesn't parse example-placeholders e.g. <name> or implicit/default step parameters e.g. numerics or quoted strings...

Sure, I understand that the interpretation of the Step's text is not part of gherkin, but that of the step definition provider or test suite runner (e.g. cucumber, behat etc...). But I think it would be good for tools like linters, syntax highlighters, etc to identify all meaningful parts of the gherkin file...

Also example placeholders could be verified against the examples table headers.

What do you think?


…here are some examples

Feature: Consuming Cucumbers

  Scenario: eat 5 out of 12
    Given there are 12 cucumbers
     When I eat 5 cucumbers
     Then I should have 7 cucumbers

  Scenario Outline: eating
    Given there are <start> cucumbers
     When I eat <eat> cucumbers
     Then I should have <left> cucumbers

    Examples: 
      | start        | eat | left   |
      |           12 |   5 |      7 |
      |         20.9 |   5 |     15 |
Feature: Hello World

  Scenario: Nice people
    Given a nice person called "Bob"
      And a nice person called "Lisa"
     When "Bob" says to "Lisa": "Hello!"
     Then "Lisa" should reply to "Bob": "Hello!"

Can't build Release dll for .NET

I tried this on my mac:

cd dotnet
make Gherkin/bin/Release/Gherkin.dll

But got this error:

Errors:

/Users/aslakhellesoy/git/cucumber/gherkin3/dotnet/Gherkin.CSharp.sln (default targets) ->
(Build target) ->
/Users/aslakhellesoy/git/cucumber/gherkin3/dotnet/Gherkin.NuGetPackages/Gherkin.NuGetPackages.csproj (default targets) ->
/Users/aslakhellesoy/git/cucumber/gherkin3/dotnet/packages/MSBuild.MSBBuildConvention.2.0.0/build/build.targets (Build target) ->
/Users/aslakhellesoy/git/cucumber/gherkin3/dotnet/packages/MSBuild.MSBBuildConvention.2.0.0/build/build.targets (Legacy_100_Warnings;Legacy_100_Warnings;NugetBuild) ->

    /Users/aslakhellesoy/git/cucumber/gherkin3/dotnet/packages/MSBuild.MSBBuildConvention.2.0.0/build/build.targets: error : Target named 'Legacy_100_Warnings' not found in the project.

     3 Warning(s)
     1 Error(s)

Time Elapsed 00:00:00.9738270
make: *** [Gherkin/bin/Release/Gherkin.dll] Error 1
make: *** Deleting file `Gherkin/bin/Release/Gherkin.dll'

Any ideas @gasparnagy? Building the Debug dll works fine.

Where gherkin.berp defines @TableRow?

I've tried to make changes for apply request pulls for issues #52 , #53 and #54 but i'm newer with berp.

I can imagine that @TableRow reffers to how parse each example but I where it's defined?

Thanks

Examples of special characters

Is there documentation on what special characters are allowed in the examples table? E.g. -, ?, ', etc? When using the ace editor syntax highlighting, using those characters seem to break the highlighting.

gherkin-special-characters

I understand that's not your problem, but curious what syntax is allowed.

Add all implementations to items in `TODO.md`

I’m interested in this project for its Python implementation, so I noticed Python was missing from most of the top-level items in TODO.md.

After a moment, I realized that there seem to be 6 implementations in this project, but many items in TODO.md have only 4 items (C#, Java, JavaScript, and Ruby).

Shouldn’t most of these tasks have all 6 implementations listed?

(…Or, am I missing something?)

Compiler design and pickles

Let's use this issue to discuss how to design the Gherkin compiler, which is described at a very high level in the toplevel README. My goal is to decouple Cucumber implementations from Gherkin so Cucumber implementations can consume other formats.

I've been playing around with various designs to implement the compiler - both a visitable AST and a plain old external iteration one. I'm currently leaning towards a non-visitor one because I think a visitable one adds unnecessary complexity.

IMO visitor is only really useful when there is a high degree of polymorphism in the child nodes. In the Gherkin AST it's only Scenario|ScenarioOutline and DataTable|DocString that are polymorphic.

If we stick with visitor we have to decide where to put iteration - in the nodes or in the visitor. For the compiler I think a depth-first traversal is best. For pretty-printing I think a breadth-first traversal is best. In other words, if we implement iteration in the nodes we can't please everyone (unless we introduce a pluggable tree walker).

Furthermore, I'd like all implementations to be as similar as possible. The JavaScript implementation doesn't even define types for the AST (they are just dumb objects with properties). I love the simplicity of that and I'd be sad to have to complicate it.

My current feeling is to not use visitor at all, and let the compiler traverse the AST entirely on its own, using external iteration. It's not as elegant perhaps, but it's more pragmatic IMO.

The next question is - what does the compiler produce? My idea is that it produces pickles! More specifically a list of PickledCase (compiled scenarios). This is a struct that is completely decoupled from the Gherkin AST - it only has a source array with Location to produce a stack trace.

The pickles would eventually move to a separate repo/library, and Cucumber implementations will only depend on pickles for the runtime. This would enable is to come up with alternative formats for Cucumber, such as Markdown or even Excel. Just write another parser/compiler that produces pickles.

Let me know what you think. /cc @gasparnagy @muhqu @jbpros @tooky @mattwynne @everzet @stof

Gherkin => AST => Gherkin printer?

I was wondering if this was something you guys were interested in.

I would be useful for performing batch operations across a code base, like tagging every n'th scenario or changing a word everywhere in a code base.

thoughts?

Please add an explanation about how the acceptance suite works

I'm one of the maintainers of the Behat project, which is considered as the official PHP implementation of Cucumber. We have our own Gherkin parser implementation written in PHP for that.
I think it would be great if we could run the Gherkin acceptance testsuite with our own parser to ensure consistency. Could you describe how the acceptance suite works so that we can try to achieve such setup ?

Parsing dialect file fails on Windows

import gherkin3 on Windows results in the following error:

Traceback (most recent call last):
  File "run.py", line 5, in <module>
    from gherkin3.parser import Parser
  File "c:\users\curzona\desktop\gherkin-python\gherkin3\parser.py", line 4, in <module>
    from .token_matcher import TokenMatcher
  File "c:\users\curzona\desktop\gherkin-python\gherkin3\token_matcher.py", line 2, in <module>
    from .dialect import Dialect
  File "c:\users\curzona\desktop\gherkin-python\gherkin3\dialect.py", line 12, in <module>
    DIALECTS = json.load(file, encoding='utf-8')
  File "C:\python27\lib\json\__init__.py", line 286, in load
    return loads(fp.read(),
  File "C:\python27\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 731: character maps to <undefined>

Use “keep a changelog” format

There is an effort to move toward a consistent format for CHANGELOG.md files. AFAIK, it’s not yet very widespread. But it’s simple to understand (and follow), and its principles are based in common sense. They are outlined here:

http://keepachangelog.com

If you like what you read there, I’d be happy to update CHANGELOG.md and send a Pull Request.

What do you say? :)

Cannot parse multiple times

from gherkin3.token_scanner import TokenScanner
from gherkin3.parser import Parser

parser = Parser()
print parser.parse(TokenScanner("Feature: 1"))
print parser.parse(TokenScanner("Feature: 2"))

Results in:

{'language': 'en', 'keyword': u'Feature', 'tags': [], 'comments': [], 'location': {'column': 1, 'line': 1}, 'scenarioDefinitions': [], 'type': 'Feature', 'name': u'1'}
{'language': 'en', 'keyword': u'Feature', 'tags': [], 'comments': [], 'location': {'column': 1, 'line': 1}, 'scenarioDefinitions': [], 'type': 'Feature', 'name': u'1'}

Note the name hasn't changed from 1 to 2. Am I missing something in how this is supposed to be used?

Annotations for each example

Scenario: [nth] Scenario

    Given [nth]
    When [A]
    Then [number]

Examples:
    nth    | letter | number
@Pending    
    First  | A      | 1
    Second | B      | 2
    Third  | C      | 3   

Why:

  • Simple to parse, use @tag without column separator before example
  • The test runner can use the tag for automatic bypass In above example ,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.