Forum: RSpec [cucumber] screenshot upon exception

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
aidy lewis (Guest)
on 2008-12-22 22:48
(Received via mailing list)
Hi,

I am using Cucumber in combination with tests that drive the actual
browser.

Is there a place where I can easily trap an exception and take a
screenshot of the browser?

Regards

Aidy
Aslak H. (Guest)
on 2008-12-22 23:02
(Received via mailing list)
On Mon, Dec 22, 2008 at 9:46 PM, aidy lewis
<removed_email_address@domain.invalid>wrote:

> Hi,
>
> I am using Cucumber in combination with tests that drive the actual
> browser.
>
> Is there a place where I can easily trap an exception and take a
> screenshot of the browser?
>

http://github.com/aslakhellesoy/cucumber/wikis/hooks

Use AfterStep. Currently there is no easy way for the AfterStep block to
figure out whether a step failed or not though.
Existing tix:

http://rspec.lighthouseapp.com/projects/16211-cucu...
http://rspec.lighthouseapp.com/projects/16211/tick...

Aslak
aidy lewis (Guest)
on 2008-12-23 14:17
(Received via mailing list)
Hi Aslak,

Thanks for the heads-up, but it seems the AfterStep block is only
executed if a step passes and not if it fails, is pending, skipped or
non-implemented.

I tried to run a debugger on it to see what happens, but I think
Cucumber is opening another Ruby process and preventing me from
debugging.

Thanks

Aidy

2008/12/22 aslak hellesoy <removed_email_address@domain.invalid>:
Mischa F. (Guest)
on 2008-12-24 00:45
(Received via mailing list)
Hi,

I have not had any trouble opening the debugger in cucumber.

Then "debug" do
  debugger
  stop_here = 1
end

M
Aslak H. (Guest)
on 2008-12-24 01:59
(Received via mailing list)
On Tue, Dec 23, 2008 at 1:12 PM, aidy lewis
<removed_email_address@domain.invalid>wrote:

> Hi Aslak,
>
> Thanks for the heads-up, but it seems the AfterStep block is only
> executed if a step passes and not if it fails, is pending, skipped or
> non-implemented.
>
> I tried to run a debugger on it to see what happens, but I think
> Cucumber is opening another Ruby process and preventing me from
> debugging.
>

The Cucumber Rails task is forking a new Ruby process (just like the
Test::Unit and RSpec tasks).
Cucumber itself is not forking anything though.

Aslak
Tim W. (Guest)
on 2008-12-24 02:28
(Received via mailing list)
>> Cucumber itself is not forking anything though.

Sure it is, Cucumber is forking cool.

Tim

On Tue, Dec 23, 2008 at 4:49 PM, aslak hellesoy
This topic is locked and can not be replied to.