import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/ui/adaptive/segmented_bar.dart'; /// Taps a top-bar action: in the bar while it fits, or through the bar's /// More menu (by its [label]) when a narrow bar moved it there. Future tapBarAction( WidgetTester tester, Finder action, String label, ) async { if (action.hitTestable().evaluate().isNotEmpty) { await tester.tap(action); return; } await tester.tap(find.byKey(segmentedMoreKey).hitTestable()); await tester.pumpAndSettle(); await tester.tap(find.text(label).last); }