Example #1
0
 public void StopBrowser()
 {
     if (TestContext.CurrentContext.Result.Outcome != ResultState.Success)
     {
         CreatorOfScreenshot.TakeScreenshot();
     }
     DriverSingleton.CloseDriver();
 }
Example #2
0
 public void OpenBrowserAndGoToSite()
 {
     Logger.InitLogger();
     Logger.Log.Warn("Driver initializing...");
     webDriver = DriverSingleton.GetDriver();
     webDriver.Navigate().GoToUrl(url);
     Logger.Log.Info("Driver initialized.");
 }
        public static void TakeScreenshot()
        {
            ITakesScreenshot screenshot = ((ITakesScreenshot)DriverSingleton.GetDriver());
            DirectoryInfo    directory  = Directory.CreateDirectory(@"Screenshots\" + DateTime.Now.ToString("dd_MM_yyyy") + @"\");

            screenshot.GetScreenshot().SaveAsFile(directory.FullName + @"\" + DateTime.Now.ToString("HH_mm_ss") + ".png", ScreenshotImageFormat.Png);
            Logger.Log.Info("Take screenshot");
        }
Example #4
0
 public HotelPage()
 {
     webDriver = DriverSingleton.GetDriver();
 }
Example #5
0
 public FlightsPage()
 {
     webDriver = DriverSingleton.GetDriver();
     webDriver.Navigate().GoToUrl(url);
     Logger.Log.Info($"Followed {url}");
 }