2024-06-21 10:55:07 +00:00
|
|
|
import 'package:cake_wallet/src/screens/disclaimer/disclaimer_page.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
|
2024-06-24 12:03:28 +00:00
|
|
|
import '../components/common_checks.dart';
|
2024-06-21 10:55:07 +00:00
|
|
|
|
|
|
|
class DisclaimerPageRobot {
|
|
|
|
DisclaimerPageRobot(this.tester) : commonTestCases = CommonTestCases(tester);
|
|
|
|
|
|
|
|
final WidgetTester tester;
|
|
|
|
late CommonTestCases commonTestCases;
|
|
|
|
|
|
|
|
Future<void> isDisclaimerPage() async {
|
|
|
|
await commonTestCases.isSpecificPage<DisclaimerPage>();
|
|
|
|
}
|
|
|
|
|
|
|
|
void hasCheckIcon(bool hasBeenTapped) {
|
|
|
|
// The checked Icon should not be available initially, until user taps the checkbox
|
|
|
|
final checkIcon = find.byKey(ValueKey('disclaimer_check_icon_key'));
|
|
|
|
expect(checkIcon, hasBeenTapped ? findsOneWidget : findsNothing);
|
|
|
|
}
|
|
|
|
|
|
|
|
void hasDisclaimerCheckbox() {
|
|
|
|
final checkBox = find.byKey(ValueKey('disclaimer_check_key'));
|
|
|
|
expect(checkBox, findsOneWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> tapDisclaimerCheckbox() async {
|
|
|
|
final checkBox = find.byKey(ValueKey('disclaimer_check_key'));
|
|
|
|
await tester.tap(checkBox);
|
|
|
|
await tester.pumpAndSettle();
|
2024-06-25 17:12:38 +00:00
|
|
|
await commonTestCases.defaultSleepTime();
|
2024-06-21 10:55:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> tapAcceptButton() async {
|
|
|
|
final checkBox = find.byKey(ValueKey('disclaimer_accept_button_key'));
|
|
|
|
await tester.tap(checkBox);
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
}
|
|
|
|
}
|