Is currently a way to add a upon failure hook? I’d like to make it so
that,
in the event of a failed assertion, Webrat will take the last requested
page
and open it in a browser.
Thanks
Tim
Is currently a way to add a upon failure hook? I’d like to make it so
that,
in the event of a failed assertion, Webrat will take the last requested
page
and open it in a browser.
Thanks
Tim
2009/4/2 Tim H. [email protected]
Is currently a way to add a upon failure hook? I’d like to make it so
that, in the event of a failed assertion, Webrat will take the last
requested page and open it in a browser.
http://wiki.github.com/aslakhellesoy/cucumber/hooks
After do |scenario|
end
Please open a ticket for this if you really need it.
Aslak
Hi Tim,
I have used a custom formatter, if this is any help
class ExceptionFormatter < Cucumber::Ast::Visitor
def initialize(step_mother, io, options)
super(step_mother)
end
def visit_feature_name(name)
if name =~ /Feature:\s(.*)/i
@name = $1
else
@name = name
end
end
def visit_exception(exception, status)
exception_file = “#{File.dirname(FILE)}/#{@name}.html”
open(exception_file, ‘w’) { |f| f << browser.html }
end
end
Aidy
Aidy,
This is a great work around, being disadvantaged only by having to
specify a
different formatter
Still, a general purpose way of hooking in to the after feature fail
would
be premium. Thanks for opening the ticket.
Tim
aslak hellesoy wrote:
|After do |scenario|
currently no simple way to query scenario for status though
end
|
Please open a ticket for this if you really need it.Aslak
Convo has been moved to LH:
-Ben
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs