replaceImage method

Class: EyesPlatform: ImagesLanguage: JavaScript SDK:

Use this method to replace an image in a step, along with its metadata.

Syntax


let result = await eyes.replaceImage(stepIndex, image, tag, title, userInputs);

let result = await eyes.replaceImage(stepIndex, image, tag, title);

let result = await eyes.replaceImage(stepIndex, image, tag);

let result = await eyes.replaceImage(stepIndex, image);

Parameters

stepIndex
Type:number
The index number of the checkpoint (the first checkpoint is zero).
image
Type:string|Buffer|MutableImage
The image for this checkpoint in PNG format.
tag
Type:string [Optional ]
Replace the tag originally defined for the checkpoint.If this parameter is not passed, then the default tag is used.
title
Type:string [Optional ]
Replace the <title> tag in the checkpoint metadata.If this parameter is not passed, then the title in the metadata is undefined.
userInputs
Type:Trigger[] [Optional ]
Replace the list of user actions recorded for this checkpoint.If this parameter is not passed, then this checkpoint does not have any associated user actions.

Return value

Type: Promise&lt;boolean&gt;