Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(docs): only check for SEVERE logs in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tbosch committed Aug 30, 2014
1 parent 550ba01 commit 6c27b89
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/app/e2e/docsAppE2E.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use strict';

var webdriver = require('protractor/node_modules/selenium-webdriver');

// webdriver.logging.Type
describe('docs.angularjs.org', function () {

beforeEach(function() {
Expand All @@ -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));
}
});
});
Expand Down

0 comments on commit 6c27b89

Please sign in to comment.