Class SaveScreenshotBuilder
- Namespace
- CSF.Screenplay.Selenium.Builders
- Assembly
- CSF.Screenplay.Selenium.dll
A builder class to create an instance of SaveScreenshot.
public class SaveScreenshotBuilder : IGetsPerformable
- Inheritance
-
SaveScreenshotBuilder
- Implements
- Inherited Members
Remarks
Like all builders in this namespace, this class is not to be instantiated directly. Instead, use the SaveTheScreenshot(Screenshot) method.
Methods
WithTheFormat(ScreenshotImageFormat)
Specifies the image format to use when saving the screenshot.
public SaveScreenshotBuilder WithTheFormat(ScreenshotImageFormat format)
Parameters
formatScreenshotImageFormatThe file format
Returns
- SaveScreenshotBuilder
This same builder, so further customisations may be performed
Remarks
If the image format is omitted (this method is not used) then the saved screenshot will default to the Png image format.
WithTheName(string)
Specifies a human-readable name/summary for the screenshot.
public SaveScreenshotBuilder WithTheName(string name)
Parameters
namestringA human-readable name for the screenshot.
Returns
- SaveScreenshotBuilder
This same builder, so further customisations may be performed
Remarks
Specifying this name is recommended, as it will form a part of the report which is subsequently generated. The name will serve to identify the screenshot amongst other assets which may be included in the report. The name will also be used as part of the filename by which the screenshot asset file is saved.
Operators
implicit operator SaveScreenshot(SaveScreenshotBuilder)
Implicitly converts a SaveScreenshotBuilder to an SaveScreenshot.
public static implicit operator SaveScreenshot(SaveScreenshotBuilder builder)
Parameters
builderSaveScreenshotBuilderThe SaveScreenshotBuilder instance.
Returns
- SaveScreenshot
An SaveScreenshot instance.