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

Would it be useful to have @BeforeStep and @AfterStep hooks? #273

Closed
janschaefer opened this issue Dec 25, 2016 · 2 comments
Closed

Would it be useful to have @BeforeStep and @AfterStep hooks? #273

janschaefer opened this issue Dec 25, 2016 · 2 comments

Comments

@janschaefer
Copy link
Contributor

janschaefer commented Dec 25, 2016

Currently it is not easily possible to do an action before every step or after every step. Would you think that it make sense to introduce such life-cycle hooks? One example use case would be to take a screenshot after every step, for example.
As an alternative we could also introduce a listener interface that is attached to the stage. Something like:

@StepListener( MyStepListener.class )
public class MyStage {
} 

public class MyStepListener implements StepListener {
     public void before(CurrentStep currentStep) { 
         ....
     }
     public void after(CurrentStep currentStep) {
         ....
     }
}
@janschaefer
Copy link
Contributor Author

Duplicate of #328

@janschaefer janschaefer marked this as a duplicate of #328 May 20, 2018
@janschaefer janschaefer removed this from the Backlog / Unplanned milestone Sep 2, 2019
@ahus1
Copy link
Contributor

ahus1 commented Nov 1, 2019

As a workaround for the missing @AfterStep I started to override the self() method assuming that I call it at the end of each step.

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

No branches or pull requests

2 participants