[TEST-UI-03] Automated UI/Widget Testing of the Mobile Application
Testing: Frontend
NoteTask Brief
- Component:
food_tracker_mobile(Flutter). - Tools: Flutter Widget Tests,
mockito/bloc_test. - Task Type: Frontend QA.
- Status: Under Analysis
Task Description
It is necessary to cover the UI components of the “Fridge” and “Product Ingestion” screens with tests to verify the reactive behavior of the interface when receiving asynchronous data streams.
Step-by-Step Instructions
- Testing WebSocket Events (
bloc_test): Write an integration test forFridgeBloc. Verify that when aPRODUCTS_PROCESSEDevent is pushed into the WebSocket stream, the bloc emits a background update state, and the product list on the screen redraws smoothly without a full page reload. - Widget Testing for Error Modals: Write isolated tests for the
AppErrorBottomSheetwidget. Pass different gRPC error codes into the widget independently:- Verify that when passing
code: 16, the screen accurately renders the<i class="bi-lock-fill"></i>icon and the “Refresh Session” button. - Verify that when passing
code: 14, the text dynamically updates to “Connection Issues”.
- Verify that when passing
- Spinner State Testing (Loading State): Ensure that while a receipt is being uploaded, the action button transitions to a disabled state and is replaced by a loading indicator spinner, protecting the system against accidental double-clicks by the user.