The application under test emits 'page-load' event after every page load and I want to take screenshot after the page has successfully loaded. Tried to listen for this event using Leadfoot's execute method. But it does not seem to work. Can anyone point out if there is a way to successfully listen to events like page-load.
return remote.get(URL)
.execute(function() {
window.addEventListener('page-load', function() {
console.log("Page ready");
}, false);
}, [])
.takeScreenshot().then(function(data) {
recordImage(newAddress, data);
})