コード例 #1
0
ファイル: TestRunner.cs プロジェクト: ograchikov/MailDriver
        /// <summary>
        ///     Simple test runner.
        /// </summary>
        /// <param name="config">Configuration.</param>
        public static void RunTests(Configuration config)
        {
            ITest baseTest = new BaseTest();
            try
            {
                var driver = new Driver(config.Get[Configuration.BrowserName],
                    int.Parse(config.Get[Configuration.ImplicitTimeout]));

                var test = new GmailTest(config, driver);
                test.SetUp();
                test.SendMailTest();
                baseTest = test;
            }
            catch (TestFailedException testFailedException)
            {
                Log.Info("Test failed. Reason: " + testFailedException.Message);
                return;
            }
            catch (Exception e)
            {
                Log.Info("Test failed. Reason: " + e.Message);
                Log.Fatal(e);
                return;
            }

            try
            {
                baseTest.TearDown();
            }
            catch (Exception tearDownException)
            {
                Log.Info("Error. Test runner tear down failed.");
                Log.Fatal(tearDownException);
            }
        }
コード例 #2
0
ファイル: QATrialTests.cs プロジェクト: tatiana14/OZ_Trial
 private bool StartAppAndTryLogin(Driver driver, out PageBase resultPage)
 {
     driver.Instance.Navigate().GoToUrl(HomepageUrl);
     var startPage = new StartPage(driver.Instance);
     var resultLogin = startPage.TryLoginAs(userData.UserName, userData.Password, out resultPage);
     return resultLogin;
 }