Protractor 公开了一个 getProcessedConfig()
在全局 browser
对象上运行。该文档没有提供有关此功能何时有用的足够信息:
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.
getProcessedConfig()
涵盖哪些用例?有人用过吗?为什么?
最佳答案
getProcessedConfig()
允许查看项目中的所有配置值,包括配置和参数。 要轻松地在终端中查看输出,请尝试以下操作:
browser.getProcessedConfig().then(console.log);
如果您需要访问配置中的特定值,包括框架参数、multiCapabilities 和选项,则 processedConfigs 也很有用。我目前正在使用它来访问 Protractor config.js 文件中我的 onPrepare() 方法中的配置值。
关于javascript - Protractor 中的 browser.getProcessedConfig,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34488478/