We do something like this already but because we have three processes that interact we scripted puppeteer to hook into all three in different tabs and automatically refresh the tabs when the processes restart.
It also clicks into the console to start and turns off screencasting, etc.
Here's a gist of the main part: https://gist.github.com/natew/66515fb49d895315e139059302cd47...