Provides a tag-expression parser and evaluation logic for cucumber/behave
Actively maintained. Last release 2 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install cucumber-tag-expressions
Cucumber Tag Expressions
Readable boolean expressions to select features and scenarios marked with tags in Gherkin
# -- SIMPLE TAG-EXPRESSION EXAMPLES:
@a and @b
@a or @b
not @a
# -- MORE TAG-EXPRESSION EXAMPLES:
@a and not @b
(@a or @b) and not @c
Getting Started
Cucumber Tag Expressions is available as cucumber-tag-expressions on PyPI.
pip install cucumber-tag-expressions
Parse tag expressions and evaluate them against a set of tags.
>>> from cucumber_tag_expressions import parse
# Tagged with @fast
>>> fast = parse("@fast")
>>> fast({"@fast", "@wip"})
True
>>> fast({"@performance", "@slow"})
False
# Tagged with @wip and not @slow
>>> wip_not_slow = parse("@wip and not @slow")
>>> wip_not_slow({"@wip", "@home"})
True
>>> wip_not_slow({"wet", "warm", "raining"})
False
# Tagged with both `@fast` and `@integration`
>>> fast_integration = parse("@integration and @fast")
>>> fast_integration({"@integration", "@fast", "@other"})
True
>>> fast_integration({"@system", "@fast"})
False
# Tagged with either @login or @registration
>>> auth_pages = parse("@login or @registration")
>>> auth_pages({"@account", "@login"})
True
>>> auth_pages({"@admin", "@account"})
False