Skip to content

Commit 992c0c8

Browse files
committed
refactor: Improve transaction history flow tests and item visibility checks
This change: - Enhances the scrolling logic in the CommonTestCases to check for item visibility before scrolling. - Adds error handling and logging for transaction history checks in TransactionsPageRobot. - Adds comprehensive item checks and scrolling for more reliable tests.
1 parent 022d9b5 commit 992c0c8

File tree

3 files changed

+306
-143
lines changed

3 files changed

+306
-143
lines changed

integration_test/components/common_test_cases.dart

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,36 @@ class CommonTestCases {
196196
matching: find.byType(Scrollable),
197197
);
198198

199+
// Check if the item is already visible
200+
if (tester.any(itemFinder)) {
201+
tester.printToConsole('Item $itemKeyId is already visible');
202+
return;
203+
}
204+
205+
// Check if scrollable exists
206+
if (!tester.any(scrollableFinder)) {
207+
tester.printToConsole('Scrollable not found for $itemKeyId');
208+
return;
209+
}
210+
199211
try {
200212
await tester.scrollUntilVisible(
201213
itemFinder,
202214
scrollPixels,
203215
scrollable: scrollableFinder,
216+
maxScrolls: 10,
204217
);
218+
219+
// Wait for the scroll to complete
220+
await tester.pumpAndSettle(Duration(milliseconds: 500));
221+
222+
// Verify the item is now visible
223+
if (!tester.any(itemFinder)) {
224+
tester.printToConsole('Item $itemKeyId not found after scrolling');
225+
}
205226
} catch (e) {
206-
tester.printToConsole('Could not find $itemKeyId');
227+
tester.printToConsole('Could not scroll to $itemKeyId: $e');
207228
}
208-
209-
await tester.pumpAndSettle();
210229
}
211230

212231
Future<void> enterText(String text, String editableTextKey) async {

0 commit comments

Comments
 (0)