Exemple #1
0
        /// <summary>

        /// Starts a tests set

        /// </summary>

        /// <param name="suiteName">the name of the set</param>

        public static void StartTestsSuite(string suiteName)

        {
            Test = null;

            SubTest = null;

            testsSuite = Extent.CreateTest(suiteName);
        }
 public static void AddTestMethodMetadataToReport(TestContext testContext)
 {
     CurrentTest = Extent.CreateTest(testContext.Test.Name);
     if (testContext.Test.Properties.ContainsKey("Category"))
     {
         var categories = testContext.Test.Properties["Category"];
         foreach (var category in categories)
         {
             CurrentTest.AssignCategory(category.ToString());
         }
     }
 }
Exemple #3
0
        /// <summary>

        /// Start a new test for the report, if there is no open suit the suit name will be as the test name

        /// </summary>

        /// <param name="testName">the name of the new test</param>

        public static void StartTest(string testName)

        {
            SubTest = null;

            if (testsSuite == null)
            {
                Test = Extent.CreateTest(testName);
            }

            //else

            Test = TestsSuite.CreateNode(testName);
        }
Exemple #4
0
 public static void AddTestMethodMetadataToReport(TestContext testContext, List <string> testCategories)
 {
     CurrentTest = Extent.CreateTest(testContext.TestName);
     if (testCategories.Any())
     {
         foreach (var category in testCategories)
         {
             CurrentTest.AssignCategory(category);
         }
     }
     else
     {
         return;
     }
 }
Exemple #5
0
        public void BeforeMethod()
        {
            test = Extent.CreateTest(TestContext.CurrentContext.Test.Name);
            // add other browsers if needed
            string browser = TestContext.Parameters.Get("browser", "chrome");

            switch (browser)
            {
            default:
            case "chrome":
            {
                StartChrome();
                break;
            }
            }
        }
        public void CreateFeature(string featureTitle, string description = "")
        {
            var feature = Extent.CreateTest <Feature>(featureTitle, description);

            Features.Add(featureTitle, feature);
        }
 public static void AddFeatureInfo(string title)
 {
     Feature = Extent.CreateTest <AventStack.ExtentReports.Gherkin.Model.Feature>(title);
 }
Exemple #8
0
 public void CreateTest(string testName)
 {
     Test = Extent.CreateTest(testName);
 }
Exemple #9
0
 public void TestInitialize()
 {
     ExtentTest = Extent.CreateTest(TestContext.CurrentContext.Test.ClassName + "." +
                                    TestContext.CurrentContext.Test.MethodName);
 }
Exemple #10
0
 public void BeforeTest()
 {
     Test = Extent.CreateTest(TestContext.CurrentContext.Test.Name);
     Test.Log(Status.Info, $"Test {TestContext.CurrentContext.Test.FullName} started.");
 }