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.

Import statement

import com.applitools.eyes.android.common.BatchInfo;

BatchInfo method

Syntax

BatchInfo batchInfo = new BatchInfo(name, startedAt);

BatchInfo batchInfo = new BatchInfo(name);

Parameters

name

Type: String

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: Calendar

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

Return value

Type: BatchInfo

getId method

Syntax

String value = batchInfo.getId();

Parameters

This method does not take any parameters.

Return value

Type: String

getName method

Syntax

String value = batchInfo.getName();

Note: This method is a static method.

Parameters

This method does not take any parameters.

Return value

Type: String

getSequenceName method

Syntax

String value = batchInfo.getSequenceName();

Parameters

This method does not take any parameters.

Return value

Type: String

getStartedAt method

Syntax

Calendar value = batchInfo.getStartedAt();

Parameters

This method does not take any parameters.

Return value

Type: Calendar

isNotifyOnCompletion method

Syntax

boolean value = batchInfo.isNotifyOnCompletion();

Parameters

This method does not take any parameters.

Return value

Type: boolean

setId method

Syntax

batchInfo.setId(id);

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: void

setNotifyOnCompletion method

Syntax

batchInfo.setNotifyOnCompletion(notifyOnCompletion);

Parameters

notifyOnCompletion

Type: boolean

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

Return value

Type: void

setSequenceName method

Syntax

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

Parameters

sequenceName

Type: String

The name to be assigned to the batch sequence

Return value

Type: void

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.