Example #1
0
        public void TestInitialize()
        {
            if (TestContext.Properties.Contains("browser"))
            {
                browser = TestContext.Properties["browser"].ToString();
            }

            if (TestContext.Properties.Contains("environment"))
            {
                environment = TestContext.Properties["environment"].ToString();
            }

            if (TestContext.Properties.Contains("teamBinderVersion"))
            {
                teamBinderVersion = TestContext.Properties["teamBinderVersion"].ToString();
            }

            if (TestContext.Properties.Contains("excelUserSourcePath"))
            {
                excelUserSourcePath = TestContext.Properties["excelUserSourcePath"].ToString();
            }

            if (TestContext.Properties.Contains("localTempExcelUserTargetPath"))
            {
                localTempExcelUserTargetPath = TestContext.Properties["localTempExcelUserTargetPath"].ToString();
            }

            if (TestContext.Properties.Contains("headless"))
            {
                Browser.Headless = bool.Parse(TestContext.Properties["headless"].ToString());
            }

            if (!System.IO.Directory.Exists(captureLocation))

            {
                Directory.CreateDirectory(captureLocation);
            }

            string report = Utils.GetRandomValue(TestContext.TestName);

            reportPath = captureLocation + report + ".html";
            extent     = ExtentReportsHelper.CreateReport(reportPath, TestContext.TestName);
            extent.AddSystemInfo("Environment", TestContext.Properties["environment"].ToString());
            extent.AddSystemInfo("Browser", TestContext.Properties["browser"].ToString());
            test = ExtentReportsHelper.LogTest("Pre-condition");
        }