pub struct ScreenshotAssertionOptions {
pub max_diff_pixels: Option<u32>,
pub max_diff_pixel_ratio: Option<f64>,
pub threshold: Option<f64>,
pub animations: Option<Animations>,
pub mask: Option<Vec<Locator>>,
pub update_snapshots: Option<bool>,
}Expand description
Options for screenshot assertions
See: https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-screenshot-1
Fields§
§max_diff_pixels: Option<u32>Maximum number of different pixels allowed (default: 0)
max_diff_pixel_ratio: Option<f64>Maximum ratio of different pixels (0.0 to 1.0)
threshold: Option<f64>Per-pixel color distance threshold (0.0 to 1.0, default: 0.2)
animations: Option<Animations>Disable CSS animations before capturing
mask: Option<Vec<Locator>>Locators to mask with pink (#FF00FF) overlay
update_snapshots: Option<bool>Force update baseline even if it exists
Implementations§
Source§impl ScreenshotAssertionOptions
impl ScreenshotAssertionOptions
Sourcepub fn builder() -> ScreenshotAssertionOptionsBuilder
pub fn builder() -> ScreenshotAssertionOptionsBuilder
Create a new builder for ScreenshotAssertionOptions
Trait Implementations§
Source§impl Clone for ScreenshotAssertionOptions
impl Clone for ScreenshotAssertionOptions
Source§fn clone(&self) -> ScreenshotAssertionOptions
fn clone(&self) -> ScreenshotAssertionOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScreenshotAssertionOptions
impl Debug for ScreenshotAssertionOptions
Source§impl Default for ScreenshotAssertionOptions
impl Default for ScreenshotAssertionOptions
Source§fn default() -> ScreenshotAssertionOptions
fn default() -> ScreenshotAssertionOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScreenshotAssertionOptions
impl !RefUnwindSafe for ScreenshotAssertionOptions
impl Send for ScreenshotAssertionOptions
impl Sync for ScreenshotAssertionOptions
impl Unpin for ScreenshotAssertionOptions
impl UnsafeUnpin for ScreenshotAssertionOptions
impl !UnwindSafe for ScreenshotAssertionOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more