Ejemplo n.º 1
0
        public void MyScenarioCleanup()
        {
            try
            {
                // Clean up all connections and generate report
                var testFinalStatus = CheckTestCaseStatus();
                var message         = EnvironmentVariableHelper.GetBddStepDescription() +
                                      TestContext.CurrentContext.Result.Message;

                var stackTrace = TestContext.CurrentContext.Result.StackTrace;

                TestCaseProvider.Instance
                .LogTestCaseFinalStatus(testFinalStatus, message, stackTrace,
                                        TestCaseInfo.TestCaseFullName, TestCaseInfo.TestCaseName);

                BaseTestManagerClass.MyTestCleanupClose();
                ProcessManager.KillProcess("chrome");
            }
            catch (Exception e)
            {
                // Clean up all connections and generate report
                BaseTestManagerClass.MyTestCleanupClose();

                //Kill chrome driver
                ProcessManager.KillProcess("chromedriver");
                ProcessManager.KillProcess("chrome");

                ExceptionManager.WarningMessageLog(e.Message);
            }
        }
Ejemplo n.º 2
0
        public void MyScenarioInitialize()
        {
            // Create Results Folders
            Util.CreateFolder(ConfigurationVariable.TestCaseResultsPath);
            Util.CreateFolder(ConfigurationVariable.TestCaseResultsImageVideoPath);

            TestCaseInfo.TestCaseName        = scenarioContext.ScenarioInfo.Title;
            TestCaseInfo.TestCaseFullName    = scenarioContext.ScenarioInfo.Title;
            TestCaseInfo.TestCaseDescription = scenarioContext.ScenarioInfo.Description;


            //TC Folder Name
            var tcFolder = Path.Combine(ConfigurationVariable.TestCaseResultsImageVideoPath, TestCaseInfo.TestCaseName);

            Util.SaveCurrentTc(TestCaseInfo.TestCaseName);
            Util.CreateFolder(tcFolder);
            TestCaseProvider.Instance.AddNewTestCase(TestCaseInfo.TestCaseName, TestCaseInfo.TestCaseDescription);
            BaseTestManagerClass.MyTestInitializeConnection();
        }