|
| 1 | +import { elementById, restoreWallet, sleep, tap, typeText, waitForSetupWalletScreenFinish } from '../helpers/actions'; |
| 2 | +import { ciIt } from '../helpers/suite'; |
| 3 | +import { getNativeAppPath, getRnAppPath, reinstallAppFromPath } from '../helpers/setup'; |
| 4 | + |
| 5 | +const MIGRATION_MNEMONIC = |
| 6 | + process.env.MIGRATION_MNEMONIC ?? |
| 7 | + 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'; |
| 8 | + |
| 9 | +describe('@migration - Legacy RN migration', () => { |
| 10 | + ciIt('@migration_1 - Can restore legacy RN wallet from mnemonic', async () => { |
| 11 | + await installLegacyRnApp(); |
| 12 | + await restoreLegacyRnWallet(MIGRATION_MNEMONIC); |
| 13 | + |
| 14 | + // Restore into native app |
| 15 | + // await installNativeApp(); |
| 16 | + await restoreWallet(MIGRATION_MNEMONIC); |
| 17 | + }); |
| 18 | +}); |
| 19 | + |
| 20 | +async function installNativeApp() { |
| 21 | + await reinstallAppFromPath(getNativeAppPath()); |
| 22 | +} |
| 23 | +async function installLegacyRnApp() { |
| 24 | + await reinstallAppFromPath(getRnAppPath()); |
| 25 | +} |
| 26 | + |
| 27 | +async function restoreLegacyRnWallet(seed: string) { |
| 28 | + await elementById('Continue').waitForDisplayed(); |
| 29 | + await tap('Check1'); |
| 30 | + await tap('Check2'); |
| 31 | + await tap('Continue'); |
| 32 | + |
| 33 | + await tap('SkipIntro'); |
| 34 | + |
| 35 | + await tap('RestoreWallet'); |
| 36 | + await tap('MultipleDevices-button'); |
| 37 | + |
| 38 | + await typeText('Word-0', seed); |
| 39 | + await sleep(1500); |
| 40 | + await tap('RestoreButton'); |
| 41 | + await waitForSetupWalletScreenFinish(); |
| 42 | + |
| 43 | + const getStarted = await elementById('GetStartedButton'); |
| 44 | + await getStarted.waitForDisplayed( { timeout: 120000 }); |
| 45 | + await tap('GetStartedButton'); |
| 46 | + await sleep(1000); |
| 47 | +} |
0 commit comments