예제 #1
0
        public void AttachScreenshot(string path)
        {
            string relativePath;

            if (path.Contains(Config.GetOutputDir()))
            {
                relativePath = path.Replace(Config.GetOutputDir() + @"\", "");
            }
            else
            {
                var          fileName    = Path.GetFileName(path);
                const string relativeDir = "extentScreenshots";
                var          newPath     = Path.Combine(Config.GetOutputDir(), relativeDir);
                Directory.CreateDirectory(newPath);
                File.Copy(path, Path.Combine(newPath, fileName));
                relativePath = Path.Combine(relativeDir, fileName);
            }
            _test.AddScreenCaptureFromPath(relativePath);
        }
예제 #2
0
        private ExtentHtmlReporter()
        {
            var htmlReporter =
                new AventStack.ExtentReports.Reporter.ExtentHtmlReporter(Path.Combine(Config.GetOutputDir(),
                                                                                      "extent.html"));

            htmlReporter.LoadConfig("Extent-Config.xml");
            Extent.AttachReporter(htmlReporter);
        }