Testcafe: Screenshot is not saved when TestCafe fails to detect page area

Created on 12 Mar 2019  路  2Comments  路  Source: DevExpress/testcafe

What is your Test Scenario?


Test with customised browser provider run on a real device.

What is the Current behavior?


With [email protected] the screenshot will be deleted if there is no Crop Dimensions.
The following code is introduced in 0f86212

await addToQueue(screenshotPath, async () => {
            await this._takeScreenshot(screenshotPath, ... pageDimensions ? [pageDimensions.innerWidth, pageDimensions.innerHeight] : []);

            if (!await Capturer._isScreenshotCaptured(screenshotPath))
                return;

            try {
                const binaryImage = await readFile(screenshotPath);

                const croppedImage = await cropScreenshot(
                    screenshotPath,
                    markSeed,
                    Capturer._getClientAreaDimensions(pageDimensions),
                    Capturer._getCropDimensions(cropDimensions, pageDimensions),
                    binaryImage
                );

                if (croppedImage)
                    await writePng(screenshotPath, croppedImage);
            }
            catch (err) {
                await deleteFile(screenshotPath);

                throw err;
            }

            await generateThumbnail(screenshotPath, thumbnailPath);
        });

What is the Expected behavior?


Expected result:

  • Allow to save the fullscreen screenshot without any chop, which means:
            catch (err) {
                // await deleteFile(screenshotPath);

                console.error(err);
            }

Or:

  • Provide method in Browser Provide to fill in cropDimensions.

Your Environment details:

  • testcafe version: 1.1.0
  • node.js version: v8.9.3
  • browser name and version: UC Browser 12.0.4
  • platform and version: Android 7.1.1
server level 2 Auto-locked screenshot capturing bug

Most helpful comment

Thank you for your report. Yes, TestCafe doesn't save a screenshot now if it can't detect a page area in the screenshot. In previous versions, TestCafe showed a warning in this case and saved a screenshot. We will fix this bug in the next development sprint.

All 2 comments

Thank you for your report. Yes, TestCafe doesn't save a screenshot now if it can't detect a page area in the screenshot. In previous versions, TestCafe showed a warning in this case and saved a screenshot. We will fix this bug in the next development sprint.

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndreyBelym picture AndreyBelym  路  3Comments

ParachuteCat picture ParachuteCat  路  3Comments

Lukas-Kullmann picture Lukas-Kullmann  路  3Comments

darkowic picture darkowic  路  3Comments

madroneropaulo picture madroneropaulo  路  3Comments