File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 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({
335335 await ensureValue ( browser , 'input[name="login"]' , 'testuser' ) ;
336336 await ensureValue ( browser , 'input[name="password"]' , 'testpassword' ) ;
337337 await browser . $ ( 'button[type="submit"]' ) . click ( ) ;
338+ const idpUrl = await browser . getUrl ( ) ;
338339
339340 await waitForTitle ( browser , 'Authorize' ) ;
340341 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+ } ) ;
342350 } catch ( err : unknown ) {
343351 await dumpHtml ( browser ) ;
344352 throw err ;
@@ -385,6 +393,7 @@ export async function functioningDeviceAuthBrowserFlow({
385393
386394 await waitForTitle ( browser , 'Authorize' ) ;
387395 await browser . $ ( 'button[type="submit"][autofocus]' ) . click ( ) ;
396+ await waitForTitle ( browser , 'Sign-in Success' ) ;
388397 } catch ( err : unknown ) {
389398 await dumpHtml ( browser ) ;
390399 throw err ;
You can’t perform that action at this time.
0 commit comments