Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenario Outlines do not inherit Feature context #408

Open
edaine opened this issue Oct 7, 2020 · 0 comments
Open

Scenario Outlines do not inherit Feature context #408

edaine opened this issue Oct 7, 2020 · 0 comments

Comments

@edaine
Copy link

edaine commented Oct 7, 2020

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

[x] I have read the contributing guide lines at https://github.com/radish-bdd/radish/blob/master/.github/CONTRIBUTING.md

[x] I have read and respect the code of conduct at https://github.com/radish-bdd/radish/blob/master/.github/CODE_OF_CONDUCT.md

[x] I have searched the existing issues and I'm convinced that mine is new.

Describe the bug
It seems that the Feature Context is not inherited with implementing steps using Scenario Outline but I cannot trace the cause.

Environment and Version

  • OS (incl. terminal and shell used): Windows 10 Enterprise Build 17763, VS Code Integrated Terminal (bash)
  • Python Version: Python 3.8.3
  • radish Version (radish --version): 0.13.2

To Reproduce
I have the following code in terrain.py:

@before.each_feature()
def initialize(feature):
    feature.context.index = 0

In one of the steps implementation, when step.parent.parent.context is invoked:

camera_index=step.parent.parent.context.index

I get the error:

AttributeError: 'Context' object has no attribute 'index'

I tried to print out the following:

print(step.context.__dict__)
print(step.parent.context.__dict__)
print(step.parent.parent.context.__dict__) 

And it yielded these:

{'constants': []}
{'constants': []}
{'constants': []}

Again, I only encounter this when the Scenario uses Scenario Outline and the parent contexts are accessed within the step implementation.

Expected behavior
Contexts created in the Terrain can be normally accessed even if the Scenario is defined as "Scenario Outline".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant