From 6c27b896766be4655eed5ec4106d3377b973b754 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 29 Aug 2014 16:58:53 -0700 Subject: [PATCH] fix(docs): only check for SEVERE logs in tests --- docs/app/e2e/docsAppE2E.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/app/e2e/docsAppE2E.js b/docs/app/e2e/docsAppE2E.js index 97889f6d4ae5..92b5e95d9589 100644 --- a/docs/app/e2e/docsAppE2E.js +++ b/docs/app/e2e/docsAppE2E.js @@ -1,5 +1,8 @@ 'use strict'; +var webdriver = require('protractor/node_modules/selenium-webdriver'); + +// webdriver.logging.Type describe('docs.angularjs.org', function () { beforeEach(function() { @@ -11,9 +14,12 @@ describe('docs.angularjs.org', function () { afterEach(function() { // verify that there were no console errors in the browser browser.manage().logs().get('browser').then(function(browserLog) { - expect(browserLog.length).toEqual(0); - if (browserLog.length) { - console.log('browser console errors: ' + require('util').inspect(browserLog)); + var filteredLog = browserLog.filter(function(logEntry) { + return logEntry.level.value > webdriver.logging.Level.WARNING.value; + }); + expect(filteredLog.length).toEqual(0); + if (filteredLog.length) { + console.log('browser console errors: ' + require('util').inspect(filteredLog)); } }); });