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

12 lines
321 B
TypeScript

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();
})
}