Exemple #1
0
 public void SetUpScenario()
 {
     AtataContext.Configure()
     .EventSubscriptions.Add <ScreenshotFileSavedEvent>(eventData => _outputHelper.AddAttachment(eventData.FilePath))
     .LogConsumers.Add(new TextOutputLogConsumer(_outputHelper.WriteLine))
     .Build();
 }
Exemple #2
0
        public void TakeScreenshotAfterEachStep()
        {
            if (_browserDriver.Current is ITakesScreenshot screenshotTaker)
            {
                var filename = Path.ChangeExtension(Path.GetRandomFileName(), "png");

                screenshotTaker.GetScreenshot().SaveAsFile(filename);

                _specFlowOutputHelper.AddAttachment(filename);
            }
        }