public static void ScreenshotIfErrored() { if (ScenarioContext.Current.TestError != null) { var featureTitle = FeatureContext.Current.FeatureInfo.Title; var scenarioTitle = ScenarioContext.Current.ScenarioInfo.Title; var screenshot = UIEnvironment.WebDriverAs <ITakesScreenshot>().GetScreenshot(); screenshot.SaveAsFile(GetScreenshotPath(featureTitle, scenarioTitle), ImageFormat.Png); } UIEnvironment.WebDriver .Manage() .Cookies .DeleteAllCookies(); }
public static void TearDown() { UIEnvironment.DisposeWebDriver(); }