@@ -673,21 +673,34 @@ try {
673673 await parentCdp . detach ( )
674674 }
675675 )
676- await check ( 'Ordinary Sim pages attach without capturing sensitive fields' , async ( ) => {
677- for ( const path of [ '/workspace/example' , '/extension-notes' ] ) {
676+ await check ( 'Ordinary Sim and encoded remote pages attach without sensitive fields' , async ( ) => {
677+ for ( const url of [
678+ `${ origin } /workspace/example` ,
679+ `${ origin } /extension-notes` ,
680+ `${ origin } /workspace/%E2%9C%93` ,
681+ `${ pageOrigin } /ticket/100%done` ,
682+ ] ) {
678683 const before = ( await snapshots ( ) ) . length
679- await page . goto ( `${ origin } ${ path } ?token=URL_SECRET#FRAGMENT_SECRET` )
684+ await page . goto ( `${ url } ?token=URL_SECRET#FRAGMENT_SECRET` )
680685 await page . bringToFront ( )
681686 await capture ( )
682687 await expect . poll ( async ( ) => ( await snapshots ( ) ) . length ) . toBe ( before + 1 )
683688 const snapshot = ( await snapshots ( ) ) . at ( - 1 )
684- assert ( snapshot ?. url === ` ${ origin } ${ path } ` , 'Sim page URL retained private parameters' )
685- assert ( snapshot . text . includes ( 'visible-reference-482' ) , 'Visible Sim page content is missing' )
686- assert ( ! snapshot . text . includes ( 'SENTINEL' ) , 'Sensitive Sim page content was captured' )
689+ assert ( snapshot ?. url === url , 'Page URL retained private parameters' )
690+ assert ( snapshot . text . includes ( 'visible-reference-482' ) , 'Visible page content is missing' )
691+ assert ( ! snapshot . text . includes ( 'SENTINEL' ) , 'Sensitive page content was captured' )
687692 }
688693 } )
689- await check ( 'Embedded Sim chat pages cannot capture themselves' , async ( ) => {
690- for ( const path of [ '/extension' , '/extension/workspace' , '/extension/o/organization' ] ) {
694+ await check ( 'Embedded chat and malformed Sim paths fail closed' , async ( ) => {
695+ for ( const path of [
696+ '/extension' ,
697+ '/extension/workspace' ,
698+ '/extension/o/organization' ,
699+ '/%65xtension' ,
700+ '/%65xtension/workspace' ,
701+ '/extension%2fworkspace' ,
702+ '/extension%ZZ/workspace' ,
703+ ] ) {
691704 await page . goto ( `${ origin } /workspace/example` )
692705 await page . bringToFront ( )
693706 const previous = ( await snapshots ( ) ) . length
@@ -698,8 +711,8 @@ try {
698711 await page . goto ( `${ origin } ${ path } ` )
699712 await page . bringToFront ( )
700713 await capture ( )
701- await panel . getByRole ( 'status' ) . filter ( { hasText : 'Choose a regular web page ' } ) . waitFor ( )
702- assert ( ( await snapshots ( ) ) . length === before , 'Embedded chat was captured' )
714+ await panel . getByRole ( 'status' ) . filter ( { hasText : 'This page cannot be attached. ' } ) . waitFor ( )
715+ assert ( ( await snapshots ( ) ) . length === before , 'An excluded Sim path was captured' )
703716 }
704717 } )
705718 await check (
0 commit comments