BatchInfo method

Class: BatchInfoPlatform: Selenium 4Language: JavaScript SDK:

The constructor for the BatchInfo class.

Create the object, set it up and assign it to the batch using Configuration.setBatch method or Eyes.setBatch method before tests are started. See How to group tests into batches using the SDK for more details and an example.

Syntax


//overloaded methods
let batchinfo = new BatchInfo()
let batchinfo = new BatchInfo({id: uniqueID, name: "My Batch", startedAt: new Date(2019,4,13)})
let batchinfo = new BatchInfo({id: uniqueID, name: "My Batch", startedAt: "13th April 2019")
let batchinfo = new BatchInfo("My Batch")
let batchinfo = new BatchInfo("My Batch", new Date(2019,4,13))
let batchinfo = new BatchInfo("My Batch", new Date(2019,4,13), uniqueID)

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:Date|string [Optional ]

The date and time that will be displayed in the Test Manager as the batch start time. If the parameter is not passed, or a value of is passed, then the run time will be the time at which the constructor was called.

id
Type:string [Optional ]
The unique id of the batch. If passed as null, and the environment variable APPLITOOLS_BATCH_ID is defined, then its value will be used as the id. If the environment variable is not defined then an internal unique id will be generated and used.

Return value

Type: BatchInfo