Ensure screenshotter runs *all* tests. (#769)

Previously, we added a `oneDone` promise *every time a test attempt
failed*. This decremented the count of remaining tests once per
failed attempt. As a result, Chrome tests didn't run to the end.
This commit is contained in:
Eddie Kohler
2017-07-29 21:27:27 -04:00
committed by Kevin Barabash
parent 8c53698b35
commit 32c7fc47d1

View File

@@ -406,7 +406,12 @@ function takeScreenshot(key) {
if (opts.wait) {
browserSideWait(1000 * opts.wait);
}
driver.takeScreenshot().then(haveScreenshot).then(oneDone, check);
const promise = driver.takeScreenshot().then(haveScreenshot);
if (retry === 0) {
// The `oneDone` promise remains outstanding if we retry, so
// don't re-add it
promise.then(oneDone, check);
}
}
function haveScreenshot(img) {