Skip to main content

ImagesCheckSettings class

The methods in this class are used as part of the check Fluent API to configure and execute checkpoints.

To use these methods, first create a target object using a method from the Target class, then call one or more of the methods in this class on the returned object, chaining them one after the other using the '.' operator.

Require statement

const {ImagesCheckSettings} = require('@applitools/eyes-images');

accessibilityRegion method​

Syntax​

eyes.check(Target.window().accessibilityRegion(region, regionType));

Parameters​

region

Type:

GetAccessibilityRegion|Region|AccessibilityMatchSettings

An object that defines a rectangular area in the window.

regionType

Type: AccessibilityRegionType

The accessibility type of the region.

Return value​

Type: ImagesCheckSettings

Remarks​

For more information about the Contrast advisor feature see Contrast advisor.

content method​

Syntax​

eyes.check(Target.window().content());

Parameters​

This method does not take any parameters.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You can call this method in two ways - with parameters and without parameters. The meaning of the method, and the way it can be used is different in each case. When the method is called without parameters it sets the default match level for this target. When called with one or more regions as parameters it defines the match level for that region. The sections below provide some more details regarding how to use this method in each of these modes.

Called without parameters​

If this method is called without parameters then it sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods (without parameters) that set a target default match level:

Called with parameters​

When the method is called with one or more parameters that define one or more regions, then these set the match level for those regions, overiding the defaults set for the target (by calling these methods without a parameter), set by setMatchLevel and the hardcoded default match level.

You may define multiple regions that have an explicit match level by calling this method multiple times in a chain, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

contentRegions method​

Syntax​

eyes.check(Target.window().contentRegions(regions));

Parameters​

regions

Type:

GetRegion|Region

One or more region descriptors or selectors in one of the defined types.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may define multiple regions that have an explicit match level by calling this method multiple times, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

exact method​

Syntax​

eyes.check(Target.window().exact());

Parameters​

This method does not take any parameters.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

This method sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods that set a target default match level:

To set a match level for a one or more regions within a target use one of the following methods:

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

floatingRegion method​

Syntax​

eyes.check(
Target.window().floatingRegion(
region,
maxUpOffset,
maxDownOffset,
maxLeftOffset,
maxRightOffset
)
);

eyes.check(
Target.window().floatingRegion(
region,
maxUpOffset,
maxDownOffset,
maxLeftOffset
)
);

eyes.check(Target.window().floatingRegion(region, maxUpOffset, maxDownOffset));

eyes.check(Target.window().floatingRegion(region, maxUpOffset));

eyes.check(Target.window().floatingRegion(region));

Parameters​

region

Type:

GetFloatingRegion|Region|FloatingMatchSettings

An object that defines the region.

maxUpOffset

Type: number [Optional ]

The maximum amount that the region can shift upwards and still be considered matching.

maxDownOffset

Type: number [Optional ]

The maximum amount that the region can shift downwards and still be considered matching.

maxLeftOffset

Type: number [Optional ]

The maximum amount that the region can shift to the left and still be considered matching.

maxRightOffset

Type: number [Optional ]

The maximum amount that the region can shift to the right and still be considered matching.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may call this method multiple times in a given chain; each call defines a different floating region. Floating regions may not overlap each other or other types of regions, such as ignore or match level regions.

floatingRegions method​

Syntax​

eyes.check(Target.window().floatingRegions(maxOffset));

Parameters​

maxOffset

Type: number

The maximum amount that the region can shift in any direction and still be considered matching.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

ignore method​

Syntax​

eyes.check(Target.window().ignore(region));

Parameters​

region

Type:

GetRegion|Region|By|String|EyesWebElement|Object

An object that defines a rectangular area in the window.

Return value​

Type: CheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may call this method multiple times in a given chain.

Ignore regions should not overlap each other or other types of regions such as floating or match level regions.

ignoreCaret method​

Syntax​

eyes.check(Target.window().ignoreCaret(ignoreCaret));

eyes.check(Target.window().ignoreCaret());

Parameters​

ignoreCaret

Type: boolean [Optional : default = true ]

If this parameter has a value of true, then Eyes will detect artifacts caused by a blinking cursor and will not report a mismatch for differences caused by these artifacts. If it has a value of , then Eyes will not try to detect artifacts caused by blinking cursors. If no parameter is passed then the default value is true - so the cursor artifacts will be ignored.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may only call this method once in a given chain. This method overrides the global default setting or the setting chosen explicitly for the current target using Eyes.setIgnoreCaret method or Configuration.setIgnoreCaret method.

ignoreDisplacements method​

Syntax​

eyes.check(Target.window().ignoreDisplacements(ignoreDisplacements));

eyes.check(Target.window().ignoreDisplacements());

Parameters​

ignoreDisplacements

Type: boolean [Optional : default = true ]

If a value of true is passed, then mismatches due to displaced content will not be displayed in the Test Manager. Otherwise, they will be displayed.

Return value​

Type: ImagesCheckSettings

Remarks​

Ignore displacements is only active when using a Match level of Strict or IGNORECOLORS

ignoreRegions method​

Syntax​

eyes.check(Target.window().ignoreRegions(regions));

Parameters​

regions

Type:

GetRegion|Region

A region defined by one of the possible types.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may call this method multiple times in a given chain. Ignore regions should not overlap each other or other types of regions (i.e. floating or match level regions).

imageSize method​

Syntax​

eyes.check(Target.window().imageSize(imageSize));

Parameters​

imageSize

Type: RectangleSize

A rectangular area that represents the size of the image.

Return value​

Type: ImagesCheckSettings

layout method​

Syntax​

eyes.check(Target.window().layout());

Parameters​

This method does not take any parameters.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You can call this method in two ways - with parameters and without parameters. The meaning of the method, and the way it can be used is different in each case. When the method is called without parameters it sets the default match level for this target. When called with one or more regions as parameters it defines the match level for that region. The sections below provide some more details regarding how to use this method in each of these modes.

Called without parameters​

If this method is called without parameters then it sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods (without parameters) that set a target default match level:

Called with parameters​

When the method is called with one or more parameters that define one or more regions, then these set the match level for those regions, overiding the defaults set for the target (by calling these methods without a parameter), set by setMatchLevel and the hardcoded default match level.

You may define multiple regions that have an explicit match level by calling this method multiple times in a chain, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

layoutRegions method​

Syntax​

eyes.check(Target.window().layoutRegions(regions));

Parameters​

regions

Type:

GetRegion|Region

One or more region descriptors or selectors in one of the defined types.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may define multiple regions that have an explicit match level by calling this method multiple times, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

matchLevel method​

Syntax​

eyes.check(Target.window().matchLevel(matchLevel));

Parameters​

matchLevel

Type: MatchLevel

Available match level values are:

For a description of these match levels and the different ways to apply them to tests, checkpoints, and regions, see Eyes match levels.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

The value provided here overrides the default match level, or the global value set for this target using Eyes.setMatchLevel or Configuration.setMatchLevel. You may only call this method once in a given chain. If you call this method, then you can't call the other match level methods. ImagesCheckSettings.strictImagesCheckSettings.contentImagesCheckSettings.layoutImagesCheckSettings.exact

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

region method​

Syntax​

eyes.check(Target.window().region(region));

Parameters​

region

Type:

Region|RegionObject

An object that defines the region.

Type definitions​

RegionObject

The type RegionObject is defined as: {left:number,top:number,width:number,height:number,coordinatesType: CoordinatesType|undefined} The field coordinatesType is for internal use only and should not be set by users.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

The parameter to the method specifies the region to be matched. You may only call this method once in a given chain.

strict method​

Syntax​

eyes.check(Target.window().strict());

Parameters​

This method does not take any parameters.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You can call this method in two ways - with parameters and without parameters. The meaning of the method, and the way it can be used is different in each case. When the method is called without parameters it sets the default match level for this target. When called with one or more regions as parameters it defines the match level for that region. The sections below provide some more details regarding how to use this method in each of these modes.

Called without parameters​

If this method is called without parameters then it sets the default match level for this target. This overrides the hard-coded default and the default match level defined by using setMatchLevel.

For a given target you may call only one of the following methods (without parameters) that set a target default match level:

Called with parameters​

When the method is called with one or more parameters that define one or more regions, then these set the match level for those regions, overiding the defaults set for the target (by calling these methods without a parameter), set by setMatchLevel and the hardcoded default match level.

You may define multiple regions that have an explicit match level by calling this method multiple times in a chain, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

strictRegions method​

Syntax​

eyes.check(Target.window().strictRegions(regions));

Parameters​

regions

Type:

GetRegion|Region

One or more region descriptors or selectors in one of the defined types.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may define multiple regions that have an explicit match level by calling this method multiple times, or by passing the method multiple regions.

The region matchlevel methods strict(regions), layout(regions), content(regions), strictRegions(regions), layoutRegions(regions), and contentRegions(regions) should not overlap each other or the regions defined using checksettings.ignore (regions) or ignoreRegions(regions). If they overlap with each other, or regions that were defined using the Test Manager, then the results are undefined.

For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.

withName method​

Syntax​

eyes.check(Target.window().withName(name));

Parameters​

name

Type: string

The name to be given to this check point.

Return value​

Type: ImagesCheckSettings

The value returned is the object that called the method. You can use it to call other methods supported by the object class.

Remarks​

You may only call this method once in a given chain.