Beispiel #1
0
        public void TearDown()
        {
            string currentExecutionTime = DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH'-'mm'-'ss");
            string screenshotFileName   = $"{currentProjectDirectory}/screenshots/test-{currentExecutionTime}.jpeg";

            if (TestContext.CurrentContext.Result.Outcome == ResultState.Failure)
            {
                extentReportUtils.addTestLog(Status.Fail, "One or more step failed");
                screenshot.CaptureAndSaveScreenshot(screenshotFileName);
                extentReportUtils.addScreenshot(screenshotFileName);
            }
            CmdDriver.CloseAllBrowser();
        }