From 271572c20eda84554e647d66bedd3437482ede82 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 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/app/e2e/docsAppE2E.js b/docs/app/e2e/docsAppE2E.js index 97889f6d4ae5..d6878241addb 100644 --- a/docs/app/e2e/docsAppE2E.js +++ b/docs/app/e2e/docsAppE2E.js @@ -1,5 +1,7 @@ 'use strict'; +var webdriver = require('protractor/node_modules/selenium-webdriver'); + describe('docs.angularjs.org', function () { beforeEach(function() { @@ -11,9 +13,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)); } }); });