Beispiel #1
0
        /// <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);
            }
        }
Beispiel #2
0
 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;
 }