File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -335,10 +335,18 @@ export async function functioningAuthCodeBrowserFlow({
335
335
await ensureValue ( browser , 'input[name="login"]' , 'testuser' ) ;
336
336
await ensureValue ( browser , 'input[name="password"]' , 'testpassword' ) ;
337
337
await browser . $ ( 'button[type="submit"]' ) . click ( ) ;
338
+ const idpUrl = await browser . getUrl ( ) ;
338
339
339
340
await waitForTitle ( browser , 'Authorize' ) ;
340
341
await browser . $ ( 'button[type="submit"][autofocus]' ) . click ( ) ;
341
- await waitForLocalhostRedirect ( browser ) ;
342
+
343
+ // Cannot use `waitForLocalhostRedirect` because we already started on localhost
344
+ await browser . waitUntil ( async ( ) => {
345
+ return (
346
+ new URL ( ( await browser ?. getUrl ( ) ) ?? 'http://nonexistent' ) . host !==
347
+ new URL ( idpUrl ) . host
348
+ ) ;
349
+ } ) ;
342
350
} catch ( err : unknown ) {
343
351
await dumpHtml ( browser ) ;
344
352
throw err ;
@@ -385,6 +393,7 @@ export async function functioningDeviceAuthBrowserFlow({
385
393
386
394
await waitForTitle ( browser , 'Authorize' ) ;
387
395
await browser . $ ( 'button[type="submit"][autofocus]' ) . click ( ) ;
396
+ await waitForTitle ( browser , 'Sign-in Success' ) ;
388
397
} catch ( err : unknown ) {
389
398
await dumpHtml ( browser ) ;
390
399
throw err ;
You can’t perform that action at this time.
0 commit comments