Ejemplo n.º 1
0
        private void LogToExtentReport()
        {
            var fileName = $"{TestContext.TestName}_{DateTime.Now:h_mm_ss}.png";

            if (TestContext.CurrentTestOutcome == UnitTestOutcome.Passed)
            {
                ExtentTestManager.GetTest().Pass("Test Passed");
            }
            else
            {
                var mediaEntity = ExtentService.CaptureScreenShot(fileName);
                ExtentTestManager.GetTest().Fail("Test Failed", mediaEntity);
                ExtentTestManager.GetStep().Fail("Step Failed", mediaEntity);
            }
        }
Ejemplo n.º 2
0
 public static void BeforeAll(TestContext context)
 {
     ExtentService.InitializeExtentReport(CurrentDirectory);
 }