How to use the @nut-tree/nut-js.screen.capture function in @nut-tree/nut-js

To help you get started, we’ve selected a few @nut-tree/nut-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sakuli / sakuli / packages / sakuli-legacy / src / context / common / actions / screen.function.ts View on Github external
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 {
github sakuli / sakuli / packages / sakuli-legacy / src / context / common / actions / screen.function.ts View on Github external
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()}_`, "");
    }
};