-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathonboarding.e2e.ts
More file actions
109 lines (94 loc) · 3.27 KB
/
onboarding.e2e.ts
File metadata and controls
109 lines (94 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import {
handleAndroidAlert,
confirmInputOnKeyboard,
elementById,
elementByText,
getReceiveAddress,
getSeed,
restoreWallet,
sleep,
swipeFullScreen,
tap,
typeText,
waitForSetupWalletScreenFinish,
} from '../helpers/actions';
import { reinstallApp } from '../helpers/setup';
import { ciIt } from '../helpers/suite';
describe('@onboarding - Onboarding', () => {
beforeEach(async () => {
await reinstallApp();
});
ciIt('@onboarding_1 - Can start onboarding', async () => {
// TOS and PP
await elementById('Continue').waitForDisplayed();
await sleep(1000); // Wait for the app to settle
await tap('Continue');
await tap('GetStarted');
await elementById('Slide0').waitForDisplayed();
await swipeFullScreen('left');
await elementById('Slide1').waitForDisplayed();
await swipeFullScreen('left');
await elementById('Slide2').waitForDisplayed();
await swipeFullScreen('left');
await swipeFullScreen('left');
await swipeFullScreen('right');
await swipeFullScreen('right');
await tap('SkipButton');
// create new wallet
await elementById('NewWallet').waitForDisplayed();
await sleep(1000); // Wait for the app to settle
await tap('NewWallet');
await waitForSetupWalletScreenFinish();
await handleAndroidAlert();
await elementByText('TO GET').waitForDisplayed();
});
ciIt('@onboarding_2 - Can pass onboarding correctly', async () => {
// TOS and PP
await elementById('Continue').waitForDisplayed();
await sleep(1000); // Wait for the app to settle
await tap('Continue');
await tap('GetStarted');
await elementById('Slide0').waitForDisplayed();
await swipeFullScreen('left');
await elementById('Slide1').waitForDisplayed();
await swipeFullScreen('left');
await elementById('Slide2').waitForDisplayed();
await swipeFullScreen('right');
await tap('SkipButton');
// create new wallet with passphrase
const passphrase = 'supersecret';
await tap('Passphrase');
await typeText('PassphraseInput', passphrase);
await confirmInputOnKeyboard();
await tap('CreateNewWallet');
await waitForSetupWalletScreenFinish();
await handleAndroidAlert();
// Wait for wallet to be created
for (let i = 1; i <= 3; i++) {
try {
await tap('WalletOnboardingClose');
break;
} catch {
if (i === 3) throw new Error('Tapping "WalletOnboardingClose" timeout');
}
}
const seed = await getSeed();
const address0 = await getReceiveAddress();
await restoreWallet(seed, { passphrase });
const address1 = await getReceiveAddress();
// Go to Address Viewer
await swipeFullScreen('down');
await tap('HeaderMenu');
await tap('DrawerSettings');
await tap('AdvancedSettings');
await tap('AddressViewer');
const address0Element = await elementById('Address-0');
const address1Element = await elementById('Address-1');
const address0Text = (await address0Element.getText()).split(':')[1].trim();
const address1Text = (await address1Element.getText()).split(':')[1].trim();
console.info({ address0Text, address1Text });
// Verify that the addresses match
await expect(address0).toEqual(address0Text);
await expect(address1).toEqual(address1Text);
});
});