Beispiel #1
0
 public void Dispose()
 {
     if (_app != null)
     {
         _app.Close();
     }
 }
Beispiel #2
0
 public void TestCleanup()
 {
     if (testContextInstance.CurrentTestOutcome != UnitTestOutcome.Passed)
     {
         testApp.Close();
     }
 }
Beispiel #3
0
 public void TestCleanup()
 {
     // If test failed, then close the app. The next test will restart it
     if (testContextInstance.CurrentTestOutcome != UnitTestOutcome.Passed)
     {
         testApp.Close();
     }
 }
Beispiel #4
0
        public static void ClassCleanup()
        {
            // Close the app after all tests are finished
            Playback.Initialize();
            try
            {
                Process[] processes = Process.GetProcessesByName(TestProcess);

                foreach (Process process in processes)
                {
                    ApplicationUnderTest app = ApplicationUnderTest.FromProcess(process);
                    app.Close();
                }
            }
            finally
            {
                Playback.Cleanup();
            }
        }
Beispiel #5
0
        /// <summary>
        /// 关闭测试用的UI进程
        /// </summary>
        public void CloseApp(ApplicationUnderTest app)
        {
            try
            {
                app.Close();
            }
            catch
            {

            }
            if (!app.WaitForControlNotExist(5000))
            {
                try
                {
                    app.Process.Kill();
                }
                catch
                {

                }
            }
        }
        /// <summary>
        /// Dispose the dependent objects of data import job
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                Playback.PlaybackError -= OnPlaybackError;

                if (!ReuseExistingApplicationUnderTest)
                {
                    if (_applicationUnderTest != null)
                    {
                        _applicationUnderTest.Close();
                        _applicationUnderTest.Dispose();
                    }
                    else if (ApplicationUnderTestProcess != null)
                    {
                        ApplicationUnderTestProcess.CloseAllInstances();
                    }
                }

                _applicationUnderTest       = null;
                ApplicationUnderTestProcess = null;
            }
        }
 /// <summary>
 /// Cleans up.
 /// </summary>
 public static void CleanUp()
 {
     _cache.Clear();
     _root = null;
     _aut.Close();
 }
 public void MyTestCleanup()
 {
     App.Close();
 }
Beispiel #9
0
 public void MyTestCleanup()
 {
     _uut.Close();
 }
Beispiel #10
0
 public void MyTestCleanup()
 {
     // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
     _app.Close();
 }
Beispiel #11
0
 public void MyTestCleanup()
 {
     appToTest.Close();
 }
Beispiel #12
0
 public void MyTestCleanup()
 {
     test.Close();
 }
Beispiel #13
0
 public void AfterScenario()
 {
     //TODO: implement logic that has to run after executing each scenario
     _app.Close();
 }
Beispiel #14
0
 public void MyTestCleanup()
 {
     calc_.Close();
 }