stack_wallet/integration_test/bots/addressbook/address_book_card_bot.dart
2022-08-26 16:11:35 +08:00

35 lines
1,019 B
Dart

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();
}
}