Unverified Commit 820a009f authored by Yegor's avatar Yegor Committed by GitHub

[web] skip flaky date picker golden tests (#111114)

parent 4453ba0a
...@@ -19,6 +19,9 @@ import 'package:flutter/material.dart'; ...@@ -19,6 +19,9 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
// TODO(yjbanov): on the web text rendered with perspective produces flaky goldens: https://github.com/flutter/flutter/issues/110785
const bool skipPerspectiveTextGoldens = isBrowser;
// A number of the hit tests below say "warnIfMissed: false". This is because // A number of the hit tests below say "warnIfMissed: false". This is because
// the way the CupertinoPicker works, the hits don't actually reach the labels, // the way the CupertinoPicker works, the hits don't actually reach the labels,
// the scroll view intercepts them. // the scroll view intercepts them.
...@@ -1194,31 +1197,39 @@ void main() { ...@@ -1194,31 +1197,39 @@ void main() {
} }
await tester.pumpWidget(buildApp(CupertinoDatePickerMode.time)); await tester.pumpWidget(buildApp(CupertinoDatePickerMode.time));
await expectLater( if (!skipPerspectiveTextGoldens) {
find.byType(CupertinoDatePicker), await expectLater(
matchesGoldenFile('date_picker_test.time.initial.png'), find.byType(CupertinoDatePicker),
); matchesGoldenFile('date_picker_test.time.initial.png'),
);
}
await tester.pumpWidget(buildApp(CupertinoDatePickerMode.date)); await tester.pumpWidget(buildApp(CupertinoDatePickerMode.date));
await expectLater( if (!skipPerspectiveTextGoldens) {
find.byType(CupertinoDatePicker), await expectLater(
matchesGoldenFile('date_picker_test.date.initial.png'), find.byType(CupertinoDatePicker),
); matchesGoldenFile('date_picker_test.date.initial.png'),
);
}
await tester.pumpWidget(buildApp(CupertinoDatePickerMode.dateAndTime)); await tester.pumpWidget(buildApp(CupertinoDatePickerMode.dateAndTime));
await expectLater( if (!skipPerspectiveTextGoldens) {
find.byType(CupertinoDatePicker), await expectLater(
matchesGoldenFile('date_picker_test.datetime.initial.png'), find.byType(CupertinoDatePicker),
); matchesGoldenFile('date_picker_test.datetime.initial.png'),
);
}
// Slightly drag the hour component to make the current hour off-center. // Slightly drag the hour component to make the current hour off-center.
await tester.drag(find.text('4'), Offset(0, _kRowOffset.dy / 2), warnIfMissed: false); // see top of file await tester.drag(find.text('4'), Offset(0, _kRowOffset.dy / 2), warnIfMissed: false); // see top of file
await tester.pump(); await tester.pump();
await expectLater( if (!skipPerspectiveTextGoldens) {
find.byType(CupertinoDatePicker), await expectLater(
matchesGoldenFile('date_picker_test.datetime.drag.png'), find.byType(CupertinoDatePicker),
); matchesGoldenFile('date_picker_test.datetime.drag.png'),
);
}
}); });
testWidgets('DatePicker displays the date in correct order', (WidgetTester tester) async { testWidgets('DatePicker displays the date in correct order', (WidgetTester tester) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment