예제 #1
0
 public void SetUp()
 {
     SetConfiguration();
     TestWrapper(() =>
     {
         _webDriver = DriverSingleton.GetInstance();
         _webDriver.Manage().Window.Maximize();
         try
         {
             _webDriver.Navigate().GoToUrl(_mailServiceAddress);
             LoggerWrapper.LogInfo("E-Mail generator page was successfully opened!");
         }
         catch
         {
             LoggerWrapper.LogError("E-Mail generator page wasn't opened.");
             throw;
         }
         try
         {
             IJavaScriptExecutor js = (IJavaScriptExecutor)_webDriver;
             js.ExecuteScript("window.open();");
             LoggerWrapper.LogInfo("The new tab in browser was successfully opened!");
         }
         catch
         {
             LoggerWrapper.LogError("The new tab in browser wasn't opened.");
             throw;
         }
         try
         {
             _webDriver.SwitchTo().Window(_webDriver.WindowHandles.Last());
             _webDriver.Navigate().GoToUrl(_cloudServiceAddress);
             LoggerWrapper.LogInfo("Cloud service page was successfully opened!");
         }
         catch
         {
             LoggerWrapper.LogError("Cloud service page wasn't opened.");
             throw;
         }
     });
     WaitersWrapper.SetWaiter(_webDriver, TestContext.Parameters["WaitingTime"]);
 }