setBatch method

Class: EyesPlatform: Selenium 3Language: 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({id: string, name: string, startedAt: string})

Parameters

batchOrName
Type:string | {id: string, name: string, startedAt: string}
This parameter can be either a batch name string or an object. If it is an object, then it must have the following fields:
  • id: A unique identifier for all batches.
  • name: The batch name that will be displayed in the Test Editor batch panel.
  • startedAt : When the batch started (e.g. the current time). This should be in a format generated by Date().toUTCString().
If the parameter is a non-empty string, then it will be used as the batch name of the internally defined 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.
batchId
Type:string
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.
batchDate
Type:string
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.