Experiment No 9
Experiment No 9
UI Testing is a type of testing where we verify that the application's visual components (buttons,
text fields, icons, etc.) appear and behave as expected. In Android, UI Automator is used to test
app UI interactions across system and app boundaries. In Flutter, however, we perform similar
testing using the integration_test package, which mimics UIAutomator-style testing by
simulating taps, entering text, and checking widget visibility.
Why UI Testing?
• Flutter
• Firebase (for authentication)
• integration_test Flutter package
Integration Testing in Flutter verifies that a complete flow or set of features works together as
expected in a real-world scenario. It goes beyond unit and widget testing by simulating user
behavior across screens and interactions, using real device or emulator environments.
Importance of Integration Testing
• Validates that multiple widgets, services, and logic components function together
correctly.
• Helps uncover bugs that occur only during full feature flows.
Components of Flutter Integration Testing
2. Test Case
8 Tap on "Sign Up" button Validates form and proceeds with account
creation (if input is valid)
9 End the test All UI elements validated without failure
3. Test Description
This test validates the Login and Signup screens of the SereniTunes mobile
application. It ensures that all critical UI components are visible and functioning as
expected, including text fields, buttons, and navigational links. The test begins with
verifying the login screen, then simulates user interaction by navigating to the signup screen
and confirming the visibility of all relevant input fields and elements. This ensures a smooth
onboarding flow and confirms UI integrity after each frame render.
Implementation
Fig 1: integration_test/auth_test.dart
Command to run a test case: flutter test integration_test/auth_test.dart
Conclusion:
In this experiment, I successfully created and executed a UI integration test using Flutter’s
integration_test package. This allowed me to test real UI behavior, including rendering, text
entry, and button taps. The test ensured that all expected UI elements on the LoginScreen
and SignupScreen were present and functioning correctly.