Slide 24
Slide 24 text
Example
function capturePage(app: Application, testName: string) {
return app.browserWindow.capturePage().then((img) => {
fs.writeFileSync(`${outputDir}/capture_${testName}.png`, img);
});
}
function reportLog(app: Application, testName: string) {
return Promise.all([
app.client.getRenderProcessLogs(),
app.client.getMainProcessLogs()
]).then(([ rendererLogs, mainLogs ]) => {
const logs = JSON.stringify({
renderer: rendererLogs,
main: mainLogs
});
fs.writeFileSync(`${outputDir}/logs_${testName}.txt`, logs, "utf8");
});
}