Skip to content

Instantly share code, notes, and snippets.

@dictav
Created March 5, 2017 15:57
Show Gist options
  • Save dictav/da1a279580446b2fb8f5ecd5484bf9b0 to your computer and use it in GitHub Desktop.
Save dictav/da1a279580446b2fb8f5ecd5484bf9b0 to your computer and use it in GitHub Desktop.
'use strict'
const assert = require('assert')
describe('Console Log', () => {
it('gets the title of dictav.net', () => {
const title = browser.url('https://dictav.net').getTitle()
assert.equal(title, 'DICTAV')
})
it('has no SEVERE error', () => {
browser.call(function() {
// wait 500msec to load js
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, 500)
})
})
try {
// Because `log/types` is not webdriver specification, the exception is occured on cloud
const errors = browser.log('browser').value
for (var i = 0; i < errors.length; i++) {
var err = errors[i]
assert (err.level !== 'SEVERE', err.message)
}
} catch(err) { }
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment