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

Fix broken Before and After functions #388

Closed
1 of 3 tasks
delatrie opened this issue Oct 3, 2023 · 0 comments · Fixed by #393
Closed
1 of 3 tasks

Fix broken Before and After functions #388

delatrie opened this issue Oct 3, 2023 · 0 comments · Fixed by #393
Assignees

Comments

@delatrie
Copy link
Contributor

delatrie commented Oct 3, 2023

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Since #371 fixture and step contexts are separated. That means StopStep can't be used to stop a fixture context as it was before. But Before and After methods (all overloads) are leveraging the private Execute method that uses StopStep under the hood.

This should be fixed as the current behavior will break everyone who uses CoreStepsHelper.Before and CoreStepsHelper.After.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Run any overload of CoreStepsHeler.Before or CoreStepsHelper.After. An unexpected exception is thrown saying "No step context exists".

What is the expected behavior?

No exception is thrown (given an underlying action doesn't produce one). A corresponding fixture correctly created in the current container.

What is the motivation / use case for changing the behavior?

Fix unintended behavior left by #371.

Please tell us about your environment:

  • Version: 2.10.0-preview.1
  • Branch: preview
@delatrie delatrie self-assigned this Oct 3, 2023
@delatrie delatrie changed the title Before and After functions are broken Fix broken Before and After functions Oct 3, 2023
delatrie added a commit that referenced this issue Oct 3, 2023
  - make async Step, Before and After obey .NET's ExecutionContext capturing rules
  - refactor CoreStepsHelper to be more testable
  - write tests for CoreStepsHelper's Step, Before and After

More tests are needed to fully cover CoreStepsHelper.

Fixes #383
Fixed #388
delatrie added a commit that referenced this issue Oct 10, 2023
  - make async Step, Before and After obey .NET's ExecutionContext capturing rules
  - refactor CoreStepsHelper to be more testable
  - write tests for CoreStepsHelper's Step, Before and After

More tests are needed to fully cover CoreStepsHelper.

Fixes #383
Fixed #388
@delatrie delatrie linked a pull request Oct 10, 2023 that will close this issue
2 tasks
neparij pushed a commit that referenced this issue Oct 11, 2023
* allure-xunit: provide default config when allureConfig.json is missing

Fixes #381

* Fix async step/fixture wrapper functions

  - make async Step, Before and After obey .NET's ExecutionContext capturing rules
  - refactor CoreStepsHelper to be more testable
  - write tests for CoreStepsHelper's Step, Before and After

More tests are needed to fully cover CoreStepsHelper.

Fixes #383
Fixed #388

* Add async suffix to private step methods

This helps to make distinction more clear to a reader.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant