@@ -421,18 +421,16 @@ async function run() {
421421 waitUntil : 'domcontentloaded' ,
422422 timeout : 180_000 ,
423423 } )
424- await page . getByRole ( 'button' , { name : 'Import people' , exact : true } ) . click ( )
425- const picker = page . getByRole ( 'dialog' , { name : 'Import people data' } )
426- await picker . getByRole ( 'button' , { name : 'SCIM provisioning' } ) . click ( )
427- await page
428- . getByRole ( 'dialog' , { name : 'Import from SCIM provisioning' } )
429- . getByRole ( 'button' , { name : 'Preview import' } )
430- . click ( )
431- const modal = page . getByRole ( 'dialog' , { name : 'Review import' } )
432- await expect ( modal . getByText ( / 1 p r o f i l e w i l l b e u p d a t e d / ) ) . toBeVisible ( )
424+ await page . getByRole ( 'button' , { name : / ^ I m p o r t ( p r o f i l e s ) ? $ / } ) . click ( )
425+ const importDialog = page . getByRole ( 'dialog' , { name : 'Import profiles' } )
426+ await importDialog . getByRole ( 'combobox' , { name : 'Source' } ) . click ( )
427+ await page . getByRole ( 'option' , { name : 'SCIM provisioning' } ) . click ( )
428+ await importDialog . getByRole ( 'button' , { name : 'Preview import' } ) . click ( )
429+ const modal = page . getByRole ( 'dialog' , { name : 'Review profile import' } )
430+ await expect ( modal . getByText ( 'To update' , { exact : true } ) ) . toBeVisible ( )
433431 await mkdir ( screenshotDir , { recursive : true } )
434432 await page . screenshot ( { path : join ( screenshotDir , 'provisioned-import.png' ) } )
435- await modal . getByRole ( 'button' , { name : 'Import' , exact : true } ) . click ( )
433+ await modal . getByRole ( 'button' , { name : 'Import 1 profile ' , exact : true } ) . click ( )
436434 await expect ( modal ) . toHaveCount ( 0 )
437435 } finally {
438436 await browser . close ( )
@@ -544,23 +542,26 @@ async function run() {
544542 await page . route ( statusUrl , ( route ) =>
545543 route . fulfill ( { status : 503 , json : { error : 'Unavailable' } } )
546544 )
547- await page . getByRole ( 'button' , { name : 'Directory sync' , exact : true } ) . click ( )
548- const modal = page . getByRole ( 'dialog' , { name : 'Directory sync' , exact : true } )
549- await modal . getByRole ( 'button' , { name : 'Retry connection' } ) . waitFor ( )
545+ const openSync = page . getByRole ( 'button' , { name : 'Directory sync' , exact : true } )
546+ await openSync . click ( )
547+ await page . getByRole ( 'heading' , { name : 'Directory sync' , level : 1 } ) . waitFor ( )
548+ await page . getByRole ( 'button' , { name : 'Retry' , exact : true } ) . waitFor ( )
550549 await page . unroute ( statusUrl )
551- await expect ( modal . getByText ( 'Sync failed' , { exact : true } ) ) . toBeVisible ( {
550+ await expect ( page . getByText ( 'Sync failed' , { exact : true } ) ) . toBeVisible ( {
552551 timeout : 60_000 ,
553552 } )
554- await expect ( modal . getByText ( / r e p o r t i n g l o o p / ) ) . toBeVisible ( )
553+ await expect ( page . getByText ( / r e p o r t i n g l o o p / ) ) . toBeVisible ( )
555554 await page . screenshot ( { path : join ( screenshotDir , 'sync-failure.png' ) } )
556- await modal . getByRole ( 'button' , { name : 'Retry sync' } ) . click ( )
557- await expect ( modal . getByText ( 'Connected' , { exact : true } ) ) . toBeVisible ( )
558- await expect ( modal . getByText ( 'Last successful sync' ) ) . toBeVisible ( )
555+ await page . getByRole ( 'button' , { name : 'Retry sync' } ) . click ( )
556+ await expect ( page . getByText ( 'Connected' , { exact : true } ) ) . toBeVisible ( )
557+ await expect ( page . getByText ( 'Last successful sync' ) ) . toBeVisible ( )
559558 await page . setViewportSize ( { width : 390 , height : 844 } )
560559 await page . screenshot ( { path : join ( screenshotDir , 'sync-recovered-mobile.png' ) } )
561- const dialogBox = await modal . boundingBox ( )
562- assert ( dialogBox && dialogBox . x >= 0 && dialogBox . x + dialogBox . width <= 391 )
560+ assert (
561+ await page . evaluate ( ( ) => document . documentElement . scrollWidth <= window . innerWidth )
562+ )
563563 assert . equal ( record ( ( await chart ( ) ) . manager ) . email , bobEmail )
564+ await page . getByRole ( 'button' , { name : 'Back to people' } ) . click ( )
564565 await expect ( page . getByText ( 'Principal Engineer' , { exact : true } ) ) . toBeAttached ( )
565566 await patch ( token , `/Users/${ aliceId } ` , [
566567 { op : 'replace' , path : 'title' , value : 'Staff Platform Engineer' } ,
@@ -569,20 +570,20 @@ async function run() {
569570 await expect ( page . getByText ( 'Staff Platform Engineer' , { exact : true } ) ) . toBeAttached ( {
570571 timeout : 60_000 ,
571572 } )
572- await modal . getByRole ( 'button' , { name : 'Disconnect' , exact : true } ) . click ( )
573+ await openSync . click ( )
574+ await page . getByRole ( 'button' , { name : 'Disconnect SCIM provisioning' } ) . click ( )
573575 await page
574576 . getByRole ( 'dialog' , { name : 'Disconnect directory' } )
575577 . getByRole ( 'button' , { name : 'Disconnect' , exact : true } )
576578 . click ( )
577- await expect (
578- modal . getByRole ( 'button' , { name : 'Connect SCIM provisioning' } )
579- ) . toBeVisible ( )
580- await modal . getByRole ( 'button' , { name : 'Connect SCIM provisioning' } ) . click ( )
579+ const connectScim = page . getByRole ( 'button' , { name : 'Connect SCIM provisioning' } )
580+ await expect ( connectScim ) . toBeVisible ( )
581+ await connectScim . click ( )
581582 await page
582583 . getByRole ( 'dialog' , { name : 'Connect SCIM provisioning' } )
583584 . getByRole ( 'button' , { name : 'Connect and sync' } )
584585 . click ( )
585- await expect ( modal . getByText ( 'Connected' , { exact : true } ) ) . toBeVisible ( )
586+ await expect ( page . getByText ( 'Connected' , { exact : true } ) ) . toBeVisible ( )
586587 } finally {
587588 await browser . close ( )
588589 }
0 commit comments