From 1dd292cb0f7de5a6cafabf08650ef747d8074dbe Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Tue, 25 Jan 2022 10:57:59 -0500 Subject: [PATCH] [web] Fix screenshot tests running locally --- web_sdk/web_test_utils/lib/image_compare.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web_sdk/web_test_utils/lib/image_compare.dart b/web_sdk/web_test_utils/lib/image_compare.dart index 7f20f79740373..b36a32cab0e4b 100644 --- a/web_sdk/web_test_utils/lib/image_compare.dart +++ b/web_sdk/web_test_utils/lib/image_compare.dart @@ -40,6 +40,7 @@ Future compareImage( final String screenshotPath = _getFullScreenshotPath(filename); final File screenshotFile = File(screenshotPath); + await screenshotFile.create(recursive: true); await screenshotFile.writeAsBytes(encodePng(screenshot), flush: true); if (_isLuci) { @@ -59,9 +60,12 @@ Future compareImage( if (golden == null) { // This is a new screenshot that doesn't have an existing golden. - return 'No golden was found for "$filename". If this is a new screenshot' - 'test, please take a look at the generated screenshot:\n\n' - '* file://$screenshotPath\n'; + + // At the moment, we don't support local screenshot testing because we use + // Skia Gold to handle our screenshots and diffing. In the future, we might + // implement local screenshot testing if there's a need. + print('Screenshot generated: file://$screenshotPath'); + return 'OK'; } // Compare screenshots.