dev
dart 40 lines 1.28 KB
Raw
1 import 'package:cake_wallet/src/screens/disclaimer/disclaimer_page.dart';
2 import 'package:flutter/material.dart';
3 import 'package:flutter_test/flutter_test.dart';
4
5 import '../components/common_test_cases.dart';
6
7 class DisclaimerPageRobot {
8 DisclaimerPageRobot(this.tester) : commonTestCases = CommonTestCases(tester);
9
10 final WidgetTester tester;
11 late CommonTestCases commonTestCases;
12
13 Future<void> isDisclaimerPage() async {
14 await commonTestCases.isSpecificPage<DisclaimerPage>();
15 await commonTestCases.takeScreenshots('disclaimer_page');
16 }
17
18 void hasCheckIcon(bool hasBeenTapped) {
19 // The checked Icon should not be available initially, until user taps the checkbox
20 final checkIcon = find.byKey(ValueKey('disclaimer_check_icon_key'));
21 expect(checkIcon, hasBeenTapped ? findsOneWidget : findsNothing);
22 }
23
24 void hasDisclaimerCheckbox() {
25 final checkBox = find.byKey(ValueKey('disclaimer_check_key'));
26 expect(checkBox, findsOneWidget);
27 }
28
29 Future<void> tapDisclaimerCheckbox() async {
30 await commonTestCases.tapItemByKey('disclaimer_check_key');
31
32 await commonTestCases.defaultSleepTime();
33 }
34
35 Future<void> tapAcceptButton() async {
36 await commonTestCases.tapItemByKey('disclaimer_accept_button_key');
37
38 await commonTestCases.defaultSleepTime();
39 }
40 }