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