Skip to main content

Target class

This class provides methods that are used to

Once you create a CheckSettings object using one of the factory methods defined by this class, you can configure the checkpoint by calling other methods from the CheckSettings class, chaining them one after the other using the '.' operator.

frame method

Syntax

eyes.check(Target.frame(context));
eyes.check(Target.frame(frame_ele, scrollRootElement_ele));
eyes.check(Target.frame(frame_ele));
eyes.check(Target.frame(frame_ele, scrollRootElement_sel));

eyes.check(Target.frame(frame_sel, scrollRootElement_ele));
eyes.check(Target.frame(frame_sel));
eyes.check(Target.frame(frame_sel, scrollRootElement_sel));

eyes.check(Target.frame(frame_str, scrollRootElement_ele));
eyes.check(Target.frame(frame_str));
eyes.check(Target.frame(frame_str, scrollRootElement_sel));

eyes.check(Target.frame(frame_num, scrollRootElement_ele));
eyes.check(Target.frame(frame_num));
eyes.check(Target.frame(frame_num, scrollRootElement_sel));

Parameters

context

Type: { frame: Element | Selector | string | number; scrollRootElement?: Element | Selector; };

A literal object that defines parameters for this call:

Type definitions

Element

Used to identify an HTML element defined as |WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}|WebdriverIO.RawResult<WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}>.

Selector

Used to identify an HTML element defined as string|By.

frame_ele

Type: Element

The element that contains the frame to be checked.

An element object whose bounding rectangle defines the frame to check.

Type definitions

Element

Used to identify an HTML element defined as |WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}|WebdriverIO.RawResult<WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}>.

scrollRootElement_ele

Type: Element [Optional ]

Normally, Eyes will select the most appropriate element to scroll to execute the fully method. You can use the scrollRootElement method to specify the element to scroll explicitly.

An element that should be scrolled to access the frame to be checked.

Type definitions

Element

Used to identify an HTML element defined as |WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}|WebdriverIO.RawResult<WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}>.

scrollRootElement_sel

Type: Selector [Optional ]

Normally, Eyes will select the most appropriate element to scroll to execute the fully method. You can use the scrollRootElement method to specify the element to scroll explicitly.

A selector to an element that should be scrolled to access the frame to be checked.

Type definitions

Selector

Used to identify an HTML element defined as string|By.

frame_sel

Type: Selector

The element that contains the frame to be checked.

A selector to an element object whose bounding rectangle defines the frame to check.

Type definitions

Selector

Used to identify an HTML element defined as string|By.

frame_str

Type: string

The element that contains the frame to be checked.

The name or id of the required frame.

frame_num

Type: number

The element that contains the frame to be checked.

The frame index of the required frame.

Return value

Type: CheckSettings

region method

Syntax

eyes.check(Target.region(region_obj));
eyes.check(Target.region(region_ele));
eyes.check(Target.region(region_sel));

Parameters

region_obj

Type: RegionPlain

The region to be checked.

The region is defined by the literal object RegionPlain.

Type definitions

RegionPlain

Used to describe a position and rectangular region in an image. RegionPlain is defined as: LocationPlain&RectangleSizePlain

region_ele

Type: Element

The region to be checked.

An element object whose bounding rectangle defines the area to check.

Type definitions

Element

Used to identify an HTML element defined as |WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}|WebdriverIO.RawResult<WebdriverIO.Element|{ELEMENT:string}|{'element-6066-11e4-a52e-4f735466cecf':string}>.

region_sel

Type: Selector

The region to be checked.

A selector to an element object whose bounding rectangle defines the area to check.

Type definitions

Selector

Used to identify an HTML element defined as string|By.

Return value

Type: CheckSettings

window method

Syntax

eyes.check(Target.window());

Parameters

This method does not take any parameters.

Return value

Type: CheckSettings