0

with Selenium Behave Python,

Is possible to force and reset the status of a scenario as skipped or untested if a step on it fails?

I know I can skip a scenario with @Skip tag, but I need to run the scenario and check, if one step fails I would like to have in the report that this scenario is skipped or Untested or something else but not as Failed or Passed.

example:
Feature test
 Scenario: test something
        Given the situation A
        When the user presses the button
        Then the page show something
        And something else should happen
 
@then('the page show something')
  def step_page_show_something(context):
      try:
         do something
         #here the step can fail
      except:
          # if I use 'pass' the test will be Pass
          # if I use an exception if will Failed
          # there is any way to skip or set it as Untested or something else but not Failed and not Passed

Thanks for all the tips.

Angelotti
  • 673
  • 1
  • 6
  • 20

1 Answers1

0

The only solution that I found was exactly in the post Skip a behave step in the step implementation

On my

def step_page_show_something(context):
      try:
         do something
         #here the step can fail
      except:
         context.scenario.skip()
Angelotti
  • 673
  • 1
  • 6
  • 20