diff --git a/integration_tests/forgot_test.dart b/integration_tests/forgot_test.dart new file mode 100644 index 0000000..ad85abc --- /dev/null +++ b/integration_tests/forgot_test.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; + +import 'package:thdapp/main.dart' as app; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + group('forgot password test', () { + testWidgets('enter email details', + (tester) async { + app.main(); + await tester.pumpAndSettle(); + + // Tap the forgot password button + Finder forgotPasswordButtonFinder = find.byType(TextButton); + await tester.tap(forgotPasswordButtonFinder.first); + + // Trigger a frame. + await tester.pumpAndSettle(); + + // Enter text into text field + Finder textFieldFinder = find.byType(TextField); + await tester.enterText(textFieldFinder.first, "login details"); + + // Trigger a frame. + await tester.pumpAndSettle(); + + // Check for text in textfields + expect(find.text('login details'), findsOneWidget); + }); + }); +} \ No newline at end of file