public void SaveFullScreenShotTest()
        {
            var downloadPage     = new InternetPage(this.DriverContext).OpenHomePage().GoToFileDownloader();
            var screenShotNumber = FilesHelper.CountFiles(this.DriverContext.ScreenShotFolder, FileType.Png);

            TakeScreenShot.Save(TakeScreenShot.DoIt(), ImageFormat.Png, this.DriverContext.ScreenShotFolder, this.DriverContext.TestTitle);
            var nameOfScreenShot = downloadPage.CheckIfScreenShotIsSaved(screenShotNumber);

            Assert.IsTrue(nameOfScreenShot.Contains(this.DriverContext.TestTitle), "Name of screenshot doesn't contain Test Title");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Takes and saves screen shot
        /// </summary>
        public void TakeAndSaveScreenshot()
        {
            if (BaseConfiguration.FullDesktopScreenShotEnabled)
            {
                TakeScreenShot.Save(TakeScreenShot.DoIt(), ImageFormat.Png, this.ScreenShotFolder, this.TestTitle);
            }

            if (BaseConfiguration.SeleniumScreenShotEnabled)
            {
                this.SaveScreenshot(new ErrorDetail(this.TakeScreenshot(), DateTime.Now, null), this.ScreenShotFolder, this.TestTitle);
            }
        }
        public void SaveFullScreenShotTest()
        {
            var downloadPage     = new InternetPage(this.DriverContext).OpenHomePage().GoToFileDownloader();
            var screenShotNumber = FilesHelper.CountFiles(this.DriverContext.ScreenShotFolder, FileType.Png);

            Assert.IsNotNull(TakeScreenShot.Save(TakeScreenShot.DoIt(), ImageFormat.Png, this.DriverContext.ScreenShotFolder, string.Format(CultureInfo.CurrentCulture, this.DriverContext.TestTitle + "_first")));
            var nameOfScreenShot = downloadPage.CheckIfScreenShotIsSaved(screenShotNumber);

            TestContext.AddTestAttachment(nameOfScreenShot);
            Assert.IsTrue(nameOfScreenShot.Contains(this.DriverContext.TestTitle), "Name of screenshot doesn't contain Test Title");
            Assert.IsNotNull(this.DriverContext.TakeAndSaveScreenshot());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Takes and saves screen shot
        /// </summary>
        /// <returns>Array of filepaths</returns>
        public string[] TakeAndSaveScreenshot()
        {
            List <string> filePaths = new List <string>();

            if (BaseConfiguration.FullDesktopScreenShotEnabled)
            {
                filePaths.Add(TakeScreenShot.Save(TakeScreenShot.DoIt(), ImageFormat.Png, this.ScreenShotFolder, this.TestTitle));
            }

            if (BaseConfiguration.SeleniumScreenShotEnabled)
            {
                filePaths.Add(this.SaveScreenshot(new ErrorDetail(this.TakeScreenshot(), DateTime.Now, null), this.ScreenShotFolder, this.TestTitle));
            }

            return(filePaths.ToArray());
        }