gherkin_rust

A pure Rust implementation of the Gherkin (.feature file) language for the Cucumber testing framework

8 releases (4 breaking)

0.4.1 Sep 17, 2018
0.4.0 Aug 8, 2018
0.3.1 Jul 22, 2018
0.2.0 Jul 1, 2018
0.0.1 Jun 17, 2018

#3 in #cucumber

Download history 38/week @ 2018-12-18 13/week @ 2018-12-25 8/week @ 2019-01-01 24/week @ 2019-01-08 17/week @ 2019-01-15 17/week @ 2019-01-22 25/week @ 2019-01-29 38/week @ 2019-02-05 24/week @ 2019-02-12 42/week @ 2019-02-19 36/week @ 2019-02-26 35/week @ 2019-03-05 24/week @ 2019-03-12 37/week @ 2019-03-19 49/week @ 2019-03-26

148 downloads per month
Used in 2 crates (1 directly)

MIT/Apache

28KB
605 lines

gherkin-rust

A pure Rust implementation of the Gherkin (.feature file) language for the Cucumber testing framework.

If you want to run Cucumber tests in Rust, try cucumber-rust!

Usage

[dependencies]
gherkin-rust = "^0.3"

License

This project is licensed under either of

at your option.


lib.rs:

A Gherkin parser for the Cucumber test framework.

It is intended to parse the full gamut of Cucumber .feature files that exist in the wild, as there is only a de facto standard for these files.

.feature file structure

The basic structure of a feature file is:

  • Optionally one or more tags
  • Optionally #-prefixed comments on their own line
  • The feature definition
  • An optional description
  • An optional background
  • One or more scenarios (also taggable), each including:
    • One or more steps
    • Optionally data tables or docstrings per step
    • Optionally examples, which can also be tagged
  • One or more rules (also taggable), each including:
    • An optional background
    • One or more scenarios

Unparsed elements

Indentation and comments are ignored by the parser. Most other things can be accessed via properties of the relevant struct.

Dependencies

~2MB
~35K SLoC