dev
dart 46 lines 1.23 KB
Raw
1 import 'package:cake_wallet/generated/i18n.dart';
2 import 'package:cake_wallet/src/screens/welcome/create_pin_welcome_page.dart';
3 import 'package:cake_wallet/wallet_type_utils.dart';
4 import 'package:flutter_test/flutter_test.dart';
5
6 import '../components/common_test_cases.dart';
7
8 class CreatePinWelcomePageRobot {
9 CreatePinWelcomePageRobot(this.tester) : commonTestCases = CommonTestCases(tester);
10
11 final WidgetTester tester;
12 late CommonTestCases commonTestCases;
13
14 Future<void> isCreatePinWelcomePage() async {
15 await commonTestCases.isSpecificPage<CreatePinWelcomePage>();
16 await commonTestCases.takeScreenshots('create_pin_welcome_page');
17 }
18
19 void hasTitle() {
20 String title;
21 if (isMoneroOnly) {
22 title = S.current.monero_com;
23 }
24
25 title = S.current.cake_wallet;
26
27 commonTestCases.hasText(title);
28 }
29
30 void hasDescription() {
31 String description;
32 if (isMoneroOnly) {
33 description = S.current.monero_com_wallet_text;
34 }
35
36 description = S.current.new_first_wallet_text;
37
38 commonTestCases.hasText(description);
39 }
40
41 Future<void> tapSetAPinButton() async {
42 await commonTestCases.tapItemByKey('create_pin_welcome_page_create_a_pin_button_key');
43
44 await commonTestCases.defaultSleepTime();
45 }
46 }