Skip to main content

Compare Options

Compare options are options that influence the way the comparison, by ResembleJS is being executed.

NOTE

All compare options can be used during service instantiation or for each single checkElement,checkScreen and checkFullPageScreen. If a method option has the same key as an option that has been set during the instantiation of the service, then the method compare option will override the service compare option value.

ignoreAlpha

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Compare images and discard alpha.

blockOutSideBar

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can only be used for checkScreen(). It will override the plugin setting. This is iPad only

Automatically block out the sidebar for iPads in landscape mode during comparisons. This prevents failures on the tab/private/bookmark native component.

blockOutStatusBar

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting. This is Mobile only

Automatically block out the status and address bar during comparisons. This prevents failures on time, wifi or battery status.

blockOutToolBar

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting. This is Mobile only

Automatically block out the toolbar.

ignoreAntialiasing

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Compare images and discard anti-aliasing.

ignoreColors

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Even though the images are in color, the comparison will compare 2 black/white images

ignoreLess

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Compare images and compare with red = 16, green = 16, blue = 16, alpha = 16, minBrightness=16, maxBrightness=240

ignoreNothing

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Compare images and compare with red = 0, green = 0, blue = 0, alpha = 0, minBrightness=0, maxBrightness=255

ignoreTransparentPixel

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Compare images and it will ignore all pixels that have some transparency in one of the images

rawMisMatchPercentage

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

If true the return percentage will be like 0.12345678, default is 0.12

returnAllCompareData

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

This will return all compare data, not only the mismatch percentage

saveAboveTolerance

  • Type: number
  • Default: 0
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Allowable value of misMatchPercentage that prevents saving images with differences

largeImageThreshold

  • Type: number
  • Default: 0
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Comparing large images can lead to performance issues. When providing a number for the number of pixels here (higher than 0), the comparison algorithm skips pixels when the image width or height is larger than largeImageThreshold pixels.

scaleImagesToSameSize

  • Type: boolean
  • Default: false
  • Mandatory: no
  • Remark: Can also be used for checkElement, checkScreen() and checkFullPageScreen(). It will override the plugin setting

Scales 2 images to the same size before execution of comparison. Highly recommended to enable ignoreAntialiasing and ignoreAlpha

Welcome! How can I help?

WebdriverIO AI Copilot