May 2018
Intermediate to advanced
492 pages
12h 3m
English
Another useful tactic is to generate a trace of what happened so you can puzzle away. Inserting console.log statements is tedious and makes your code look a little ugly. Puppeteer offers a couple of methods to trace the actions and to dynamically turn off tracing.
In uitest.js, add this code:
function frameEvent(evtname, frame) { console.log(`${evtname} ${frame.url()} ${frame.title()}`);}function ignoreURL(url) { if (url.match(/\/assets\//) === null && url.match(/\/socket.io\//) === null && url.match(/fonts.gstatic.com/) === null && url.match(/fonts.googleapis.com/) === null) { return false; } else { return true; }}...before(async function() { browser = await puppeteer.launch({ slomo: ...Read now
Unlock full access