Protractor exposes a getProcessedConfig()
function on a global browser
object. The documentation does not give enough information on when this function can be helpful:
Get the processed configuration object that is currently being run. This will contain the specs and capabilities properties of the current runner instance.
Set by the runner.
What use cases does getProcessedConfig()
cover? Has someone used it before and why?
getProcessedConfig()
Allows all the configuration values from a project to be viewable, including configurations and parameters. To easily view the output into the terminal, try this:
browser.getProcessedConfig().then(console.log);
The processedConfigs can also be useful if you need to access specific values in the configurations, including framework parameters, multiCapabilities and options. I am currently using it to access a configuration value in my onPrepare() method, within my protractor config.js file.