Created
September 24, 2013 17:59
-
-
Save DylanLacey/6688784 to your computer and use it in GitHub Desktop.
Hijacking the "Pretty" formatter to tag individual actions for Sauce with the step being executed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "cucumber/formatter/pretty" | |
module Sauce | |
class SauceFormatter < Cucumber::Formatter::Pretty | |
def initialize(step_mother, io, options) | |
super | |
end | |
def before_step(step) | |
message = "Cucumber step -- #{step.name}" | |
::Capybara.current_session.execute_script("sauce:context=#{message}") | |
super | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, sweet, thanks for putting the usage instructions!