Skip to content

Instantly share code, notes, and snippets.

@marcusoftnet
Created March 25, 2011 14:41
Show Gist options
  • Save marcusoftnet/886936 to your computer and use it in GitHub Desktop.
Save marcusoftnet/886936 to your computer and use it in GitHub Desktop.
Here i'm using MvcContrib.Watin testhelper together with the SpecFlow hook for AfterScenario to capture a screen shot on each failing tests, naming the
using Specs.EndToEnd.Helpers;
using TechTalk.SpecFlow;
namespace Specs.EndToEnd
{
[Binding]
public class SpecFlowHooks
{
[AfterScenario]
public void AfterScenario()
{
if(ScenarioContext.Current.TestError != null)
{
WebBrowser.Driver.CaptureScreenShot(ScenarioContext.Current.ScenarioInfo.Title);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment