After hook is being executed globally, when it shouldn't (?) #4070
Unanswered
clundstedt-m
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As of now we are having issues understanding how the After hook works, since we have 2 .steps.files, one being the common.steps.ts and other called home.steps.ts in which we have an After hook defined that simply waits for (5) seconds after each of the steps is executed.
Now if we run some tests that involve steps JUST from common_steps.ts and nothing from the home.steps.ts (where we have the After hook), the hook itself is being executed as if it were part of the first mentioned here, or more likely seemingly being executed globally as if it were defined in some kind of Global.steps.ts or something like that which is not the case.
Are we kinda getting the overall usage of the After hook? or it is intended that every After hook defined in any .steps file or any other test related script will be executed in each and every test from that point onward?
My home.steps.ts file looks something like this:
And my common_steps, looks like this:
And finally my test .feature file looks like this:
And with this, even though no single step from the home.steps.ts is being used, the after hook for 5s is still being executed, which seems kinda off.
Hope that I was clear enough with my question and hopefully someone can shed some light on us about this behavior to know how to re-route our efforts having that in mind.
Best Regards and thanks!
Beta Was this translation helpful? Give feedback.
All reactions