vendredi 3 août 2018

Puppeteer console.log - how to look inside JSHandle@object?

I have a React/Redux app that I am testing using Puppeteer. Based on the documentation, I am using the following code to show the console outputs:

page.on('console', msg => {
    for(let i = 0; i < msg.args().length; ++i) {
        let text = msg.args()[i];
        console.log(`${i}: ${text}`);
    }
});

However, when the redux-logger logs an object to console (prevState, nextState), puppeeter shows JSHandle@object in my console outputs instead. How do I see the keys and properties inside this object?

Aucun commentaire:

Enregistrer un commentaire