Test with customised browser provider run on a real device.
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);
});
Expected result:
catch (err) {
// await deleteFile(screenshotPath);
console.error(err);
}
Or:
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.
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.