Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async takeScreenshot(filename: string): Promise {
const pathParts = parse(filename);
const outputDir = (pathParts.dir && pathParts.dir.length > 0) ? pathParts.dir : cwd();
return screen.capture(pathParts.name, FileType.PNG, outputDir);
},
async takeScreenshotWithTimestamp(filename: string): Promise {
async takeScreenshotWithTimestamp(filename: string): Promise {
const pathParts = parse(filename);
const outputDir = (pathParts.dir && pathParts.dir.length > 0) ? pathParts.dir : cwd();
return screen.capture(pathParts.name, FileType.PNG, outputDir, `${new Date().toISOString()}_`, "");
}
};