@@ -99,6 +99,24 @@ test.describe('Published Paragraph', () => {
9999 timeout : 10000
100100 } ) ;
101101 } ) ;
102+
103+ test ( 'should enter published paragraph in React mode via URL with react=true' , async ( { page } ) => {
104+ await test . step ( 'Given I navigate to React mode URL' , async ( ) => {
105+ const reactModeUrl = `/#/notebook/${ testNotebook . noteId } /paragraph/${ testNotebook . paragraphId } ?react=true` ;
106+ await page . goto ( reactModeUrl ) ;
107+ await waitForZeppelinReady ( page ) ;
108+
109+ // URL 이동 완료까지 명시적으로 대기
110+ await page . waitForURL ( `**/${ testNotebook . noteId } /paragraph/${ testNotebook . paragraphId } *` , {
111+ timeout : 15000
112+ } ) ;
113+ } ) ;
114+
115+ await test . step ( 'Then React mode should be active' , async ( ) => {
116+ const currentUrl = page . url ( ) ;
117+ expect ( currentUrl ) . toContain ( 'react=true' ) ;
118+ } ) ;
119+ } ) ;
102120 } ) ;
103121
104122 test ( 'should show confirmation modal and allow running the paragraph' , async ( { page } ) => {
@@ -138,4 +156,53 @@ test.describe('Published Paragraph', () => {
138156 await runButton . click ( ) ;
139157 await expect ( modal ) . toBeHidden ( ) ;
140158 } ) ;
159+
160+ test ( 'should show confirmation modal in React mode and allow running the paragraph' , async ( { page } ) => {
161+ const { noteId, paragraphId } = testNotebook ;
162+
163+ await test . step ( 'Given I clear paragraph output in normal notebook view' , async ( ) => {
164+ await publishedParagraphPage . navigateToNotebook ( noteId ) ;
165+
166+ const paragraphElement = page . locator ( 'zeppelin-notebook-paragraph' ) . first ( ) ;
167+ const paragraphResult = paragraphElement . locator ( 'zeppelin-notebook-paragraph-result' ) ;
168+
169+ // Only clear output if result exists
170+ if ( await paragraphResult . isVisible ( ) ) {
171+ const settingsButton = paragraphElement . locator ( 'a[nz-dropdown]' ) ;
172+ await settingsButton . click ( ) ;
173+
174+ const clearOutputButton = page . locator ( 'li.list-item:has-text("Clear output")' ) ;
175+ await clearOutputButton . click ( ) ;
176+ await expect ( paragraphResult ) . toBeHidden ( ) ;
177+ }
178+ } ) ;
179+
180+ await test . step ( 'When I navigate to React mode published paragraph URL' , async ( ) => {
181+ const reactModeUrl = `/#/notebook/${ noteId } /paragraph/${ paragraphId } ?react=true` ;
182+ await page . goto ( reactModeUrl ) ;
183+ await waitForZeppelinReady ( page ) ;
184+
185+ // Wait for React mode to load
186+ await page . waitForTimeout ( 2000 ) ;
187+ } ) ;
188+
189+ await test . step ( 'Then confirmation modal should appear in React mode' , async ( ) => {
190+ const modal = publishedParagraphPage . confirmationModal ;
191+ await expect ( modal ) . toBeVisible ( { timeout : 30000 } ) ;
192+
193+ // Check for the enhanced modal content
194+ await expect ( publishedParagraphPage . modalTitle ) . toHaveText ( 'Run Paragraph?' ) ;
195+
196+ // Verify that the modal shows code preview
197+ const modalContent = publishedParagraphPage . confirmationModal . locator ( '.ant-modal-confirm-content' ) ;
198+ await expect ( modalContent ) . toContainText ( 'This paragraph contains the following code:' ) ;
199+ await expect ( modalContent ) . toContainText ( 'Would you like to execute this code?' ) ;
200+
201+ // Click the Run button in the modal (OK button in confirmation modal)
202+ const runButton = modal . locator ( '.ant-modal-confirm-btns .ant-btn-primary' ) ;
203+ await expect ( runButton ) . toBeVisible ( ) ;
204+ await runButton . click ( ) ;
205+ await expect ( modal ) . toBeHidden ( ) ;
206+ } ) ;
207+ } ) ;
141208} ) ;
0 commit comments