Struct xray::FsScreenshotIo [−][src]
pub struct FsScreenshotIo { /* fields omitted */ }
Retrieves reference screenshots and stores debugging screenshots using the filesystem. All images are in PNG format.
This implementation will look for reference images in <references_path>/<test_name>.png
at the top level of your crate. Either of these may contain slashes to use subdirectories.
For example, for a references_path tests/reference_images
, and a test_name basics/menu
the library will look for a reference image in tests/reference_images/basics/menu.png
.alloc
It will store output images in <output_path>/<test_name> at the top level of your crate. As with
reference images, slashes may be used to use subdirectories. For example, given an output path
target/screenshots
and a test_name basics/menu
, the following images will be written:
target/screenshots/basics/menu/actual.png
target/screenshots/basics/menu/expected.png
target/screenshots/basics/menu/diff.png
actual.png
contains the screenshot taken for the test.
Trait Implementations
impl ScreenshotIo for FsScreenshotIo
[src]
impl ScreenshotIo for FsScreenshotIo
fn prepare_output(&self) -> Result<(), XrayError>
[src]
fn prepare_output(&self) -> Result<(), XrayError>
Performs any work needed to prepare to store output (e.g. creating directories) This gets called once per test, before any output is written. Read more
fn load_reference(&self) -> Result<DynamicImage, XrayError>
[src]
fn load_reference(&self) -> Result<DynamicImage, XrayError>
Loads a reference image to compare to the screenshot taken by xray. The actual method used to load the image depends on your chosen implementation. Read more
fn write_actual(&self, actual: &DynamicImage) -> Result<(), XrayError>
[src]
fn write_actual(&self, actual: &DynamicImage) -> Result<(), XrayError>
Writes out the screenshot taken during the test in the event of a failed test.
fn write_expected(&self, actual: &DynamicImage) -> Result<(), XrayError>
[src]
fn write_expected(&self, actual: &DynamicImage) -> Result<(), XrayError>
Writes out the screenshot that was expected during the test in the event of a failed test.
fn write_diff(&self, actual: &DynamicImage) -> Result<(), XrayError>
[src]
fn write_diff(&self, actual: &DynamicImage) -> Result<(), XrayError>
Writes out an image containing only those pixels that were present in the newly captured image but not present in the reference image. Read more
fn default(test_name: &str) -> FsScreenshotIo
[src]
fn default(test_name: &str) -> FsScreenshotIo
Returns a default implementation of ScreenshotIo
. Read more
Auto Trait Implementations
impl Send for FsScreenshotIo
impl Send for FsScreenshotIo
impl Sync for FsScreenshotIo
impl Sync for FsScreenshotIo