예제 #1
0
        public static void SetCurrentTestRunPath()
        {
            string directory = BaseUtilities.GetFolderPath();
            string datetime  = BaseUtilities.GetCurrentTimeWithFormat();

            getCurrentTestRunPath = directory + @"\Results\Run_" + datetime;
        }
예제 #2
0
 /// <summary>
 /// Report Event --> Main Method
 /// </summary>
 /// <param name="stepName">Name of the step</param>
 /// <param name="stepDescription">Description of the step</param>
 /// <param name="stepStatus">Status of the step</param>
 public static void ReportEvent(string stepName, Status stepStatus, Boolean isScreenshot)
 {
     //System.Drawing.Image image = null;
     if (IsRequiredReport && isScreenshot)
     {
         if (BaseUtilities.applicationType != null)
         {
             if (BaseUtilities.applicationType.ToLower().Contains("web"))
             {
                 if (IsDriverActive())
                 {
                     Screenshot screenshot = ((ITakesScreenshot)driver).GetScreenshot();
                     scnshtpath        = resultImgFolder + "\\";
                     runtimescnshtpath = scnshtpath + BaseUtilities.GetCurrentTimeWithFormat() + ".png";
                     screenshot.SaveAsFile(runtimescnshtpath);
                 }
             }
             if (BaseUtilities.applicationType.ToLower().Contains("windows"))
             {
                 scnshtpath        = resultImgFolder + "\\";
                 runtimescnshtpath = scnshtpath + BaseUtilities.GetCurrentTimeWithFormat() + ".png";
                 TakeScreenshot(runtimescnshtpath);
             }
         }
     }
     if (isHTMLReport)
     {
         HTMLExtentReport.InsertResultStep(stepName, stepStatus, isScreenshot);
     }
 }
예제 #3
0
 /// <summary>
 /// Save web screenshots into result Directory --> Support Method
 /// </summary>
 /// <param name="img">ScreenShot</param>
 public static void SaveWebScreenshot(Screenshot img)
 {
     scnshtpath        = resultImgFolder + "\\";
     runtimescnshtpath = scnshtpath + BaseUtilities.GetCurrentTimeWithFormat() + ".png";
     img.SaveAsFile(runtimescnshtpath);
 }
예제 #4
0
 /// <summary>
 /// Save screenshots into result Directory --> Support Method
 /// </summary>
 /// <param name="img">Image</param>
 public static void SaveScreenshot(System.Drawing.Image img)
 {
     scnshtpath        = resultImgFolder + "\\";
     runtimescnshtpath = scnshtpath + BaseUtilities.GetCurrentTimeWithFormat() + ".png";
     img.Save(runtimescnshtpath);
 }