@@ -21,11 +21,14 @@ test.describe('severity-2 #smoke', () => {
2121 password : string
2222 ) {
2323 const client = target . createAuthClient ( version ) ;
24- const response = await client . signIn ( email , password , { keys : true } ) ;
24+ const response = await client . signIn ( email , password , {
25+ keys : true ,
26+ skipPasswordUpgrade : true ,
27+ } ) ;
2528 expect ( response . keyFetchToken ) . toBeDefined ( ) ;
2629 expect ( response . unwrapBKey ) . toBeDefined ( ) ;
2730
28- const keys = client . accountKeys (
31+ const keys = await client . accountKeys (
2932 response . keyFetchToken as string ,
3033 response . unwrapBKey as string
3134 ) ;
@@ -62,18 +65,25 @@ test.describe('severity-2 #smoke', () => {
6265 recoveryKey,
6366 resetPassword,
6467 confirmSignupCode,
68+ deleteAccount,
6569 } ,
6670 testAccountTracker,
6771 } ) => {
68- const { email, password } = testAccountTracker . generateAccountDetails ( ) ;
72+ const accountDetails = {
73+ email : testAccountTracker . generateEmail ( ) ,
74+ password : testAccountTracker . generatePassword ( ) ,
75+ } ;
76+ const newPassword = testAccountTracker . generatePassword ( ) ;
6977 await page . goto (
7078 `${ target . contentServerUrl } /?forceExperiment=generalizedReactApp&forceExperimentGroup=react&${ signupVersion . query } `
7179 ) ;
7280 await page . waitForURL ( / \/ / ) ;
73- await signup . fillOutEmailForm ( email ) ;
74- await signup . fillOutSignupForm ( password , AGE_21 ) ;
81+ await signup . fillOutEmailForm ( accountDetails . email ) ;
82+ await signup . fillOutSignupForm ( accountDetails . password , AGE_21 ) ;
7583 await expect ( page ) . toHaveURL ( / c o n f i r m _ s i g n u p _ c o d e / ) ;
76- const code = await target . emailClient . getVerifyShortCode ( email ) ;
84+ const code = await target . emailClient . getVerifyShortCode (
85+ accountDetails . email
86+ ) ;
7787 await confirmSignupCode . fillOutCodeForm ( code ) ;
7888
7989 await page . waitForURL ( / s e t t i n g s / ) ;
@@ -84,57 +94,72 @@ test.describe('severity-2 #smoke', () => {
8494 const keys = await _getKeys (
8595 signupVersion . version ,
8696 target ,
87- email ,
88- password
97+ accountDetails . email ,
98+ accountDetails . password
8999 ) ;
90100 await page . goto (
91101 `${ target . contentServerUrl } /?forceExperiment=generalizedReactApp&forceExperimentGroup=react&${ resetVersion . query } `
92102 ) ;
93103 await page . waitForURL ( / \/ / ) ;
94- await signin . fillOutEmailFirstForm ( email ) ;
95- await signin . fillOutPasswordForm ( password ) ;
104+ await signin . fillOutEmailFirstForm ( accountDetails . email ) ;
105+ await signin . fillOutPasswordForm ( accountDetails . password ) ;
96106 await page . waitForURL ( / s e t t i n g s / ) ;
97107 await expect ( page ) . toHaveURL ( / s e t t i n g s / ) ;
98108
99- await settings . goto ( `${ resetVersion . version } ` ) ;
109+ await settings . goto ( `${ resetVersion . query } ` ) ;
100110 await page . waitForURL ( / s e t t i n g s / ) ;
101111 await settings . recoveryKey . createButton . click ( ) ;
102- const key = await recoveryKey . createRecoveryKey ( password , HINT ) ;
112+ const key = await recoveryKey . createRecoveryKey (
113+ accountDetails . password ,
114+ HINT
115+ ) ;
103116 await settings . signOut ( ) ;
104117 await page . goto (
105118 `${ target . contentServerUrl } /reset_password?${ resetVersion . query } `
106119 ) ;
107120 await page . waitForURL ( / r e s e t _ p a s s w o r d / ) ;
108- await resetPassword . fillOutEmailForm ( email ) ;
109- const resetCode = await target . emailClient . getResetPasswordCode ( email ) ;
121+ await resetPassword . fillOutEmailForm ( accountDetails . email ) ;
122+ const resetCode = await target . emailClient . getResetPasswordCode (
123+ accountDetails . email
124+ ) ;
110125 await resetPassword . fillOutResetPasswordCodeForm ( resetCode ) ;
111126 await resetPassword . fillOutRecoveryKeyForm ( key ) ;
112127
113128 await expect ( page ) . toHaveURL (
114129 new RegExp ( `account_recovery_reset_password.*${ resetVersion . query } ` )
115130 ) ;
116131
117- await resetPassword . fillOutNewPasswordForm ( password ) ;
132+ await resetPassword . fillOutNewPasswordForm ( newPassword ) ;
133+ accountDetails . password = newPassword ;
118134
119135 await expect ( page ) . toHaveURL ( / r e s e t _ p a s s w o r d _ w i t h _ r e c o v e r y _ k e y _ v e r i f i e d / ) ;
120136
137+ await resetPassword . continueWithoutDownloadingRecoveryKey ( ) ;
138+ await resetPassword . recoveryKeyFinishButton . click ( ) ;
139+
140+ // a successful password reset means that the user is signed in
141+ await page . waitForURL ( / s e t t i n g s / ) ;
142+ await settings . signOut ( ) ;
143+
144+ // Attempt to signin
121145 await page . goto (
122146 `${ target . contentServerUrl } /?forceExperiment=generalizedReactApp&forceExperimentGroup=react&${ signinVersion . query } `
123147 ) ;
124148 await page . waitForURL ( / \/ / ) ;
125- // a successful password reset means that the user is signed in
126- await expect ( signin . cachedSigninHeading ) . toBeVisible ( ) ;
127- await signin . signInButton . click ( ) ;
128-
149+ await signin . fillOutEmailFirstForm ( accountDetails . email ) ;
150+ await signin . fillOutPasswordForm ( accountDetails . password ) ;
129151 await page . waitForURL ( / s e t t i n g s / ) ;
130- await expect ( page ) . toHaveURL ( / s e t t i n g s / ) ;
152+
131153 const keys2 = await _getKeys (
132154 signinVersion . version ,
133155 target ,
134- email ,
135- password
156+ accountDetails . email ,
157+ accountDetails . password
136158 ) ;
137159 expect ( keys2 . kB ) . toEqual ( keys . kB ) ;
160+
161+ await settings . deleteAccountButton . click ( ) ;
162+ await deleteAccount . deleteAccount ( accountDetails . password ) ;
138163 } ) ;
139164 }
140165} ) ;
0 commit comments