floatingRegion method
Add one more floating region to this target.
When you define a floating region, you define an inner region and offsets outwards from the inner region in all directions to form an outer region. All the pixels of the outer region will be considered as matched if the pixels of the checkpoint inner region match at least one area in the baseline outer region.
Syntax
eyes.check(Target.window().floatingRegion(region_obj1));
eyes.check(
Target.window().floatingRegion(
region_obj2,
maxUpOffset,
maxDownOffset,
maxLeftOffset,
maxRightOffset
)
);
eyes.check(
Target.window().floatingRegion(
region_obj2,
maxUpOffset,
maxDownOffset,
maxLeftOffset
)
);
eyes.check(
Target.window().floatingRegion(region_obj2, maxUpOffset, maxDownOffset)
);
eyes.check(Target.window().floatingRegion(region_obj2, maxUpOffset));
eyes.check(Target.window().floatingRegion(region_obj2));
eyes.check(
Target.window().floatingRegion(
region_ele,
maxUpOffset,
maxDownOffset,
maxLeftOffset,
maxRightOffset
)
);
eyes.check(
Target.window().floatingRegion(
region_ele,
maxUpOffset,
maxDownOffset,
maxLeftOffset
)
);
eyes.check(
Target.window().floatingRegion(region_ele, maxUpOffset, maxDownOffset)
);
eyes.check(Target.window().floatingRegion(region_ele, maxUpOffset));
eyes.check(Target.window().floatingRegion(region_ele));
eyes.check(
Target.window().floatingRegion(
region_sel,
maxUpOffset,
maxDownOffset,
maxLeftOffset,
maxRightOffset
)
);
eyes.check(
Target.window().floatingRegion(
region_sel,
maxUpOffset,
maxDownOffset,
maxLeftOffset
)
);
eyes.check(
Target.window().floatingRegion(region_sel, maxUpOffset, maxDownOffset)
);
eyes.check(Target.window().floatingRegion(region_sel, maxUpOffset));
eyes.check(Target.window().floatingRegion(region_sel));
Parameters
- region_obj1
- Type:
{ region: RegionPlain | ElementHandle | Selector; maxUpOffset?: number; maxDownOffset?: number; maxLeftOffset?: number; maxRightOffset?: number; };
{ region: RegionPlain | ElementHandle | Selector; maxUpOffset?: number; maxDownOffset?: number; maxLeftOffset?: number; maxRightOffset?: number; };
Type definitions
- RegionPlain
- Used to describe a position and rectangular region in an image. RegionPlain is defined as: LocationPlain&RectangleSizePlain
- region_obj2
- Type:RegionPlain
- RegionPlain
Type definitions
- RegionPlain
- Used to describe a position and rectangular region in an image. RegionPlain is defined as: LocationPlain&RectangleSizePlain
- 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.
- region_ele
- Type:ElementHandle
- An element whose position and bounding rectangle defines the region.
- region_sel
- Type:Selector
- A selector to an element whose position and bounding rectangle defines the region.
Type definitions
- Selector
- Used to identify an HTML element defined as string|{selector:string;type:string}.
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; 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.