@@ -895,6 +895,36 @@ await page.GetByTestId("testid").HoverAsync();`);
895895 await expect ( glassPane . locator ( '> x-pw-dialog .accept > x-div' ) . evaluate ( elem => getComputedStyle ( elem ) . clipPath ) ) . resolves . toBe ( 'url("#icon-check")' ) ;
896896 await expect ( glassPane . locator ( '> svg > defs > clipPath#icon-check' ) ) . toBeAttached ( ) ;
897897 } ) ;
898+
899+ test ( 'should keep dialog open when clicking inside' , async ( { openRecorder } ) => {
900+ const { page } = await openRecorder ( ) ;
901+ await page . setContent ( '<div>hello</div>' ) ;
902+
903+ const assertTextButton = page . getByTitle ( 'Assert text' ) ;
904+ const helloContent = page . getByText ( 'hello' ) ;
905+
906+ await assertTextButton . click ( ) ;
907+ await helloContent . click ( ) ;
908+
909+ const dialog = page . locator ( 'x-pw-dialog' ) ;
910+ await expect ( dialog ) . toBeVisible ( ) ;
911+
912+ await page . locator ( 'x-pw-dialog x-pw-tools-list' ) . click ( ) ;
913+ await expect ( dialog ) . toBeVisible ( ) ;
914+
915+ await page . locator ( 'x-pw-dialog textarea' ) . click ( ) ;
916+ await expect ( dialog ) . toBeVisible ( ) ;
917+
918+ await page . locator ( 'x-pw-dialog .accept' ) . click ( ) ;
919+ await expect ( dialog ) . toBeHidden ( ) ;
920+
921+ await assertTextButton . click ( ) ;
922+ await helloContent . click ( ) ;
923+ await expect ( dialog ) . toBeVisible ( ) ;
924+ // Like the user clicking outside the dialog
925+ await page . locator ( 'x-pw-glass' ) . click ( ) ;
926+ await expect ( dialog ) . toBeHidden ( ) ;
927+ } ) ;
898928} ) ;
899929
900930async function createFrameHierarchy ( page : Page , recorder : Recorder , server : TestServer ) {
0 commit comments