From 7ca7d54a03ba11ce292ae60b97b552c1f8d31b90 Mon Sep 17 00:00:00 2001 From: BrodyHughes <41711440+BrodyHughes@users.noreply.github.com> Date: Tue, 2 Jul 2024 15:35:18 -0500 Subject: [PATCH] test file --- e2e/8_manualBackup.spec.ts | 75 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 e2e/8_manualBackup.spec.ts diff --git a/e2e/8_manualBackup.spec.ts b/e2e/8_manualBackup.spec.ts new file mode 100644 index 00000000000..ceb56292469 --- /dev/null +++ b/e2e/8_manualBackup.spec.ts @@ -0,0 +1,75 @@ +/* eslint-disable no-await-in-loop */ +import { + beforeAllcleanApp, + importWalletFlow, + afterAllcleanApp, + tap, + tapByText, + delayTime, + tapAtPoint, + checkIfExistsByText, + checkIfExists, + waitAndTap, + checkIfDoesntExist, +} from './helpers'; + +describe('Backups', () => { + beforeAll(async () => { + await beforeAllcleanApp({ hardhat: false }); + }); + afterAll(async () => { + await afterAllcleanApp({ hardhat: false }); + }); + + it('Imports wallet', async () => { + await importWalletFlow(); + }); + + it('Should go to settings', async () => { + await tapAtPoint('wallet-screen', { x: 355, y: 80 }); + await tapByText('Settings'); + await checkIfExists('settings-sheet'); + }); + + it('Should go to backups', async () => { + await tap('backup-section'); + await checkIfExistsByText('Wallets & Backup'); + }); + + it('Should alert that iCloud isnt enabled', async () => { + await waitAndTap('backup-now-button'); + await checkIfExistsByText('iCloud Not Enabled'); + await tapByText('No thanks'); + }); + + it('Should go to specific wallets backup sheet and view seed phrase', async () => { + await delayTime('medium'); + await tapByText('Not backed up'); + await delayTime('medium'); + await tapByText('Back Up Manually'); + await waitAndTap('show-secret-button'); + }); + + it('Should check if seed phrase exists word by word and confirm backup', async () => { + await delayTime('medium'); + const words = process.env.TEST_SEEDS ? process.env.TEST_SEEDS.split(' ') : []; + for (const word of words) { + await checkIfExistsByText(word.trim()); + } + await delayTime('medium'); + await tapByText("􀆅 I've saved these words"); + }); + + it('Should go back to the backup sheet and it should be updated', async () => { + await delayTime('medium'); + await checkIfExistsByText('Wallets & Backup'); + await checkIfDoesntExist('Not backed up', 1_000); + }); + + it('Should go to specific wallets backup sheet and it should be backup up now', async () => { + await delayTime('medium'); + await tapByText('Imported'); + await delayTime('medium'); + await checkIfExistsByText('Backed up manually'); + }); +});