Class ReportConverterOptions
- Namespace
- CSF.Screenplay.JsonToHtmlReport
- Assembly
- CSF.Screenplay.JsonToHtmlReport.dll
Options for converting a JSON report to HTML.
public class ReportConverterOptions
- Inheritance
-
ReportConverterOptions
- Inherited Members
Properties
EmbeddedFileExtensions
Gets or sets a comma-separated list of file extensions which are supported for embedding into report.
public string EmbeddedFileExtensions { get; set; }
Property Value
Remarks
By default, the report converter will attempt to embed file data into the HTML report file. This is desirable because it means that the report file is likely to be portable as a single file, even when it contains linked assets. Any asset files with a size less than or equal to the threshold are embedded into the HTML file if their file extension is amongst those listed in this property.
The default value for this property is jpg,jpeg,png,gif,webp,svg,mp4,mov,avi,wmv,mkv,webm.
These are common image and video file types, seen on the web.
Note that the wildcard *, if included anywhere this property value, denotes that files of all (any) extension
should be embedded into the report.
Setting this value to an empty string will disable embedding of files into the report.
The file-size threshold for files which may be embedded into the report is controlled by the option property EmbeddedFileSizeThresholdKb.
EmbeddedFileSizeThresholdKb
Gets or sets a threshold (in Kilobytes) for files which should be embedded into the report.
public int EmbeddedFileSizeThresholdKb { get; set; }
Property Value
Remarks
By default, the report converter will attempt to embed file data into the HTML report file. This is desirable because it means that the report file is likely to be portable as a single file, even when it contains linked assets. Any asset files of supported file extensions are embedded into the HTML file if their file size (in kilobytes) is less than or equal to this value.
The default value for this property is 500 (500 kilobytes, half a megabyte). Setting this value to zero or a negative number will disable embedding of files into the report. Setting this value to an arbitrarily high number (such as 1000000, meaning a gigabyte) will cause all files to be embedded.
The supported file extensions are listed in the option property EmbeddedFileExtensions.
OutputPath
Gets or sets the file system path where the HTML report will be saved.
public string OutputPath { get; set; }
Property Value
ReportPath
Gets or sets the file system path to the JSON report which is to be converted to HTML.
public string ReportPath { get; set; }
Property Value
Methods
GetEmbeddedFileExtensions()
Gets a collection of file extensions (including the leading period) which should be embedded into HTML reports.
public IReadOnlyCollection<string> GetEmbeddedFileExtensions()
Returns
- IReadOnlyCollection<string>
A collection of the extensions to embed
ShouldEmbedAllFileTypes()
Gets a value indicating whether all file types (regardless of extension) should be embedded.
public bool ShouldEmbedAllFileTypes()
Returns
Remarks
This method returns true if EmbeddedFileExtensions contains the character *.
Note that a file must still have a size equal to or less than EmbeddedFileSizeThresholdKb to be embedded.