Пример #1
0
        /// <summary>
        /// Check the status of the test that is running. If it fails then it calls Listener class.
        /// </summary>
        public static void CheckStatus()
        {
            var status = TestContext.CurrentContext.Result.Outcome.Status;

            if (status == TestStatus.Failed)
            {
                var listener = new Listeners();
                var report   = TestContext.CurrentContext.Result;
                listener.OnTestEvent(TestContext.CurrentContext.Test.Name);
            }
        }
Пример #2
0
 public void MyTearDown()
 {
     try
     {
         var status = TestContext.CurrentContext.Result.Outcome.Status;
         if (status == TestStatus.Failed)
         {
             var listener = new Listeners();
             var report   = TestContext.CurrentContext.Result;
             listener.OnTestEvent(TestContext.CurrentContext.Test.Name);
         }
         Base.StopServer();
         GlobalVar.AndroidDriver.Close();
     }
     catch (Exception e)
     {
         //GlobalVar.AndroidDriver.Quit();
         Assert.Fail(e.Message);
     }
 }