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]

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

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

Writes out the screenshot taken during the test in the event of a failed test.

Writes out the screenshot that was expected during the test in the event of a failed test.

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

Returns a default implementation of ScreenshotIo. Read more

Auto Trait Implementations