Skip to main content

BatchInfo class

Call the Configuration.setBatch method or Eyes.setBatch method with an object of this class to configure the batch for one or more tests.

See How to group tests into batches using the SDK for details and an example.

BatchInfo method

Syntax

//overloaded methods
let batchinfo = new BatchInfo();
let batchinfo = new BatchInfo(batch);
let batchinfo = new BatchInfo(name);
let batchinfo = new BatchInfo(name, startedat);
let batchinfo = new BatchInfo(name, startedat, id);

Parameters

batch

Type: BatchInfoPlain [Optional ]

An object that describes te batch attributes.

name

Type: string [Optional ]

The name of the batch. If a is passed then the name will be taken from the environment variable APPLITOOLS_BATCH_NAME. If the environment variable is not defined then the name of the first test is used as the batch name.

startedAt

Type:

string|Date\[Optional \]

The date and time that will be displayed in the Test Manager as the batch start time.

id

Type: string [Optional ]

The unique id of the batch. If not passed, or passed as null, and the environment variable APPLITOOLS_BATCH_ID is defined, then the value of the environment variable will be used as the id. If the environment variable is not defined then a unique internal id will be generated and used.

Return value

Type: BatchInfo

addProperty method

Syntax

let value = batchInfo.addProperty(property);

Parameters

property

Type: PropertyDataPlain

The name of the property.

Return value

Type: BatchInfo

Remarks

getId method

Syntax

let value = batchInfo.getId();
batchInfo.id = value;
value = batchInfo.id;

Note that this feature is available as both a method and a property.

Parameters

This method does not take any parameters.

Return value

Type: string

getName method

Syntax

let value = batchInfo.getName();
batchInfo.name = value;
value = batchInfo.name;

Note that this feature is available as both a method and a property.

Parameters

This method does not take any parameters.

Return value

Type: string

getNotifyOnCompletion method

Syntax

let value = batchInfo.getNotifyOnCompletion();
batchInfo.notifyOnCompletion = value;
value = batchInfo.notifyOnCompletion;

Note that this feature is available as both a method and a property.

Parameters

This method does not take any parameters.

Return value

Type: boolean

getProperties method

Syntax

let value = batchInfo.getProperties();
batchInfo.properties = value;
value = batchInfo.properties;

Note that this feature is available as both a method and a property.

Parameters

This method does not take any parameters.

Return value

Type: PropertyData[]

The returned list contains all of the name/value pairs defined for the batch. Each entry in the list is a single name/value pair.

getSequenceName method

Syntax

let value = batchInfo.getSequenceName();
batchInfo.sequenceName = value;
value = batchInfo.sequenceName;

Note that this feature is available as both a method and a property.

Parameters

This method does not take any parameters.

Return value

Type: string

getStartedAt method

Syntax

let value = batchInfo.getStartedAt();
batchInfo.startedAt = value;
value = batchInfo.startedAt;

Note that this feature is available as both a method and a property.

Parameters

This method does not take any parameters.

Return value

Type:

Date|string

setId method

Syntax

let value = batchInfo.setId(id);
batchInfo.id = value;
value = batchInfo.id;

Note that this feature is available as both a method and a property.

Parameters

id

Type: string

The unique id of the batch. If not passed, or passed as None, and the environment variable APPLITOOLS_BATCH_ID is defined, then the value of the environment variable will be used as the id. If the environment variable is not defined then a unique internal id will be generated and used. Since this value is unique for each test run, if you do not set the id explicitly you can only batch tests that run in the current test run.

Return value

Type: BatchInfo

setName method

Syntax

let value = batchInfo.setName(name);
batchInfo.name = value;
value = batchInfo.name;

Note that this feature is available as both a method and a property.

Parameters

name

Type: string

The name of the batch.

Return value

Type: BatchInfo

setNotifyOnCompletion method

Syntax

let value = batchInfo.setNotifyOnCompletion(notifyOnCompletion);
batchInfo.notifyOnCompletion = value;
value = batchInfo.notifyOnCompletion;

Note that this feature is available as both a method and a property.

Parameters

notifyOnCompletion

Type: boolean

If this value is true then a notification will be sent.

Return value

Type: BatchInfo

setProperties method

Syntax

let value = batchInfo.setProperties(properties);
batchInfo.properties = value;
value = batchInfo.properties;

Note that this feature is available as both a method and a property.

Parameters

properties

Type: PropertyDataPlain[]

Pass one or more name/value pairs.

Return value

Type: BatchInfo

Remarks

setSequenceName method

Syntax

//typical code sequence using setSequenceName
let batchInfo = new BatchInfo("my batch name");
let sequenceName = "My sequence name";
batchInfo.setSequenceName(sequenceName);
eyes.setBatch(batchInfo);
//typical code sequence using setSequenceName
let batchInfo = new BatchInfo("my batch name");
let sequenceName = "My sequence name";
batchInfo.setSequenceName;
eyes.setBatch(batchInfo);
//typical code sequence using setSequenceName
let batchInfo = new BatchInfo("my batch name");
let sequenceName = "My sequence name";
batchInfo.setSequenceName;
eyes.setBatch(batchInfo);

Note that this feature is available as both a method and a property.

Parameters

sequenceName

Type: string

The name to be assigned to the batch sequence

Return value

Type: BatchInfo

Remarks

If you do not set this attribute and the environment variable APPLITOOLS_BATCH_SEQUENCE is defined, then the value of the environment variable will be used as the sequence name. If the environment variable is not defined, then the batch will not be associated with any sequence name.