Skip to main content

BatchInfo class

Call the Configuration.set_batch method or Eyes.batch property 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

from applitools.selenium import BatchInfo

BatchInfo method

Syntax

batch_info = BatchInfo(name, started_at)

batch_info = BatchInfo(name)

batch_info = BatchInfo()

Parameters

name

Type: Text [Optional : default = None ]

The name of the batch. If a None 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.

started_at

Type: datetime [Optional : default = None ]

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

Return value

Type: None

id property

Syntax

batch_info.id  = value
value = batch_info.id

Type: Text

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.

name property

Syntax

batch_info.name  = value
value = batch_info.name

Type: Text

The name of the batch.

notify_on_completion property

Syntax

batch_info.notify_on_completion  = value
value = batch_info.notify_on_completion

Type: bool

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

properties property

Syntax

batch_info.properties  = value
value = batch_info.properties

Type: List[Dict[Text,Text]]

Pass one or more name/value pairs.

Remarks

name property

Syntax

//typical code sequence using sequence_name
Batchinfo batchInfo = new BatchInfo()
batchInfo.name = 'my batch name'
batchInfo.sequence_name = 'My sequence name'
eyes.batch = batchInfo

Type: Text

The name to be assigned to the batch sequence

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.

started_at property

Syntax

batch_info.started_at  = value
value = batch_info.started_at

Type: datetime

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

add_property method

Syntax

value = batch_info.add_property(name, value)

Parameters

name

Type: Text

The name of the property.

value

Type: Text

The value to be associated with this property.

Return value

Type: BatchInfo

Remarks

with_batch_id method

Syntax

value = batch_info.with_batch_id(id)

Parameters

id

Type: Text

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.

Return value

Type: BatchInfo

Remarks

This command is intended for use instead of the id property. It can be called as part of the constructor of the Batchinfo object as shown in the syntax section.