Skip to content

Commit

Permalink
fix: fix dynamic environment behaviour in after scenario/feature actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rgonalo committed Apr 24, 2020
1 parent 7fcf63d commit fc24324
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -9,6 +9,7 @@ v1.6.2.dev0
- Fix to allow step's text (context.text) declaration into dynamic environment sections
- Add `ssl` config property in [Server] section to allow using https in Selenium Grid url
- Visual testing comparison must fail when baseline does not exist and save mode is disabled
- Fix dynamic environment behaviour, after scenario/feature actions are executed when before scenario/feature actions fail

v1.6.1
------
Expand Down
7 changes: 3 additions & 4 deletions toolium/behave/env_utils.py
Expand Up @@ -261,7 +261,7 @@ def execute_after_scenario_steps(self, context):
actions after each scenario
:param context: It’s a clever place where you and behave can store information to share around, automatically managed by behave.
"""
if not self.feature_error and not self.scenario_error:
if not self.feature_error:
self.__execute_steps_by_action(context, ACTIONS_AFTER_SCENARIO)

# Behave dynamic environment: Fail all steps if dyn_env has got any error and reset it
Expand All @@ -274,8 +274,7 @@ def execute_after_feature_steps(self, context):
actions after the feature
:param context: It’s a clever place where you and behave can store information to share around, automatically managed by behave.
"""
if not self.feature_error:
self.__execute_steps_by_action(context, ACTIONS_AFTER_FEATURE)
self.__execute_steps_by_action(context, ACTIONS_AFTER_FEATURE)

# Behave dynamic environment: Fail all steps if dyn_env has got any error and reset it
if self.reset_error_status():
Expand Down Expand Up @@ -303,4 +302,4 @@ def fail_first_step_precondition_exception(self, scenario):

scenario.steps[0].status = status
scenario.steps[0].exception = Exception("Preconditions failed")
scenario.steps[0].error_message = self.error_exception.message
scenario.steps[0].error_message = str(self.error_exception)

0 comments on commit fc24324

Please sign in to comment.