Example #1
0
 public static void LogInfoWithScreenshot(StepImageContext imageContext)
 {
     if (!imageContext.ScreenshotPathWithName.Equals(""))
     {
         MediaEntityModelProvider mediaEntityModelProvider = MediaEntityBuilder.CreateScreenCaptureFromPath(imageContext.ScreenshotPathWithName).Build();
         step.Log(Status.Pass, imageContext.StepInformation, mediaEntityModelProvider);
     }
     else
     {
         step.Log(Status.Pass, imageContext.StepInformation);
     }
 }
        //adding screenshots to stepimagecontext
        public static List <StepImageContext> AddScreenshotToContext(List <StepImageContext> imageContext, string ScreenshotPathWithName, string StepInformation)
        {
            if (!ScreenshotPathWithName.Equals(""))
            {
                SeleniumHelper.CaptureScreenshotAndSave(FrameworkUtility.GetTestReportDirectory() + ScreenshotPathWithName);
            }
            StepImageContext step = new StepImageContext();

            step.ScreenshotPathWithName = ScreenshotPathWithName;
            step.StepInformation        = StepInformation;
            imageContext.Add(step);

            return(imageContext);
        }