@@ -15,6 +15,8 @@ import {
1515 sleep ,
1616 waitForActiveChannel ,
1717 waitForPeerConnection ,
18+ restoreWallet ,
19+ getSeed ,
1820} from './helpers' ;
1921
2022d = checkComplete ( 'lighting-1' ) ? describe . skip : describe ;
@@ -311,52 +313,9 @@ d('Lightning', () => {
311313 await element ( by . id ( 'Tag-stag-delete' ) ) . tap ( ) ;
312314 await element ( by . id ( 'NavigationClose' ) ) . tap ( ) ;
313315
314- // get seed
315- await element ( by . id ( 'Settings' ) ) . tap ( ) ;
316- await element ( by . id ( 'BackupSettings' ) ) . tap ( ) ;
317- await element ( by . id ( 'BackupWallet' ) ) . tap ( ) ;
318- await sleep ( 1000 ) ; // animation
319- await element ( by . id ( 'TapToReveal' ) ) . tap ( ) ;
320-
321- // get the seed from SeedContaider
322- const { label : seed } = await element (
323- by . id ( 'SeedContaider' ) ,
324- ) . getAttributes ( ) ;
325- await element ( by . id ( 'SeedContaider' ) ) . swipe ( 'down' ) ;
326- await sleep ( 1000 ) ; // animation
327- await element ( by . id ( 'NavigationClose' ) ) . atIndex ( 0 ) . tap ( ) ;
328-
329- await sleep ( 5000 ) ; // make sure everything is saved to cloud storage TODO: improve this
330- console . info ( 'seed: ' , seed ) ;
331-
332- // restore wallet
333- await device . launchApp ( { delete : true } ) ;
334-
335- await waitFor ( element ( by . id ( 'Check1' ) ) ) . toBeVisible ( ) ;
336- await element ( by . id ( 'Check1' ) ) . tap ( ) ;
337- await element ( by . id ( 'Check2' ) ) . tap ( ) ;
338- await element ( by . id ( 'Continue' ) ) . tap ( ) ;
339- await waitFor ( element ( by . id ( 'SkipIntro' ) ) ) . toBeVisible ( ) ;
340- await element ( by . id ( 'SkipIntro' ) ) . tap ( ) ;
341- await element ( by . id ( 'RestoreWallet' ) ) . tap ( ) ;
342- await element ( by . id ( 'MultipleDevices-button' ) ) . tap ( ) ;
343- await element ( by . id ( 'Word-0' ) ) . replaceText ( seed ) ;
344- await element ( by . id ( 'WordIndex-4' ) ) . swipe ( 'up' ) ;
345- await element ( by . id ( 'RestoreButton' ) ) . tap ( ) ;
346-
347- await waitFor ( element ( by . id ( 'GetStartedButton' ) ) )
348- . toBeVisible ( )
349- . withTimeout ( 300000 ) ; // 5 min
350- await element ( by . id ( 'GetStartedButton' ) ) . tap ( ) ;
351-
352- // wait for SuggestionsLabel to appear and be accessible
353- for ( let i = 0 ; i < 60 ; i ++ ) {
354- await sleep ( 1000 ) ;
355- try {
356- await element ( by . id ( 'SuggestionsLabel' ) ) . tap ( ) ;
357- break ;
358- } catch ( e ) { }
359- }
316+ // wipe and restore wallet
317+ const seed = await getSeed ( ) ;
318+ await restoreWallet ( seed ) ;
360319
361320 // check balance
362321 await waitFor (
0 commit comments