Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions behave2cucumber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ def format_level(tree, index=0, id_counter=0):
# Option to remove background element because behave pushes it steps to all scenarios already
if remove_background:
for feature in json_file:
if not feature.get('elements'):
continue

if not len(feature.get('elements')) > 0:
continue

if not feature.get('elements')[0].get('type'):
continue

if feature['elements'][0]['type'] == 'background':
feature['elements'].pop(0)

Expand Down