The information in this topic may be out of date. The current SDK reference guide has moved here.

setBatch method

Class: EyesPlatform: ImagesLanguage: JavaScript SDK:

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

In the Test Manager, all the results of tests that were executed as a single batch are displayed 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(batchOrName, batchId, startedAt);
eyes.setBatch(batchOrName, batchId);
eyes.setBatch(batchOrName);

Parameters

batchOrName
Type:
BatchInfo|BatchInfoObject|string

Type definitions

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 value is a falsey 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.