File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -43,17 +43,21 @@ test('register an account', async ({ page }) => {
4343 // 1. Remove soft line breaks (quoted-printable)
4444 const cleanedBody = body . replace ( / = \r ? \n / g, '' ) ;
4545
46- // 2. Extract the URL
47- const match = cleanedBody . match ( / \[ V e r i f y \] \( ( h t t p [ ^ \s \) ] + ) \) / ) ;
48- const verifyLink = match ? match [ 1 ] : null ;
46+ const match = cleanedBody . match ( / \[ V e r i f y \] \( ( .* ) \) / i) ;
4947
50- console . log ( verifyLink ) ;
48+ const cleanedVerifyLink = match ? match [ 1 ] : null ;
49+
50+ console . log ( cleanedVerifyLink ) ;
51+
52+ // thread sleep
53+ await new Promise ( resolve => setTimeout ( resolve , 30000 ) ) ;
5154
5255 // Go to the verification link
53- await page . goto ( verifyLink ) ;
56+ await page . goto ( cleanedVerifyLink ) ;
5457
5558 // Check if the verification was successful, page should include a div with the text "Email address verified. You can now log in."
56- await page . waitForURL ( new RegExp ( `${ host } /auth/login` ) ) ;
59+ await page . waitForURL ( new RegExp ( `${ host } /auth/login?__flash=.+` ) ) ;
60+
5761 const loginMessage = await page . locator ( 'div' ) . filter ( { hasText : / Y o u r a c c o u n t h a s b e e n v e r i f i e d * / i } ) ;
5862
5963 expect ( await successMessage . count ( ) ) . toBe ( 1 ) ;
You can’t perform that action at this time.
0 commit comments