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 Grouping tests into batches with the SDK for details and an example.

Create a new batch info

Default:

conf.batch = Applitools::BatchInfo.new

With custom properties:

conf.batch = Applitools::BatchInfo.new
conf.batch = Applitools::BatchInfo.new(name, started_at)
conf.batch = Applitools::BatchInfo.new(id: id, name: name, properties: properties, started_at)

All properties are optional. If these properties are not provided, the system will use the default values.

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.

properties property

Syntax

batch_info.properties  = value
value = batch_info.properties

Type: List[Dict[Text,Text]]

Pass one or more name/value pairs.

Remarks

  • Call this method after creating the BatchInfo object and before using the Eyes.batch or Configuration.set_batch method to associate the batch with the test (before the test is started).
  • Set multiple properties by calling BatchInfo.add_property multiple times with the same property name and different values.
  • You should not assign a given value to a property more than once in a given batch run.
  • You can also associate properties with a specific test using Configuration.add_property or Configuration.properties.

name property

Syntax

//typical code sequence using sequence_name
Batchinfo batchInfo = new BatchInfo()
batchInfo.name = 'my batch 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.