Output plugins used by protractor

2019-04-16 16:19发布

问题:

Protractor 2.0.0. introduces this neat idea of extending protractor with plugins offering several built-in plugins, like ngHint, console or timeline.

Currently, I'm trying to make the timeline plugin work and I'd like to see a more verbose output on the console in order to debug the problem.

Is it possible to see on the console what plugins are loaded by protractor?

FYI, created an issue: Protractor to report loaded plugins.

回答1:

No, I did not find something in the code of the plugins.js. If I run Protractor tests with enabled plugins, on the console I only see the result output of a plugins hook method. This assumes that the plugin has been loaded correctly.

I think this is a missing feature. I look forward on your (or someones) contribution for Issue 1961.



回答2:

I've sent a pull request (currently merged to the development protractor - master branch) closing the Protractor to report loaded plugins issue.

Now, if you run protractor with --troubleshoot flag, you'll get the list of loaded plugins:

DEBUG - Running with --troubleshoot
DEBUG - Protractor version: 2.1.0
DEBUG - Your base url for tests is http://127.0.0.1:9001
...
DEBUG - Plugin "/path/to/node_modules/protractor/plugins/console/index.js" loaded.
DEBUG - Plugin "/path/to/node_modules/protractor/plugins/timeline/index.js" loaded.