mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
place failure screenshots in test/output
This commit is contained in:
parent
e3ac7f6dc0
commit
4cbfecf963
3 changed files with 11 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -10,7 +10,7 @@ target
|
|||
.idea
|
||||
*.iml
|
||||
*.log
|
||||
screenshot*.png
|
||||
/test/output
|
||||
/esvm
|
||||
.htpasswd
|
||||
.eslintcache
|
||||
|
|
0
test/output/.empty
Normal file
0
test/output/.empty
Normal file
|
@ -63,7 +63,7 @@ define(function (require) {
|
|||
|
||||
return function (reason) {
|
||||
var now = Date.now();
|
||||
var filename = path.resolve(['./screenshot', now, testName, '.png'].join('_'));
|
||||
var filename = ['failure', now, testName].join('_') + '.png';
|
||||
|
||||
return self.saveScreenshot(filename)
|
||||
.finally(function () {
|
||||
|
@ -73,11 +73,17 @@ define(function (require) {
|
|||
},
|
||||
|
||||
saveScreenshot: function saveScreenshot(filename) {
|
||||
this.debug('Test Failed, taking screenshot "' + filename + '"');
|
||||
var self = this;
|
||||
var outDir = path.resolve('test', 'output');
|
||||
|
||||
return this.remote.takeScreenshot()
|
||||
return self.remote.takeScreenshot()
|
||||
.then(function writeScreenshot(data) {
|
||||
fs.writeFileSync(filename, data);
|
||||
var filepath = path.resolve(outDir, filename);
|
||||
self.debug('Test Failed, taking screenshot "' + filepath + '"');
|
||||
fs.writeFileSync(filepath, data);
|
||||
})
|
||||
.catch(function (err) {
|
||||
self.log('SCREENSHOT FAILED: ' + err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue