mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(e2e): screenshot changes will display proper error message
closes #191 closes #192 Closes #194
This commit is contained in:
committed by
Jeremy Elbourn
parent
62265cc87f
commit
a3189e740b
+3
-3
@@ -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
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ba69049fdfdcffda020560f862c301494783d79ae13dc2befc377d679402b152
|
||||
size 22610
|
||||
Reference in New Issue
Block a user