setBatch method

Class: EyesPlatform: Selenium 4Language: JavaScript SDK:

Use this method to set the batch information for this test.

In the Test manager, all the results of tests that were batched together are shown together and can be managed and operated on as a group. See How to organize your tests with batches and How to group tests into batches using the SDK for details and an example.

Syntax


eyes.setBatch()
eyes.setBatch(batchOrName)
eyes.setBatch(batchOrName,batchId)
eyes.setBatch(batchOrName,batchId, batchDate)
eyes.setBatch(new BatchInfo(batchOrName))

Parameters

batchOrName
Type:BatchInfo|BatchInfoObject|string
This parameter can be either a batch name string or a BatchInfo object. If it is an object, then the batch takes its properties from that object. If the parameter is a non-empty string, then it will be used as the batch name of the internally generated batch object. If the parameter value is falsy, and the environment value APPLITOOLS_BATCH_NAME is defined then the value of the environment variable will be used as the batch name. Otherwise, an internal name will be generated.
BatchInfoObject
The type BatchInfoObject is defined as: {id:(string|undefined),name:(string|undefined),startedAt:(Date|string|undefined),sequenceName:(string|undefined),notifyOnCompletion:(boolean|undefined)}
batchId
Type:string [Optional ]
If the first parameter is a batch name string (and not a BatchInfo object), then the value passed for this parameter will be used as the id of the created object. All tests that have the same batch id will appear in the Test results in the same batch. If the value is a falsy value or is not passed and the environment variable APPLITOOLS_BATCH_ID is defined, then the value of the environment variable will be used as the ID. Otherwise, an internal id will be generated.
startedAt
Type:string [Optional ]
If the first parameter is a batch name string (and not a BatchInfo object), then the value passed for this parameter will be used as the start date of the created object. It should be in the same format as Date().toUTCString(). If the value is a falsy value or is not passed, then the current date and time will be used.

Return value

Type:

Remarks

Call this method once before the calls to the open method for all tests that are supposed to be part of this batch.