mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
Take screenshot of failed e2e tests
This commit is contained in:
parent
3c5f9d7f8b
commit
c572a195aa
1 changed files with 16 additions and 0 deletions
|
|
@ -7,6 +7,22 @@ describe('front page', function() {
|
|||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
// based on https://github.com/angular/protractor/issues/114#issuecomment-29046939
|
||||
afterEach(function(){
|
||||
var currentSpec = jasmine.getEnv().currentSpec;
|
||||
var passed = currentSpec.results().passed();
|
||||
if(!passed){
|
||||
var filename = 'exception_' + currentSpec.description + '.png';
|
||||
browser.takeScreenshot().then(function(png){
|
||||
var fs = require('fs');
|
||||
var buffer = new Buffer(png, 'base64');
|
||||
var stream = fs.createWriteStream(filename);
|
||||
stream.write(buffer);
|
||||
stream.end();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it('shows the front page', function(){
|
||||
var button = element(by.className('btn'));
|
||||
expect(button.getText()).toEqual('Play');
|
||||
|
|
|
|||
Loading…
Reference in a new issue