Example #1
0
        public static ExtentTest CreateChild(ExtentReports extent, ExtentTest parentTest, string childName)
        {
            ExtentTest child = extent.StartTest(childName);

            parentTest.AppendChild(child);
            return(child);
        }
Example #2
0
        public ExtentTest CreateChild(ExtentTest parentTest, string childName)
        {
            ExtentTest child = Runner.Extent.StartTest(childName);

            parentTest.AppendChild(child);
            return(child);
        }
Example #3
0
 public static void testStepInfoEnd(String testDataSet)
 {
     child.Log(LogStatus.Info, "########### End of Test Case Data Set: " + testDataSet + " ###########");
     parent.AppendChild(child);
     currentStep = 0;
     log.Info("########### End of Test Case Data Set: " + testDataSet + " ###########");
 }
        public void StartTest(string testName)
        {
            ExtentTest parent     = null;
            var        parentText = "";

            if (_tests.Count > 1)
            {
                parent     = _tests.ToArray()[1];
                parentText = parent.Description + "-";
            }

            var test = _extent.StartTest($"{parentText}{testName}", $"{parentText}{testName}");

            parent?.AppendChild(test);

            _tests.Push(test);
        }
Example #5
0
        public static void AfterScenario(ScenarioContext scenarioContext)
        {
            //  string img = CommonTestRsltMethods.SaveScreenshot(CommonDriver.driver, "Report");

            //scenario.Log(scenario.GetCurrentStatus(), "Snapshot below: " + scenario.AddScreenCapture(img));

            if (scenarioContext.TestError == null)
            {
                scenario.Log(LogStatus.Pass, scenario.Description);
            }
            else if (scenarioContext.TestError != null)
            {
                scenario.Log(LogStatus.Fail, scenario.Description);
            }
            featureName.AppendChild(scenario);

            extent.EndTest(scenario);
        }