Beispiel #1
0
 private void InitializeOnRunStarted(DateTime startDateTime)
 {
     Action.Safe(() =>
     {
         RunRepository.OnRunStarted(ReporterSettings, startDateTime);
         TestRunsRepository.OnRunStarted();
         ResourceExtractor.ExtractReportBase(ReporterSettings.OutputPath);
         DataService.SaveReportSettings(ReportSettings);
     });
 }
Beispiel #2
0
 private void InitializeOnRunStarted(DateTime startDateTime)
 {
     Action.Safe(() =>
     {
         Logger.Debug("Reporter is initializing on run start...");
         RunRepository.OnRunStarted(ReporterSettings, startDateTime);
         TestRunsRepository.OnRunStarted();
         ResourceExtractor.ExtractReportBase(ReporterSettings.OutputPath);
         DataWriterService.SaveReportSettings(ReportSettings);
         Logger.Debug($"Reporter initializing done. Output folder is '{ReporterSettings.OutputPath}'. " +
                      $"Data service file: '{ReporterSettings.DataServiceFile}', Logger file: '{ReporterSettings.LoggerFile}'");
     });
 }
Beispiel #3
0
 private void InitializeRun(DateTime startDateTime, string runGuid = "")
 {
     _action.Safe(() =>
     {
         _currentRunGuid = runGuid.Equals("") || runGuid.Equals("null") ? Guid.NewGuid() : Guid.Parse(runGuid);
         _currentRun     = new Run(_currentRunGuid)
         {
             TestRunFiles = new List <string>(),
             RunSummary   = new RunSummary()
         };
         _currentTestRuns   = new List <ITestRun>();
         _currentRun.Name   = Settings.RunName;
         _currentRun.Sprint = Settings.Sprint;
         _extractor.ExtractReportBase();
         _currentRun.RunInfo.Start = startDateTime;
     });
 }
Beispiel #4
0
        public static void Main(string[] args)
        {
            var reporter = ReporterFactory.Build(new DummyTestDataProvider());

            ResourceExtractor.ExtractReportBase(reporter.ReporterSettings.OutputPath);

            reporter.Logger.Info("STARTED");

            var reportSettings = new ReportSettingsDto(5, 7, "Awesome report", "Awesome project");

            reporter.DataWriterService.SaveReportSettings(reportSettings);
            reporter.DataWriterService.SaveReportSettings(reportSettings);
            reporter.DataWriterService.SaveReportSettings(reportSettings);

            var run = new RunDto
            {
                RunInfo = new ItemInfoDto
                {
                    Start  = DateTime.Now.AddMinutes(-2),
                    Finish = DateTime.Now,
                    Guid   = Guid.NewGuid()
                },
                RunSummary = new RunSummaryDto(),
                Name       = "Awesome run",
                Sprint     = "Sprint 1",
                TestsInfo  = new List <ItemInfoDto>()
            };

            reporter.DataWriterService.SaveRun(run);
            reporter.DataWriterService.SaveRun(run);

            reporter.Logger.Info("RUN SAVED");

            var testGuid = Guid.NewGuid();
            var screen   = new TestScreenshotDto
            {
                TestScreenshotInfo = new SimpleItemInfoDto
                {
                    Date     = DateTime.Now,
                    ItemName = "Screenshot"
                },
                Base64Data = "ASDJasdkajasdfas==",
                TestGuid   = testGuid
            };
            var test     = new TestRunDto(testGuid, "Test", "Test.FullName");
            var testInfo = new ItemInfoDto
            {
                Start  = DateTime.Now.AddSeconds(-2),
                Finish = DateTime.Now.AddSeconds(2),
                Guid   = testGuid
            };

            test.TestInfo = testInfo;
            reporter.DataWriterService.SaveScreenshot(screen);
            reporter.DataWriterService.SaveTestRun(test, new TestOutputDto
            {
                TestOutputInfo = new SimpleItemInfoDto
                {
                    Date     = DateTime.Now,
                    ItemName = "Some output"
                },
                Output      = "output",
                SuiteOutput = "suite output"
            });

            reporter.Logger.Info("DONE");
            reporter.TearDown();
        }