Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit bf211d6

Browse files
authored
[web] Fix screenshot tests running locally (#31054)
1 parent cc5852a commit bf211d6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

web_sdk/web_test_utils/lib/image_compare.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Future<String> compareImage(
4040

4141
final String screenshotPath = _getFullScreenshotPath(filename);
4242
final File screenshotFile = File(screenshotPath);
43+
await screenshotFile.create(recursive: true);
4344
await screenshotFile.writeAsBytes(encodePng(screenshot), flush: true);
4445

4546
if (_isLuci) {
@@ -59,9 +60,12 @@ Future<String> compareImage(
5960

6061
if (golden == null) {
6162
// This is a new screenshot that doesn't have an existing golden.
62-
return 'No golden was found for "$filename". If this is a new screenshot'
63-
'test, please take a look at the generated screenshot:\n\n'
64-
'* file://$screenshotPath\n';
63+
64+
// At the moment, we don't support local screenshot testing because we use
65+
// Skia Gold to handle our screenshots and diffing. In the future, we might
66+
// implement local screenshot testing if there's a need.
67+
print('Screenshot generated: file://$screenshotPath');
68+
return 'OK';
6569
}
6670

6771
// Compare screenshots.

0 commit comments

Comments
 (0)