Danny Danny - 1 year ago 90
AngularJS Question

Globally start a helper function

I want to test for the console errors in my application?

I know how to get them using

browser.manage().logs().get('browser').then(function(browserLog) {})

in afterEach()

What i want to achieve is that i want to use it globally. As in, I don't want to call the helper function in every spec. I want to run it by default when I start the config file and detect if any errors appear in the console.

Answer Source

As @TehBeardedOne suggested in the comments above, you can do this using the onComplete() function of your config file.

onComplete: function () {
    browser.manage().logs().get('browser').then(function(browserLog) {


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download