示例#1
0
        public void WhenITakeAScreenshot()
        {
            string        BbcScreenShotsFolderPath = ConfigurationManager.AppSettings["ScreenShotsFolderPath"];
            WorkWithFiles WorkWithFiles            = new WorkWithFiles();

            WorkWithFiles.CreateFolderIfNotCreated(BbcScreenShotsFolderPath);
            WorkWithFiles.ClearFolder(BbcScreenShotsFolderPath);
            WorkWithFiles.GetScreenshot(BbcScreenShotsFolderPath, $"{WorkWithFiles.GetNumberOfFolderFiles(BbcScreenShotsFolderPath) + 1}");
        }
示例#2
0
 public static void GetScreenShootOfFailedTest()
 {
     if (TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Failed)
     {
         string        folderPath    = ConfigurationManager.AppSettings["ScreenShotsOfFailedTestsFolderPath"];
         WorkWithFiles WorkWithFiles = new WorkWithFiles();
         WorkWithFiles.CreateFolderIfNotCreated(folderPath);
         WorkWithFiles.GetScreenshot(folderPath, $"{ScenarioContext.Current.ScenarioInfo.Title} {DateTime.Now.ToString("yyyy_MM_dd")}");
     }
 }