pytest-dev / pytest-bdd

BDD library for the pytest runner
https://pytest-bdd.readthedocs.io/en/latest/
MIT License
1.3k stars 218 forks source link

--gherkin-terminal-reporter doesn't color steps correctly #214

Open akrejczinger opened 7 years ago

akrejczinger commented 7 years ago

The gherkin terminal reporter doesn't color the steps correctly.

Let's say I have the following feature with a broken step:

Scenario: Publishing the article
    Given I'm an author user
    And I have an article
    When I go to the article page  # This step is broken
    And I press the publish button
    Then I should not see the error message
    And the article should be published

I expect the output to look like this (the first word in each line is the colouring):

RED:   Scenario: Publishing the article
GREEN:     Given I'm an author user
GREEN:     And I have an article
RED:       When I go to the article page  # This step is broken
RED:       And I press the publish button
RED:       Then I should not see the error message
RED:       And the article should be published
RED:   FAILED

But instead I get an output with all lines in red. Printing the steps after the failed one is optional.

moorchegue commented 1 year ago

This would be a great usability boost. Please merge either one of the fixes?