Skip to content

Commit

Permalink
Merge pull request #22 from samuelematias/lesson22
Browse files Browse the repository at this point in the history
Lesson 22: Using golden files to verify pixel-perfect widgets
  • Loading branch information
samuelematias committed Dec 2, 2020
2 parents 46698b1 + cdc0886 commit e5904e6
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Calculator - [Caster.IO](https://caster.io) project to showcase testing techniqu

[Lesson 21: Verifying interactions with mockito](https://caster.io/lessons/lesson-21-verifying-interactions-with-mockito) 👉🏾 [Branch](https://github.com/samuelematias/calculator_app/tree/lesson21)

[Lesson 22: Using golden files to verify pixel-perfect widgets](https://caster.io/lessons/lesson-22-using-golden-files-to-verify-pixel-perfect-widgets) 👉🏾 [Branch](https://github.com/samuelematias/calculator_app/tree/lesson22)

## License

```
Expand Down
8 changes: 8 additions & 0 deletions test/calculator_app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import 'package:flutter_test/flutter_test.dart';

void main() {
group('CalculatorApp', () {
testWidgets('matches golden file', (tester) async {
await tester.pumpWidget(CalculatorApp());
await expectLater(
find.byType(CalculatorApp),
matchesGoldenFile('goldens/calculator_app.png'),
);
});

testWidgets('renders four widgets of type TwoDigitOperation',
(WidgetTester tester) async {
await tester.pumpWidget(CalculatorApp());
Expand Down
Binary file added test/failures/calculator_app_isolatedDiff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/failures/calculator_app_maskedDiff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/failures/calculator_app_masterImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/failures/calculator_app_testImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/goldens/calculator_app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5904e6

Please sign in to comment.