DarthOpto
DarthOpto

Reputation: 1652

Protractor Get Errors Only From Console, Ignore Warnings

I have a test which is navigating to a certain area of our application and then checking to see if there are any errors in the console when this area of the application is load.

The problem is that it is failing on a warning. Is there anyway from within my test that I can make it look just for errors and not warnings?

    it('Area of Application Loads With No Errors - Smoke', () => {
    console.log('\n ### Area of Applications Loads With No Errors ### \n')
    // Clear the Console before Navigating
    browser.manage().logs().get('browser')
    // Navigate
    common.navigationOpenByClick()
    navPage.navigateToApp(params.apps.areaOfApp.navLink)
    // Check the console for errors
    browser.manage().logs().get('browser').then(function(browserLog) {
        expect(browserLog.length).toEqual(0)
    })
})

Upvotes: 0

Views: 859

Answers (1)

Maximiliano alves
Maximiliano alves

Reputation: 140

Do you use multiCapabilities in your protractor.config file?

You can try this config below the browserName: "loggingPrefs": {"browser": "SEVERE", "INFO", "DEBUG"}, //OFF, SEVERE, WARNING, INFO, DEBUG, ALL

Upvotes: 2

Related Questions