0

I'm trying to implement a Feature scenario outline, something similar to below:

Feature: Scenario outlines
    Scenario Outline: Outlined given, when, then
        Given there are <start> cucumbers
        Given there are <start> apples
        When I eat <eat> cucumbers
        When I eat <eat> apples
        Then I should have <left_c> cucumbers
        Then I should have <left_a> apples

        Examples:
        | start | eat | left_c | left_a |
        |  12   |  5  |  4     | 7      |

Here I should have <left_c> cucumbers will fail and the execution will stop without considering the second step. Is there a way to execute the remaining steps even if some steps fail in pytest bdd?

Jurgen Strydom
  • 3,540
  • 1
  • 23
  • 30

1 Answers1

0

May be you just need to define the code implementation of "I should have <left_c> cucumbers" with a verification instead of assert. The verification can be caught in the report.html to view the failure reason. At the same time, the code will continue to execute the next "Then" statement as well without any issues. Since the code implementation is not added in the question, can't help further.

Arun Sasi
  • 316
  • 5
  • 15