-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add step to AfterStep #450
Comments
Hi @drekka, This sounds sensible. We're focussed on other things right now, so if you'd like this released soon I suggest you work on a pull request. We'll be happy to coach you. |
Hi Matt, I've cloned the cucumber repo and browsed through the code. But my knowledge of Ruby is holding me up. I currently know about enough to cause havoc and not much more :-) I could see several spots in the code where the AfterStep code is called and a scenario passed. But I could not figure out how this is initiated (essentially how the cucumber code works). The sticking point seems to be that various invokes pass the scenario as an argument which is then passed onto to other code which I cannot identify. My first thought was to add another parameter to the calls which contained the step (text?) or nil. But now I'm wondering if the argument should be some sort of class instance containing the "state" at that point in the story execution. This state would of course contain the scenario, current step and any other useful info. |
Hi @drekka, Thanks for looking into it. The best contribution you could make would be to fork the Cucumber repo and try to write a new scenario somewhere in Once you have a failing scenario, send it in a pull request and we can go from there. |
If (like me) you need this quickly, this seems to work. You may need to adjust it for Cucumber 2. AfterStep do |scenario|
step = scenario.steps.find { |s| s.status == :skipped }
if step.name.include?("I peel a banana")
# Do stuff!
end
end Note that step.name doesn't include Given/When/Then. This is stored in step.keyword. |
Sadly, @chewi's hack will not work on 2.0 as things stand. We will aim to support this properly through the API during the 2.0 series. I'll keep the ticket open. It would be awesome if someone wanted to start a PR with a failing test for this. |
I am also interested in this functionality. |
like to have this back too, as in 1.3.x |
If you're interested in this, please start with a failing scenario that describes what you want. |
@mattwynne, thanks for your reply... basically, I run cucumber test on jenkins, by default, the output flushed out to jenkins console after a scenario is finished. but I'd like to have the output send to jenkins console immediately,
after reading the cucuber-ruby code, seems,
I have this below in my env.rb
|
Hi @jdougit Try calling |
Just want to verify what I am seeing with Cucumber 2.1.0 is the same as what others see... Given I have an env.rb file with:
When I run a feature
|
@t-morgan I can verify the same behavior with Cucumber 2.1.0. |
Closed by 8b347ca |
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. |
We are using frank-cucumber to run tests against an iOS app. As this app is heavily animated we need to pause after each step to ensure the animations are finished. However there are a couple of steps where we do not want to pause. We have tried the AfterStep hook however we have a significant issue with it.
The issue is that it does not appear to be passed the text of the step. This makes it impossible to tell what step was being executed. It seems strange to us that an AfterStep hook would be created without being passed the step that was executed. Could we please have a version like this:
The text was updated successfully, but these errors were encountered: