csf-dev / CSF.Screenplay

Implementation of the Screenplay pattern (aka Journey) in .NET
https://csf-dev.github.io/CSF.Screenplay/
MIT License
13 stars 1 forks source link

Writing HTML reports crashes (no ZPT-Sharp configuration) #130

Closed craigfowler closed 6 years ago

craigfowler commented 6 years ago

This was seen when using Screenplay with the Agiil project.

System.ArgumentNullException: Value cannot be null.                                                                                                                                                                              
Parameter name: provider                                                                                                                                                                                                         
  at CSF.Zpt.ZptDocumentFactory.CreateDocument (CSF.Zpt.IZptDocumentProvider provider, System.IO.Stream source, CSF.Zpt.Rendering.ISourceInfo sourceInfo, System.Text.Encoding encoding) [0x00003] in <1dc79a8a78f74023a239ea06de73982a>:0                                                                                                                                                                                                                        
  at CSF.Zpt.ZptDocumentFactory.CreateDocument (System.IO.Stream source, CSF.Zpt.RenderingMode renderingMode, CSF.Zpt.Rendering.ISourceInfo sourceInfo, System.Text.Encoding encoding) [0x00047] in <1dc79a8a78f74023a239ea06de73982a>:0                                                                                                                                                                                                                          
  at CSF.Screenplay.Reporting.HtmlReportWriter.GetDocument () [0x00007] in <b5f3bc9d00384c56bfe265e78086d499>:0                                                                                                                  
  at CSF.Screenplay.Reporting.HtmlReportWriter.Write (CSF.Screenplay.Reporting.Models.Report report) [0x00000] in <b5f3bc9d00384c56bfe265e78086d499>:0                                                                           
  at Agiil.Tests.BDD.ScreenplayIntegrationConfig.WriteHtmlReport (CSF.Screenplay.Reporting.IObjectFormattingService formatter, CSF.Screenplay.Reporting.Models.Report report, System.IO.DirectoryInfo directory) [0x00023] in <ffa74a6a29bd4d348cb9a92b4735e8e3>:0
craigfowler commented 6 years ago

Root cause

This is caused by missing ZPT-Sharp configuration in the app.config file.

I have a feeling that it might be easier to have ZPT-Sharp receive the config via a hard-coded mechanism when used like this. I don't want to have to keep specifying a load of app config stuff when actually all I want to do is use a predefined set of plugins.

craigfowler commented 6 years ago

Workaround

Provide the config in the application configuration file.