fix(e2e): screenshot changes will display proper error message

closes #191
closes #192

Closes #194
This commit is contained in:
Robert Messerle
2016-03-17 10:40:02 -07:00
committed by Jeremy Elbourn
parent 62265cc87f
commit a3189e740b
4 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -58,14 +58,14 @@ class Screenshot {
let referenceScreenshot = mapnik.Image.open(this.path);
this.overwriteExistingScreenshot();
if (referenceScreenshot.compare(this.png)) {
throw new Error(`screenshot "${this.id}" has changed.`);
throw `screenshot "${this.id}" has changed.`;
} else {
console.info('[STATUS] Screenshot has not changed');
}
} catch (e) {
console.info(`[STATUS] No reference screenshot found`);
console.error(`[ERROR] `, e);
this.overwriteExistingScreenshot();
throw new Error(`screenshot "${this.id}" was not found.`);
throw e;
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ describe('hello, protractor', function () {
browser.get('/');
it('should have a title', function () {
expect(browser.getTitle()).toBe('Material2');
screenshot('initial state');
screenshot('demo page: index');
});
});
});
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:606958be9d1e0ec1cc3b5e361feee28d0b1bf52b0008c8afb0f03b21a5353a9e
size 23924
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ba69049fdfdcffda020560f862c301494783d79ae13dc2befc377d679402b152
size 22610