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

Is it currently possible to run before/after hooks per step? Something like config.before(:step)? #231

Open
mileslane opened this issue Jul 25, 2020 · 0 comments

Comments

@mileslane
Copy link

I'd like to be able to accomplish what I have in my spinach tests:

Spinach.hooks.before_step do
  $starting_step = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end

Spinach.hooks.after_step do
  ending_step = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  elapsed_step = ending_step - $starting_step
  puts "       Elapsed step time: #{elapsed_step.truncate(1)} seconds" if elapsed_step >= 10
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant