Skip to content

Commit a3189e7

Browse files
Robert Messerlejelbourn
authored andcommitted
fix(e2e): screenshot changes will display proper error message
closes #191 closes #192 Closes #194
1 parent 62265cc commit a3189e7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

e2e/_screenshot.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ class Screenshot {
5858
let referenceScreenshot = mapnik.Image.open(this.path);
5959
this.overwriteExistingScreenshot();
6060
if (referenceScreenshot.compare(this.png)) {
61-
throw new Error(`screenshot "${this.id}" has changed.`);
61+
throw `screenshot "${this.id}" has changed.`;
6262
} else {
6363
console.info('[STATUS] Screenshot has not changed');
6464
}
6565
} catch (e) {
66-
console.info(`[STATUS] No reference screenshot found`);
66+
console.error(`[ERROR] `, e);
6767
this.overwriteExistingScreenshot();
68-
throw new Error(`screenshot "${this.id}" was not found.`);
68+
throw e;
6969
}
7070
}
7171

e2e/index.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('hello, protractor', function () {
55
browser.get('/');
66
it('should have a title', function () {
77
expect(browser.getTitle()).toBe('Material2');
8-
screenshot('initial state');
8+
screenshot('demo page: index');
99
});
1010
});
1111
});
Lines changed: 3 additions & 0 deletions
Loading

screenshots/initial state.screenshot.png

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)