Skip to content

Commit

Permalink
Rework documentation structure
Browse files Browse the repository at this point in the history
  • Loading branch information
elchupanebrej committed Oct 6, 2024
1 parent cc2075f commit ccf8206
Show file tree
Hide file tree
Showing 11 changed files with 377 additions and 273 deletions.
89 changes: 5 additions & 84 deletions CHANGES.rst

Large diffs are not rendered by default.

302 changes: 167 additions & 135 deletions docs/features.rst
Original file line number Diff line number Diff line change
@@ -1,135 +1,167 @@
.. NOTE:: Features below are part of end-to-end test suite; You always could find most specific
use cases of **pytest-bdd-ng** by investigation of its regression
test suite https://github.com/elchupanebrej/pytest-bdd-ng/tree/default/tests

Tutrorial/Launch.feature
""""""""""""""""""""""""

.. include:: ../features/Tutrorial/Launch.feature
:code: gherkin

Feature/Localization.feature
""""""""""""""""""""""""""""

.. include:: ../features/Feature/Localization.feature
:code: gherkin

Feature/Description.feature
"""""""""""""""""""""""""""

.. include:: ../features/Feature/Description.feature
:code: gherkin

Feature/Tag conversion.feature
""""""""""""""""""""""""""""""

.. include:: ../features/Feature/Tag conversion.feature
:code: gherkin

Feature/Tag.feature
"""""""""""""""""""

.. include:: ../features/Feature/Tag.feature
:code: gherkin

Step/Doc string.feature
"""""""""""""""""""""""

.. include:: ../features/Step/Doc string.feature
:code: gherkin

Step/Data table.feature
"""""""""""""""""""""""

.. include:: ../features/Step/Data table.feature
:code: gherkin

Step/Step definition bounding.feature
"""""""""""""""""""""""""""""""""""""

.. include:: ../features/Step/Step definition bounding.feature
:code: gherkin

Step definition/Target fixtures specification.feature
"""""""""""""""""""""""""""""""""""""""""""""""""""""

.. include:: ../features/Step definition/Target fixtures specification.feature
:code: gherkin

Step definition/Pytest fixtures substitution.feature
""""""""""""""""""""""""""""""""""""""""""""""""""""

.. include:: ../features/Step definition/Pytest fixtures substitution.feature
:code: gherkin

Scenario/Description.feature
""""""""""""""""""""""""""""

.. include:: ../features/Scenario/Description.feature
:code: gherkin

Scenario/Tag.feature
""""""""""""""""""""

.. include:: ../features/Scenario/Tag.feature
:code: gherkin

Feature/Load/Scenario search from base url.feature
##################################################

.. include:: ../features/Feature/Load/Scenario search from base url.feature
:code: gherkin

Feature/Load/Autoload.feature
#############################

.. include:: ../features/Feature/Load/Autoload.feature
:code: gherkin

Feature/Load/Scenario function loader.feature
#############################################

.. include:: ../features/Feature/Load/Scenario function loader.feature
:code: gherkin

Feature/Load/Scenario search from base directory.feature
########################################################

.. include:: ../features/Feature/Load/Scenario search from base directory.feature
:code: gherkin

Step definition/Parameters/Defaults.feature
###########################################

.. include:: ../features/Step definition/Parameters/Defaults.feature
:code: gherkin

Step definition/Parameters/Injection as fixtures.feature
########################################################

.. include:: ../features/Step definition/Parameters/Injection as fixtures.feature
:code: gherkin

Step definition/Parameters/Conversion.feature
#############################################

.. include:: ../features/Step definition/Parameters/Conversion.feature
:code: gherkin

Step definition/Parameters/Parsing by custom parser.feature
###########################################################

.. include:: ../features/Step definition/Parameters/Parsing by custom parser.feature
:code: gherkin

Step definition/Parameters/Parsing.feature
##########################################

.. include:: ../features/Step definition/Parameters/Parsing.feature
:code: gherkin

Scenario/Outline/Examples Tag.feature
#####################################

.. include:: ../features/Scenario/Outline/Examples Tag.feature
:code: gherkin
Features
========

.. NOTE:: Features below are part of end-to-end test suite; You always could find most specific
use cases of **pytest-bdd-ng** by investigation of its regression
test suite https://github.com/elchupanebrej/pytest-bdd-ng/tree/default/tests



Tutrorial
---------

Launch.feature
##############

.. include:: ../features/Tutrorial/Launch.feature
:code: gherkin

Tutorial
--------

Step definition
---------------

Pytest fixtures substitution.feature
####################################

.. include:: ../features/Step definition/Pytest fixtures substitution.feature
:code: gherkin

Target fixtures specification.feature
#####################################

.. include:: ../features/Step definition/Target fixtures specification.feature
:code: gherkin

Parameters
##########

Conversion.feature
!!!!!!!!!!!!!!!!!!

.. include:: ../features/Step definition/Parameters/Conversion.feature
:code: gherkin

Defaults.feature
!!!!!!!!!!!!!!!!

.. include:: ../features/Step definition/Parameters/Defaults.feature
:code: gherkin

Injection as fixtures.feature
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. include:: ../features/Step definition/Parameters/Injection as fixtures.feature
:code: gherkin

Parsing by custom parser.feature
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. include:: ../features/Step definition/Parameters/Parsing by custom parser.feature
:code: gherkin

Parsing.feature
!!!!!!!!!!!!!!!

.. include:: ../features/Step definition/Parameters/Parsing.feature
:code: gherkin

Step
----

Data table.feature
##################

.. include:: ../features/Step/Data table.feature
:code: gherkin

Doc string.feature
##################

.. include:: ../features/Step/Doc string.feature
:code: gherkin

Step definition bounding.feature
################################

.. include:: ../features/Step/Step definition bounding.feature
:code: gherkin

Scenario
--------

Description.feature
###################

.. include:: ../features/Scenario/Description.feature
:code: gherkin

Tag.feature
###########

.. include:: ../features/Scenario/Tag.feature
:code: gherkin

Outline
#######

Examples Tag.feature
!!!!!!!!!!!!!!!!!!!!

.. include:: ../features/Scenario/Outline/Examples Tag.feature
:code: gherkin

Feature
-------

Description.feature
###################

.. include:: ../features/Feature/Description.feature
:code: gherkin

Localization.feature
####################

.. include:: ../features/Feature/Localization.feature
:code: gherkin

Tag conversion.feature
######################

.. include:: ../features/Feature/Tag conversion.feature
:code: gherkin

Tag.feature
###########

.. include:: ../features/Feature/Tag.feature
:code: gherkin

Load
####

Autoload.feature
!!!!!!!!!!!!!!!!

.. include:: ../features/Feature/Load/Autoload.feature
:code: gherkin

Scenario function loader.feature
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. include:: ../features/Feature/Load/Scenario function loader.feature
:code: gherkin

Scenario search from base directory.feature
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. include:: ../features/Feature/Load/Scenario search from base directory.feature
:code: gherkin

Scenario search from base url.feature
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. include:: ../features/Feature/Load/Scenario search from base url.feature
:code: gherkin
3 changes: 2 additions & 1 deletion features/Feature/Localization.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Feature: Scenarios tags could be localized
pytest-bdd-ng supports all localizations which Gherkin does: https://cucumber.io/docs/gherkin/languages/
pytest-bdd-ng supports all localizations which
Gherkin does: https://cucumber.io/docs/gherkin/languages/

Scenario:
Given File "Localized.feature" with content:
Expand Down
6 changes: 4 additions & 2 deletions features/Scenario/Description.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Feature: Descriptions
Free-form descriptions can be placed underneath Feature, Example/Scenario, Background, Scenario Outline and Rule.
Free-form descriptions can be placed
underneath Feature, Example/Scenario, Background, Scenario Outline and Rule.
You can write anything you like, as long as no line starts with a keyword.
Descriptions can be in the form of Markdown - formatters including the official HTML formatter support this.
Descriptions can be in the form of Markdown - formatters including
the official HTML formatter support this.

Scenario:
Given File "Description.feature" with content:
Expand Down
20 changes: 16 additions & 4 deletions features/Step definition/Parameters/Conversion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Feature: Step definitions parameters conversion
| 1|

Rule: for anonymous groups
Step definitions parameters could not have a name, so we have to name them before conversion
Step definitions parameters could not have a name, so
we have to name them before conversion

Scenario:
Given File "conftest.py" with content:
Expand All @@ -42,7 +43,11 @@ Feature: Step definitions parameters conversion
class Item(Enum):
CUCUMBER = 'cucumber'
@given(parse(r"I have a (\w+)"), anonymous_group_names=('item',), converters=dict(item=Item))
@given(
parse(r"I have a (\w+)"),
anonymous_group_names=('item',),
converters=dict(item=Item)
)
def i_have_item(item):
assert item == Item.CUCUMBER
"""
Expand All @@ -60,12 +65,19 @@ Feature: Step definitions parameters conversion
from cucumber_expressions.expression import CucumberExpression
from cucumber_expressions.parameter_type_registry import ParameterTypeRegistry
parse = partial(CucumberExpression, parameter_type_registry = ParameterTypeRegistry())
parse = partial(
CucumberExpression,
parameter_type_registry = ParameterTypeRegistry()
)
class Item(Enum):
CUCUMBER = 'cucumber'
@given(parse(r"I have a {word}"), anonymous_group_names=('item',), converters=dict(item=Item))
@given(
parse(r"I have a {word}"),
anonymous_group_names=('item',),
converters=dict(item=Item)
)
def i_have_item(item):
assert item == Item.CUCUMBER
"""
Expand Down
6 changes: 5 additions & 1 deletion features/Step definition/Parameters/Defaults.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ Feature: Step definitions parameters could have default values
return [Freshness.FRESH, Freshness.ROTTEN, Freshness.FRESH, Freshness.SALTED]
@given("I have a pickle", param_defaults=dict(freshness=Freshness.SALTED))
@given(parse(r"I have a ((?P<freshness>\w+)\s)?cucumber"), converters=dict(freshness=Freshness), param_defaults=dict(freshness=Freshness.FRESH))
@given(
parse(r"I have a ((?P<freshness>\w+)\s)?cucumber"),
converters=dict(freshness=Freshness),
param_defaults=dict(freshness=Freshness.FRESH)
)
def i_have_cucumber(freshness, oracle_freshness):
assert freshness == oracle_freshness.pop(0)
"""
Expand Down
Loading

0 comments on commit ccf8206

Please sign in to comment.