Discussion:
ExceptionMethod Attribute
Daaron Dwyer
2008-08-29 12:46:12 UTC
Permalink
Hello All,
Is there an attribute I can set on the test or fixture level indicating a
method to run when a test fails?
I'd like to grab a screenshot before the teardown.

Thanks!
Daaron
Charlie Poole
2008-08-29 17:36:36 UTC
Permalink
Currently, no. There are several feature requests for enabling special
processing when a
test fails, so we'll probably have one eventually. For this special case,
I'm wondering if
taking a screen shot could be part of the assert itself.

As a workaround, the best you can currently do is to use a boolean ranOK
flag. Set
it false in SetUp and true at the end of each test. Take your screenshot in
teardown.

Charlie


_____

From: nunit-developer-***@lists.sourceforge.net
[mailto:nunit-developer-***@lists.sourceforge.net] On Behalf Of Daaron
Dwyer
Sent: Friday, August 29, 2008 5:46 AM
To: nunit-***@lists.sourceforge.net
Subject: [nunit-developer] ExceptionMethod Attribute


Hello All,
Is there an attribute I can set on the test or fixture level indicating a
method to run when a test fails?
I'd like to grab a screenshot before the teardown.

Thanks!
Daaron

Loading...