Can Protractor test an Angular app that is disabled by debugInfoEnabled?

I wanted to optimize our Angular app using version 1.3 is recommended $compileProvider.debugInfoEnabled(false);

When this setting is enabled, Protractor tests stop working as Protractor seems to rely on some of this information for Angular related crawlers. What would be the correct way to test E2E with Protractor when your Angular debug information is disabled?

+3


source to share


2 answers


@christianrondeau suggested on the Protractor GitHub forums :

onPrepare: function () {
  browser.executeScript('window.name = "NG_ENABLE_DEBUG_INFO"');
}

      



Is there a more elegant way to use Angular on a angular.reloadWithDebugInfo();

call condition ?

+1


source


The recommended answer didn't work for me. If it matters, we're running an Angular / AngularJS hybrid app, but I think it's more important that our login page isn't written in AngularJS, so I'm pretty sure using the solution onPrepare

won't work since AngularJS is loaded after the initial testing phase.



However, the work was the solution mentioned at the bottom of this Github page and this was to be used browser.executeScript('angular.reloadWithDebugInfo()');

. I have this call happening at the end of our login page and after we have tested the Angular elements that will be present on the page using basic element selectors.

0


source







All Articles