diff --git a/test/gym_mode_1.png b/test/gym_mode_1.png new file mode 100644 index 00000000..f08a4de7 Binary files /dev/null and b/test/gym_mode_1.png differ diff --git a/test/gym_mode_2.png b/test/gym_mode_2.png new file mode 100644 index 00000000..032f38b5 Binary files /dev/null and b/test/gym_mode_2.png differ diff --git a/test/gym_mode_3.png b/test/gym_mode_3.png new file mode 100644 index 00000000..e2222ed2 Binary files /dev/null and b/test/gym_mode_3.png differ diff --git a/test/gym_mode_4.png b/test/gym_mode_4.png new file mode 100644 index 00000000..54e92f61 Binary files /dev/null and b/test/gym_mode_4.png differ diff --git a/test/gym_mode_5.png b/test/gym_mode_5.png new file mode 100644 index 00000000..b8b106b6 Binary files /dev/null and b/test/gym_mode_5.png differ diff --git a/test/gym_mode_6.png b/test/gym_mode_6.png new file mode 100644 index 00000000..94923431 Binary files /dev/null and b/test/gym_mode_6.png differ diff --git a/test/gym_mode_7.png b/test/gym_mode_7.png new file mode 100644 index 00000000..cbee7e31 Binary files /dev/null and b/test/gym_mode_7.png differ diff --git a/test/gym_mode_screen_test.dart b/test/gym_mode_screen_test.dart index 1b938642..668f8999 100644 --- a/test/gym_mode_screen_test.dart +++ b/test/gym_mode_screen_test.dart @@ -80,6 +80,8 @@ void main() { expect(find.byIcon(Icons.chevron_left), findsNothing); expect(find.byIcon(Icons.exit_to_app), findsOneWidget); expect(find.byIcon(Icons.chevron_right), findsOneWidget); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('gym_mode_1.png')); + await tester.tap(find.byIcon(Icons.chevron_right)); await tester.pumpAndSettle(); @@ -89,6 +91,7 @@ void main() { expect(find.byIcon(Icons.chevron_left), findsOneWidget); expect(find.byIcon(Icons.exit_to_app), findsOneWidget); expect(find.byIcon(Icons.chevron_right), findsOneWidget); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('gym_mode_2.png')); await tester.drag(find.byType(ExerciseOverview), Offset(-500.0, 0.0)); await tester.pumpAndSettle(); @@ -102,6 +105,7 @@ void main() { expect(find.byIcon(Icons.chevron_left), findsOneWidget); expect(find.byIcon(Icons.exit_to_app), findsOneWidget); expect(find.byIcon(Icons.chevron_right), findsOneWidget); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('gym_mode_3.png')); await tester.drag(find.byType(LogPage), Offset(-500.0, 0.0)); await tester.pumpAndSettle(); @@ -111,6 +115,7 @@ void main() { expect(find.byIcon(Icons.chevron_left), findsOneWidget); expect(find.byIcon(Icons.exit_to_app), findsOneWidget); expect(find.byIcon(Icons.chevron_right), findsOneWidget); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('gym_mode_4.png')); await tester.tap(find.byIcon(Icons.chevron_right)); await tester.pumpAndSettle(); @@ -118,6 +123,7 @@ void main() { expect(find.text('test exercise 1'), findsOneWidget); expect(find.byType(LogPage), findsOneWidget); expect(find.byType(Form), findsOneWidget); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('gym_mode_5.png')); await tester.drag(find.byType(LogPage), Offset(-500.0, 0.0)); await tester.pumpAndSettle(); @@ -127,6 +133,7 @@ void main() { expect(find.byIcon(Icons.chevron_left), findsOneWidget); expect(find.byIcon(Icons.exit_to_app), findsOneWidget); expect(find.byIcon(Icons.chevron_right), findsOneWidget); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('gym_mode_6.png')); await tester.tap(find.byIcon(Icons.chevron_right)); await tester.pumpAndSettle(); @@ -137,6 +144,7 @@ void main() { expect(find.byIcon(Icons.chevron_left), findsOneWidget); expect(find.byIcon(Icons.exit_to_app), findsOneWidget); expect(find.byIcon(Icons.chevron_right), findsNothing); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('gym_mode_7.png')); // }); diff --git a/test/nutritional_meal_form.png b/test/nutritional_meal_form.png new file mode 100644 index 00000000..cdb8eb4d Binary files /dev/null and b/test/nutritional_meal_form.png differ diff --git a/test/nutritional_meal_form_test.dart b/test/nutritional_meal_form_test.dart index 49d242a5..c5c52aff 100644 --- a/test/nutritional_meal_form_test.dart +++ b/test/nutritional_meal_form_test.dart @@ -114,4 +114,9 @@ void main() { // Detail page // ... }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen(meal1)); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('nutritional_meal_form.png')); + }); } diff --git a/test/nutritional_plan_form.png b/test/nutritional_plan_form.png new file mode 100644 index 00000000..b660e918 Binary files /dev/null and b/test/nutritional_plan_form.png differ diff --git a/test/nutritional_plan_form_test.dart b/test/nutritional_plan_form_test.dart index a9aedd2d..488c4f7f 100644 --- a/test/nutritional_plan_form_test.dart +++ b/test/nutritional_plan_form_test.dart @@ -118,4 +118,9 @@ void main() { await tester.pumpAndSettle(); expect(find.text(('New cool plan')), findsOneWidget, reason: 'Nutritional plan detail page'); }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen(plan1)); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('nutritional_plan_form.png')); + }); } diff --git a/test/nutritional_plan_screen.png b/test/nutritional_plan_screen.png new file mode 100644 index 00000000..1ce518ee Binary files /dev/null and b/test/nutritional_plan_screen.png differ diff --git a/test/nutritional_plan_screen_test.dart b/test/nutritional_plan_screen_test.dart index ecf04886..1ab8ca7b 100644 --- a/test/nutritional_plan_screen_test.dart +++ b/test/nutritional_plan_screen_test.dart @@ -87,4 +87,9 @@ void main() { expect(find.text('17:00'), findsOneWidget); }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createNutritionalPlan()); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('nutritional_plan_screen.png')); + }); } diff --git a/test/nutritional_plans_screen.png b/test/nutritional_plans_screen.png new file mode 100644 index 00000000..09efe45d Binary files /dev/null and b/test/nutritional_plans_screen.png differ diff --git a/test/nutritional_plans_screen_test.dart b/test/nutritional_plans_screen_test.dart index fa7a235e..cb629b6e 100644 --- a/test/nutritional_plans_screen_test.dart +++ b/test/nutritional_plans_screen_test.dart @@ -106,4 +106,9 @@ void main() { expect(find.text('1.1.2021'), findsOneWidget); expect(find.text('10.1.2021'), findsOneWidget); }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen()); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('nutritional_plans_screen.png')); + }); } diff --git a/test/weight_screen.png b/test/weight_screen.png new file mode 100644 index 00000000..c2836ee3 Binary files /dev/null and b/test/weight_screen.png differ diff --git a/test/weight_screen_test.dart b/test/weight_screen_test.dart index 17a4dcb9..96508919 100644 --- a/test/weight_screen_test.dart +++ b/test/weight_screen_test.dart @@ -107,4 +107,9 @@ void main() { expect(find.text('1.1.2021'), findsOneWidget); expect(find.text('10.1.2021'), findsOneWidget); }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen()); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('weight_screen.png')); + }); } diff --git a/test/workout_day_form.png b/test/workout_day_form.png new file mode 100644 index 00000000..ebf54740 Binary files /dev/null and b/test/workout_day_form.png differ diff --git a/test/workout_day_form_test.dart b/test/workout_day_form_test.dart index 8111f4e1..28849f2b 100644 --- a/test/workout_day_form_test.dart +++ b/test/workout_day_form_test.dart @@ -98,4 +98,9 @@ void main() { expect(find.text('Dienstag'), findsOneWidget); expect(find.text('Donnerstag'), findsOneWidget); }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen()); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('workout_day_form.png')); + }); } diff --git a/test/workout_form.png b/test/workout_form.png new file mode 100644 index 00000000..c10e696f Binary files /dev/null and b/test/workout_form.png differ diff --git a/test/workout_form_test.dart b/test/workout_form_test.dart index 92b89519..96d44277 100644 --- a/test/workout_form_test.dart +++ b/test/workout_form_test.dart @@ -106,4 +106,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text(('New cool workout')), findsOneWidget, reason: 'Workout plan detail page'); }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen(plan2)); + await tester.pumpAndSettle(); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('workout_form.png')); + }); } diff --git a/test/workout_plan_screen.png b/test/workout_plan_screen.png new file mode 100644 index 00000000..86edc8b6 Binary files /dev/null and b/test/workout_plan_screen.png differ diff --git a/test/workout_plan_screen_test.dart b/test/workout_plan_screen_test.dart index 6ba411e9..2d6496d3 100644 --- a/test/workout_plan_screen_test.dart +++ b/test/workout_plan_screen_test.dart @@ -83,4 +83,12 @@ void main() { expect(find.text('Montag, Dienstag'), findsOneWidget); expect(find.text('Donnerstag'), findsOneWidget); }); + + // flutter test --update-goldens + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen()); + await tester.tap(find.byType(TextButton)); + await tester.pumpAndSettle(); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('workout_plan_screen.png')); + }); } diff --git a/test/workout_plan_screens.png b/test/workout_plan_screens.png new file mode 100644 index 00000000..935a6206 Binary files /dev/null and b/test/workout_plan_screens.png differ diff --git a/test/workout_plans_screen_test.dart b/test/workout_plans_screen_test.dart index 57facade..03af2df3 100644 --- a/test/workout_plans_screen_test.dart +++ b/test/workout_plans_screen_test.dart @@ -108,4 +108,9 @@ void main() { expect(find.text('1.1.2021'), findsOneWidget); expect(find.text('12.2.2021'), findsOneWidget); }); + + testWidgets('Golden test', (WidgetTester tester) async { + await tester.pumpWidget(createHomeScreen()); + await expectLater(find.byType(MaterialApp), matchesGoldenFile('workout_plan_screens.png')); + }); }