예제 #1
0
        public static void GenerateReport(string testName)
        {
            var status       = TestContext.CurrentContext.Result.Outcome.Status;
            var stackTrace   = "<pre>" + TestContext.CurrentContext.Result.StackTrace + "</pre>";
            var errorMessage = TestContext.CurrentContext.Result.Message;

            if (status == TestStatus.Failed)
            {
                string ScreenshotPath = ScreenShotUtility.GetScreenshot(testName);
                test.Log(LogStatus.Fail, stackTrace + errorMessage);
                test.Log(LogStatus.Fail, "Error Screenshot Below: " + test.AddScreenCapture(ScreenshotPath));
            }
            extent.EndTest(test);
            LoggerUtility.WriteLog("<Info: Closing the Vision Store Application>");
            LoggerUtility.WriteLog("<Info: Ending the Test : " + testName + ">");
            LoggerUtility.WriteLog("--------------------------------------------------------------");
            LoggerUtility.WriteLog("");
        }
예제 #2
0
        public void CloseAllChildWindows()
        {
            LoggerUtility.WriteLog("<Info: Closing The Child Windows Method>");
            List <Window> wChildWindows = wVStoreMainWindow.ModalWindows();

            LoggerUtility.WriteLog("dsda" + wChildWindows);

            if (wChildWindows != null)
            {
                LoggerUtility.WriteLog("The Value is Not Equal To Null" + wChildWindows);
            }
            {
                foreach (Window ChildWindow in wChildWindows)
                {
                    LoggerUtility.WriteLog("The Current Child Window Is " + ChildWindow.Title);
                    ChildWindow.Close();
                }
            }
        }
예제 #3
0
 /// <summary>
 /// Base method to close the Vision Store Application
 /// </summary>
 public void AppExit()
 {
     try
     {
         if (VStoreApp != null)
         {
             VStoreApp.Kill();
         }
         else if (wVStoreMainWindow != null && wVStoreMainWindow.Visible.Equals(true))
         {
             wVStoreMainWindow.Focus();
             wVStoreMainWindow.Close();
             wVStoreMainWindow.WaitWhileBusy();
         }
     }
     catch (Exception Ex)
     {
         LoggerUtility.WriteLog("Application Error" + CommonData.PROG_NAME + " Not Found / Cannot Be Closed");
         throw;
     }
     Thread.Sleep(5000);
 }
예제 #4
0
        /// <summary>
        /// Base method to trigger the Vision Store Application
        /// </summary>
        public void Init()
        {
            var processInfo = new ProcessStartInfo(CommonData.PROG_PATH);

            VStoreApp = Application.AttachOrLaunch(processInfo);
            VStoreApp.WaitWhileBusy();
            Thread.Sleep(CommonData.iLoadingTime);

            LoggerUtility.WriteLog("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
            wVStoreMainWindow = VStoreApp.GetWindow(CommonData.PROG_NAME, InitializeOption.NoCache);
            VStoreApp.WaitWhileBusy();

            if (wVStoreMainWindow.Title.ToString() == CommonData.PROG_NAME)
            {
                LoggerUtility.WriteLog("<Info: Launching the " + CommonData.PROG_NAME + " Application>");
                VStoreApp.WaitWhileBusy();
            }
            else
            {
                Assert.Fail("Application Error:" + CommonData.PROG_NAME + "Failed to Launch");
            }
            Thread.Sleep(CommonData.iLoadingTime);
        }
예제 #5
0
 public static void StartTest(string TestCaseName)
 {
     test = extent.StartTest(TestCaseName);
     LoggerUtility.WriteLog("<Info: TESTCASE NAME - " + TestCaseName + ">");
 }