import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:integration_test/integration_test.dart';
import 'package:knights_bridge/main.dart' as app;
import 'dart:io';
import 'package:knights_bridge/screens/shared/bigButtonFilled.dart';
void main() {
group('Sign in test', () {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('Validate sign in and dashboard', (tester) async {
app.main();
await tester.pumpAndSettle();
final emailField = find.byKey(Key('login'));
final passwordField = find.byKey(Key('password'));
final signInButton = find.text('Sign in');
// final signInButton = find.byType(BigFilledButton);
print("Starting typing in email field");
await tester.enterText(emailField, "ashiq@gmail.com");
print("Starting typing in password field");
await tester.enterText(passwordField, "123456789As@");
await tester.pumpAndSettle();
print("Clicking on sign in button");
await tester.tap(signInButton);
await tester.pumpAndSettle();
final signInMessage = find.text("Login successful");
print("Started verifying the message for successful login.");
await tester.ensureVisible(signInMessage);
await tester.pumpAndSettle(Duration(seconds: 4));
print("Successfully the success message in dashboard.");
});
});
}
When I'm executing this code it is running the automation but giving an error and test is failing. There are no such error raising while I'm running this app manually only raising when executing integration test.
Please check and tell me what's could be the solution for this.
Thanks in advance.