angular4-testing/project-manager-reactive/e2e/helpers/take_screenshot.ts

12 lines
321 B
TypeScript
Raw Normal View History

2017-02-24 22:54:59 +01:00
import { browser} from 'protractor';
import * as fs from 'fs';
declare var Buffer, module: any;
export function takeScreenshot(filename: string) {
return browser.takeScreenshot().then((data) => {
const stream = fs.createWriteStream(filename);
stream.write(new Buffer(data, 'base64'));
stream.end();
})
}