DriverProviders define ways that the Protractor runner can connect to WebDriver.
Each file exports a function which takes in the configuration as a parameter and returns a new DriverProvider, which has the following interface:
/**
* @return {q.promise} A promise which will resolve when the environment is
* ready to test.
*/
DriverProvider.prototype.setupDriverEnv
/**
* @return {Array.<webdriver.WebDriver>} Array of existing webdriver instances.
*/
DriverProvider.prototype.getExistingDrivers
/**
* @return {webdriver.WebDriver} A new setup driver instance.
*/
DriverProvider.prototype.getNewDriver
/**
* @param {webdriver.WebDriver} The driver instance to quit.
* @return {webdriver.promise.Promise<void>} A promise which resolves when the instance has quit
*/
DriverProvider.prototype.quitDriver
/**
* @return {q.Promise<any>} A promise which will resolve when the environment is down.
*/
DriverProvider.prototype.teardownEnv
/**
* This is an optional function. If defined, it will be called with the final
* status of the test suite (pass/fail) once it is completed.
*
* @param {{passed: boolean}}
* @return {q.promise} A promise that will resolve when the update is complete.
*/
DriverProvider.prototype.updateJob-
setupDriverEnvwill be called before the test framework is loaded, so any pre-work which might cause timeouts on the first test should be done there.getNewDriverwill be called once right aftersetupDriverEnvto generate the initial driver, and possibly during the middle of the test if users request additional browsers. -
teardownEnvshould call the driver'squitmethod.