1

Context: I am using Python with Behave (BDD). My .feature file look like this:

@ISA-75 
@ISA-76
@1
@1.1
Scenario: A user will be able to enter an email address to receive a notification when a requested archive is complete.
  Given ...
  When ...
  Then ...

The output of the run doesn`t contain the @1 or @1.1 information. There is any way to tell behave to print out that information at run time?

Cynic
  • 6,779
  • 2
  • 30
  • 49
cosminP
  • 56
  • 9

1 Answers1

2

It kind of depends on how you are making your assertions. But you can implement it from info found in their docs. I set a behave.ini as described here so print appears and then added this to environment.py file.

def after_scenario(context, scenario):
    if context.failed == True:
        print(context.scenario, 'failed. Here are the tags:')
        for tag in context.tags:
            print(tag)

You might just way to use a try/catch on your assertion and run the last lines on exception.

Cynic
  • 6,779
  • 2
  • 30
  • 49