Integration test: screenshot timing

This commit is contained in:
DC
2016-09-20 14:35:23 -07:00
parent 3a286ae978
commit 7bf51b11ee
7 changed files with 5 additions and 23 deletions

View File

@@ -75,7 +75,9 @@ function screenshotCreateOrCompare (app, t, name) {
const ssPath = path.join(ssDir, name + '.png')
fs.ensureFileSync(ssPath)
const ssBuf = fs.readFileSync(ssPath)
return app.browserWindow.capturePage().then(function (buffer) {
return wait().then(function () {
return app.browserWindow.capturePage()
}).then(function (buffer) {
if (ssBuf.length === 0) {
console.log('Saving screenshot ' + ssPath)
fs.writeFileSync(ssPath, buffer)