-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cucumber-spring with @Configuration class fail with @Scope("cucumber-glue") #965
Comments
I have also encountered this issue. Is there a work-around? |
Yes there is.
However, you can't do it directly since GlueCodeScope is package visible. Then in your glue code, you must use that configuration in addition to your own. The pull request i made does exactly this, except your don't have to add it manually to your config, it's done magically with ASM. I think it's a bad thing, but haven't found another way doing it; except maybe modifying something else directly in spring. |
Thank you, @JSlain! Your work-around make the cucumber-glue scope available across my test support classes. For people looking for an answer in the future, the way I was able to tell that this was working was the following message from DefaultListableBeanFactory in my logs: Using the work-around, I’m running into an issue where each class that uses |
I've also followed this, trying to use it to open up a new webdriver instance for each scenario. I'm also seeing where you get a new instance for each autowired. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
They way the cucumber-glue scope get registered won't work when you're using some of these scoped components in your non-scoped components declared in your configuration.
For example:
This is because the way the scope currently get registered, we need the ApplicationContext to add the scope into it.
The text was updated successfully, but these errors were encountered: