radish-bdd / radish

Behavior Driven Development tooling for Python. The root from red to green.
https://radish-bdd.github.io
MIT License
181 stars 49 forks source link

Not able to run features with tag expressions with AND operator in Windows10 #365

Closed vrbcntrl closed 5 years ago

vrbcntrl commented 5 years ago

Hi, I am trying to run my features with tag expressions, but throws me an error

radish command: D:\radish-bdd\training>radish --write-steps-once features/ --basedir=D:\radish-bdd\training\radish --tags="addition and subtraction"

Feature

 @addition
    Scenario: Addition
        Given I have the numbers 5 and 6
        When I sum them
        Then I expect the result to be 11

    @subtraction
    Scenario: Subtraction
        Given I have the numbers 6 and 5
        When I subtract them
        Then I expect the result to be 1

error

Error: No feature or no scenario specified in at least one of the given feature files
You have specified a tag expression. Make sure those are valid and actually yield some Scenarios to run.

However the command works fine if I only pass one tag with out the and operator. Has any one seen this error before or know how to test multiple tags with and operator?

Thanks in advance!

timofurrer commented 5 years ago

That's actually the correct behavior. The tag filters always apply to single Scenarios (which inherit the Tags from the Feature) - so an and in the tag filter means a Scenario which has the tag X and the tag Y. In your case it would match a Scenario with the tags @subtraction and @addition like:

@addition
@subtraction
Scenario: some test case ...
    Given ...
    When ....
    Then ....

I guess what you are looking for is the or-operator meaning: *a Scenario which has the tag X or the tag Y`.

vrbcntrl commented 5 years ago

Thanks for the quick response @timofurrer

Yes, the or operator is what I was looking for.