File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -282,10 +282,13 @@ async function waitForTitle(
282
282
) : Promise < void > {
283
283
await browser . waitUntil ( async ( ) => {
284
284
const actual = ( await browser . $ ( selector ) . getText ( ) ) . trim ( ) ;
285
- let matches ;
286
- if ( typeof expected === 'string' )
285
+ let matches : boolean ;
286
+ if ( typeof expected === 'string' ) {
287
287
matches = actual . toLowerCase ( ) === expected . toLowerCase ( ) ;
288
- else matches = expected . test ( actual ) ;
288
+ } else {
289
+ matches = expected . test ( actual ) ;
290
+ }
291
+
289
292
if ( ! matches ) {
290
293
throw new Error ( `Wanted title "${ String ( expected ) } ", saw "${ actual } "` ) ;
291
294
}
@@ -481,7 +484,7 @@ export async function azureBrowserDeviceAuthFlow({
481
484
try {
482
485
const normalizeUserCode = ( str : string ) => str . replace ( / - / g, '' ) ;
483
486
browser = await spawnBrowser ( verificationUrl , true ) ;
484
- await waitForTitle ( browser , ' Enter code' , 'div[role="heading"]' ) ;
487
+ await waitForTitle ( browser , / E n t e r c o d e / , 'div[role="heading"]' ) ;
485
488
await ensureValue (
486
489
browser ,
487
490
'input[name="otc"]' ,
You can’t perform that action at this time.
0 commit comments