| 35 | * @experimental This API will be moved to Protractor. |
| 36 | */ |
| 37 | export function verifyNoBrowserErrors() { |
| 38 | // TODO(tbosch): Bug in ChromeDriver: Need to execute at least one command |
| 39 | // so that the browser logs can be read out! |
| 40 | browser.executeScript('1+1'); |
| 41 | browser |
| 42 | .manage() |
| 43 | .logs() |
| 44 | .get('browser') |
| 45 | .then(function (browserLog: any) { |
| 46 | const filteredLog = browserLog.filter(function (logEntry: any) { |
| 47 | if (logEntry.level.value >= webdriver.logging.Level.INFO.value) { |
| 48 | console.log('>> ' + logEntry.message); |
| 49 | } |
| 50 | return logEntry.level.value > webdriver.logging.Level.WARNING.value; |
| 51 | }); |
| 52 | expect(filteredLog).toEqual([]); |
| 53 | }); |
| 54 | } |