|
1 | 1 | import { by, element, expect } from 'detox'
|
2 | 2 | import { TestWallet } from 'e2e/utils/fixtures'
|
3 |
| -import { ElementName } from 'uniswap/src/features/telemetry/constants' |
| 3 | +import { TestID } from 'uniswap/src/test/fixtures/testIDs' |
4 | 4 |
|
5 | 5 | export async function CreateNewWallet(): Promise<void> {
|
6 | 6 | // Selects "Create a new wallet" option on the landing screen
|
7 |
| - await element(by.id(ElementName.CreateAccount)).tap() |
| 7 | + await element(by.id(TestID.CreateAccount)).tap() |
8 | 8 |
|
9 | 9 | // Skips unitag flow
|
10 |
| - await element(by.id(ElementName.Skip)).tap() |
| 10 | + await element(by.id(TestID.Skip)).tap() |
11 | 11 |
|
12 | 12 | // Taps "Let's keep it safe" on QRAnimation screen
|
13 |
| - await element(by.id(ElementName.Next)).tap() |
| 13 | + await element(by.id(TestID.Next)).tap() |
14 | 14 |
|
15 | 15 | // Check is both manual and cloud backup options are available on BackupScreen
|
16 |
| - await expect(element(by.id(ElementName.AddCloudBackup))).toBeVisible() |
17 |
| - await expect(element(by.id(ElementName.AddManualBackup))).toBeVisible() |
| 16 | + await expect(element(by.id(TestID.AddCloudBackup))).toBeVisible() |
| 17 | + await expect(element(by.id(TestID.AddManualBackup))).toBeVisible() |
18 | 18 |
|
19 | 19 | // Picks "Manual backup" option
|
20 |
| - await element(by.id(ElementName.AddManualBackup)).tap() |
| 20 | + await element(by.id(TestID.AddManualBackup)).tap() |
21 | 21 |
|
22 | 22 | // Checks if ManualBackupScreen warning displays and taps "I'm ready" button
|
23 |
| - await expect(element(by.id(ElementName.Confirm))).toBeVisible() |
24 |
| - await element(by.id(ElementName.Confirm)).tap() |
| 23 | + await expect(element(by.id(TestID.Confirm))).toBeVisible() |
| 24 | + await element(by.id(TestID.Confirm)).tap() |
25 | 25 |
|
26 | 26 | // Taps continue on ManualBackupScreen
|
27 |
| - await element(by.id(ElementName.Next)).tap() |
| 27 | + await element(by.id(TestID.Next)).tap() |
28 | 28 |
|
29 | 29 | // Taps continue on manual backup confirmation screen. It is replaced by mock because detox
|
30 | 30 | // can't interact with native screens
|
31 |
| - await element(by.id(ElementName.Continue)).tap() |
| 31 | + await element(by.id(TestID.Continue)).tap() |
32 | 32 |
|
33 | 33 | // Skips notification setup by tapping "Maybe later" button
|
34 |
| - await element(by.id(ElementName.Skip)).tap() |
| 34 | + await element(by.id(TestID.Skip)).tap() |
35 | 35 |
|
36 | 36 | // Skips biometrics setup by tapping "Maybe later" button
|
37 |
| - await element(by.id(ElementName.Skip)).tap() |
| 37 | + await element(by.id(TestID.Skip)).tap() |
38 | 38 |
|
39 | 39 | // Confirms by tapping "Skip" on warning modal
|
40 |
| - await element(by.id(ElementName.Confirm)).tap() |
| 40 | + await element(by.id(TestID.Confirm)).tap() |
41 | 41 |
|
42 | 42 | // Confirms if user successfuly finished create new wallet flow by checking if provided wallet name is
|
43 | 43 | // displayed and other
|
44 | 44 | await expect(element(by.text(TestWallet.name))).toBeVisible()
|
45 |
| - await expect(element(by.id(ElementName.Swap))).toBeVisible() |
46 |
| - await expect(element(by.id(ElementName.SearchTokensAndWallets))).toBeVisible() |
| 45 | + await expect(element(by.id(TestID.Swap))).toBeVisible() |
| 46 | + await expect(element(by.id(TestID.SearchTokensAndWallets))).toBeVisible() |
47 | 47 | }
|
0 commit comments