コード例 #1
0
        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();
        }
コード例 #2
0
 public static void TearDown()
 {
     UIEnvironment.DisposeWebDriver();
 }