stack_wallet/integration_test/bots/addressbook/address_book_card_bot.dart

36 lines
1,019 B
Dart
Raw Normal View History

2022-08-26 08:11:35 +00:00
import 'package:flutter_test/flutter_test.dart';
import 'package:stackwallet/widgets/address_book_card.dart';
class AddressBookCardBot {
final WidgetTester tester;
const AddressBookCardBot(this.tester);
Future<void> ensureVisible() async {
await tester.ensureVisible(find.byType(AddressBookCard));
}
Future<void> toggleExpandCard() async {
await tester.tap(find.byType(AddressBookCard));
await tester.pumpAndSettle();
}
Future<void> tapDetails() async {
await tester.tap(find.byWidgetPredicate(
(widget) => widget is SubButton && widget.label == "DETAILS"));
await tester.pumpAndSettle();
}
Future<void> tapCopy() async {
await tester.tap(find.byWidgetPredicate(
(widget) => widget is SubButton && widget.label == "COPY"));
await tester.pumpAndSettle();
}
Future<void> tapSend() async {
await tester.tap(find.byWidgetPredicate(
(widget) => widget is SubButton && widget.label == "SEND FIRO"));
await tester.pumpAndSettle();
}
}