reorganize old client tests

This commit is contained in:
Matteo Pagliazzi
2016-09-15 11:31:22 +02:00
parent a4fd687510
commit ab84e88650
52 changed files with 8 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
import fs from 'fs';
import { resetHabiticaDB } from '../../helpers/api-integration/mongo';
before(async () => {
await resetHabiticaDB();
});
// based on https://github.com/angular/protractor/issues/114#issuecomment-29046939
afterEach(async function () {
let lastTest = this.currentTest;
if (lastTest.state === 'failed') {
let filename = `exception_${lastTest.title}.png`;
let png = await browser.takeScreenshot();
let buffer = new Buffer(png, 'base64');
let stream = fs.createWriteStream(filename);
stream.write(buffer);
stream.end();
}
});