How to use the testcafe-browser-tools.generateThumbnail function in testcafe-browser-tools

To help you get started, we’ve selected a few testcafe-browser-tools 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 DevExpress / testcafe / src / screenshots / capturer.js View on Github external
if (!await Capturer._isScreenshotCaptured(screenshotPath))
                return;

            const image = await readPngFile(screenshotPath);

            const croppedImage = await cropScreenshot(image, {
                markSeed,
                clientAreaDimensions,
                path:           screenshotPath,
                cropDimensions: Capturer._getCropDimensions(cropDimensions, pageDimensions)
            });

            if (croppedImage)
                await writePng(screenshotPath, croppedImage);

            await generateThumbnail(screenshotPath, thumbnailPath);
        });