11import { Mockttp } from 'mockttp' ;
2- import { AuthConnection } from '@metamask/seedless-onboarding-controller' ;
32import { Browser } from 'selenium-webdriver' ;
43import FixtureBuilder from '../../fixture-builder' ;
54import { withFixtures } from '../../helpers' ;
@@ -21,70 +20,6 @@ import OnboardingPasswordPage from '../../page-objects/pages/onboarding/onboardi
2120import SecureWalletPage from '../../page-objects/pages/onboarding/secure-wallet-page' ;
2221
2322describe ( 'Reset Wallet - ' , function ( ) {
24- it ( 'should be able to reset wallet when encounters un-recoverable error in social login unlock' , async function ( ) {
25- await withFixtures (
26- {
27- fixtures : new FixtureBuilder ( { onboarding : true } ) . build ( ) ,
28- title : this . test ?. fullTitle ( ) ,
29- ignoredConsoleErrors : [
30- 'unable to proceed, wallet is locked' ,
31- 'The snap "npm:@metamask/message-signing-snap" has been terminated during execution' , // issue #37342
32- 'npm:@metamask/message-signing-snap was stopped and the request was cancelled. This is likely because the Snap crashed.' ,
33- ] ,
34- testSpecificMock : ( server : Mockttp ) => {
35- // using this to mock the OAuth Service (Web Authentication flow + Auth server)
36- const oAuthMockttpService = new OAuthMockttpService ( ) ;
37- return oAuthMockttpService . setup ( server , {
38- userEmail : MOCK_GOOGLE_ACCOUNT ,
39- throwAuthenticationErrorAtUnlock : true , // <=== This is intentional error to test the reset wallet flow
40- passwordOutdated : true ,
41- } ) ;
42- } ,
43- } ,
44- async ( { driver } : { driver : Driver } ) => {
45- await importWalletWithSocialLoginOnboardingFlow ( {
46- driver,
47- } ) ;
48-
49- const homePage = new HomePage ( driver ) ;
50- await homePage . checkPageIsLoaded ( ) ;
51-
52- const headerNavbar = new HeaderNavbar ( driver ) ;
53-
54- await headerNavbar . lockMetaMask ( ) ;
55-
56- const loginPage = new LoginPage ( driver ) ;
57-
58- // login should fail due to Authentication Error
59- await loginPage . loginToHomepage ( WALLET_PASSWORD ) ;
60-
61- // reset the wallet
62- await loginPage . resetWallet ( ) ;
63-
64- if ( process . env . SELENIUM_BROWSER === Browser . FIREFOX ) {
65- // In Firefox, we need to go to the metametrics page first
66- await onboardingMetricsFlow ( driver , {
67- participateInMetaMetrics : true ,
68- dataCollectionForMarketing : false ,
69- } ) ;
70- }
71-
72- // should be on the welcome page after resetting the wallet
73- const startOnboardingPage = new StartOnboardingPage ( driver ) ;
74- await startOnboardingPage . checkLoginPageIsLoaded ( ) ;
75-
76- // import wallet with social login and start a new session
77- await startOnboardingPage . importWalletWithSocialLogin (
78- AuthConnection . Google ,
79- ) ;
80-
81- await loginPage . checkPageIsLoaded ( ) ;
82- await loginPage . loginToHomepage ( WALLET_PASSWORD ) ;
83- await homePage . headerNavbar . checkPageIsLoaded ( ) ;
84- } ,
85- ) ;
86- } ) ;
87-
8823 it ( 'creates a new wallet with SRP and completes the onboarding process after resetting the wallet' , async function ( ) {
8924 await withFixtures (
9025 {
@@ -123,7 +58,9 @@ describe('Reset Wallet - ', function () {
12358 await loginPage . loginToHomepage ( WALLET_PASSWORD ) ;
12459
12560 // reset the wallet
126- await loginPage . resetWallet ( ) ;
61+ await loginPage . checkConnectionsRemovedModalIsDisplayed ( ) ;
62+ // reset wallet from connections removed modal
63+ await loginPage . resetWalletFromConnectionsRemovedModal ( ) ;
12764
12865 if ( process . env . SELENIUM_BROWSER === Browser . FIREFOX ) {
12966 // In Firefox, we need to go to the metametrics page first
@@ -205,7 +142,9 @@ describe('Reset Wallet - ', function () {
205142 await loginPage . loginToHomepage ( WALLET_PASSWORD ) ;
206143
207144 // reset the wallet
208- await loginPage . resetWallet ( ) ;
145+ await loginPage . checkConnectionsRemovedModalIsDisplayed ( ) ;
146+ // reset wallet from connections removed modal
147+ await loginPage . resetWalletFromConnectionsRemovedModal ( ) ;
209148
210149 if ( process . env . SELENIUM_BROWSER === Browser . FIREFOX ) {
211150 // In Firefox, we need to go to the metametrics page first
0 commit comments