Is it possible to read the console?
Is it possible for protractor to read the console of Chrome?
Like for an example I got a function that sents a email to me with something in it, but it logs in the console if it went alright. So could I assert that the console returns ok?
don't know if protractor/webdriver can do sth. like this, but you can redefine console.log inside your test with a spy and check the arguments what it was called with.
Can you show me an example?
jasmine:
console.log = jasmine.createSpy("console log")
And then use usual jasmine matchers on that spy.
or do it yourself (untested, out of my head):
var consoleArgs, _log = console.log;
console.log = function() {
consoleArgs = arguments;
_log.apply(this, arguments);
}
I think this is obsolete? closing.