Ejemplo n.º 1
0
        /// <summary>
        /// Method to get the AppState Value as an Integer in between the Braces []
        /// </summary>
        /// <returns></returns>
        public int tet()
        {
            Label  AppState         = GetLabel(wVStoreMainWindow, AppConstants.APPSTATE_LABEL_ID);
            string sCurrentAppState = AppState.Text.Split('[', ']')[1];
            int    iAppStateValue   = Int32.Parse(sCurrentAppState);

            LoggerUtility.StatusInfo("The State Of The Application Is" + iAppStateValue + "");
            return(iAppStateValue);
        }
Ejemplo n.º 2
0
        public static void GenerateReport(string testName)
        {
            var status       = TestContext.CurrentContext.Result.Outcome.Status;
            var stackTrace   = "&lt;pre&gt;" + TestContext.CurrentContext.Result.StackTrace + "&lt;/pre&gt;";
            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("");
        }
Ejemplo n.º 3
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();
                }
            }
        }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
 public static void StartTest(string TestCaseName)
 {
     test = extent.StartTest(TestCaseName);
     LoggerUtility.WriteLog("<Info: TESTCASE NAME - " + TestCaseName + ">");
 }