-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-6371] Convert published paragraph rendering to Micro Frontend(Angular to React) in New UI #5111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[ZEPPELIN-6371] Convert published paragraph rendering to Micro Frontend(Angular to React) in New UI #5111
Changes from all commits
b11b186
6b85c4a
34272cb
b04b641
fda87d3
0ffda95
a96218e
2dbd507
82a963b
ecddfbc
55b61be
291a5cc
cd54756
3dcb84d
9bc4edb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,23 @@ test.describe('Published Paragraph', () => { | |
| timeout: 10000 | ||
| }); | ||
| }); | ||
|
|
||
| test('should enter published paragraph in React mode via URL with react=true', async ({ page }) => { | ||
| await test.step('Given I navigate to React mode URL', async () => { | ||
| const reactModeUrl = `/#/notebook/${testNotebook.noteId}/paragraph/${testNotebook.paragraphId}?react=true`; | ||
| await page.goto(reactModeUrl); | ||
| await waitForZeppelinReady(page); | ||
|
|
||
| await page.waitForURL(`**/${testNotebook.noteId}/paragraph/${testNotebook.paragraphId}*`, { | ||
| timeout: 15000 | ||
| }); | ||
| }); | ||
|
|
||
| await test.step('Then React mode should be active', async () => { | ||
| const currentUrl = page.url(); | ||
| expect(currentUrl).toContain('react=true'); | ||
| }); | ||
| }); | ||
|
Comment on lines
+103
to
+118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there's no special handling in place, navigating to a URL that includes query parameters will always result in those parameters being present in the final URL. In that case, wouldn't this test always pass regardless of whether React mode is actually active? It may be better to either remove this test or revise it to validate React mode using a different, more reliable indicator. |
||
| }); | ||
|
|
||
| test('should show confirmation modal and allow running the paragraph', async ({ page }) => { | ||
|
|
@@ -122,7 +139,7 @@ test.describe('Published Paragraph', () => { | |
| await publishedParagraphPage.navigateToPublishedParagraph(noteId, paragraphId); | ||
|
|
||
| const modal = publishedParagraphPage.confirmationModal; | ||
| await expect(modal).toBeVisible(); | ||
| await expect(modal).toBeVisible({ timeout: 300000 }); | ||
|
|
||
| // Check for the new enhanced modal content | ||
| await expect(publishedParagraphPage.modalTitle).toHaveText('Run Paragraph?'); | ||
|
|
@@ -138,4 +155,53 @@ test.describe('Published Paragraph', () => { | |
| await runButton.click(); | ||
| await expect(modal).toBeHidden(); | ||
| }); | ||
|
|
||
| test('should show confirmation modal in React mode and allow running the paragraph', async ({ page }) => { | ||
| const { noteId, paragraphId } = testNotebook; | ||
|
|
||
| await test.step('Given I clear paragraph output in normal notebook view', async () => { | ||
| await publishedParagraphPage.navigateToNotebook(noteId); | ||
|
|
||
| const paragraphElement = page.locator('zeppelin-notebook-paragraph').first(); | ||
| const paragraphResult = paragraphElement.locator('zeppelin-notebook-paragraph-result'); | ||
|
|
||
| // Only clear output if result exists | ||
| if (await paragraphResult.isVisible()) { | ||
| const settingsButton = paragraphElement.locator('a[nz-dropdown]'); | ||
| await settingsButton.click(); | ||
|
|
||
| const clearOutputButton = page.locator('li.list-item:has-text("Clear output")'); | ||
| await clearOutputButton.click(); | ||
| await expect(paragraphResult).toBeHidden(); | ||
| } | ||
|
Comment on lines
+168
to
+176
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think test scenarios should be as deterministic as possible. |
||
| }); | ||
|
|
||
| await test.step('When I navigate to React mode published paragraph URL', async () => { | ||
| const reactModeUrl = `/#/notebook/${noteId}/paragraph/${paragraphId}?react=true`; | ||
| await page.goto(reactModeUrl); | ||
| await waitForZeppelinReady(page); | ||
|
|
||
| // Wait for React mode to load | ||
| await page.waitForTimeout(2000); | ||
| }); | ||
|
|
||
| await test.step('Then confirmation modal should appear in React mode', async () => { | ||
| const modal = publishedParagraphPage.confirmationModal; | ||
| await expect(modal).toBeVisible({ timeout: 30000 }); | ||
|
|
||
| // Check for the enhanced modal content | ||
| await expect(publishedParagraphPage.modalTitle).toHaveText('Run Paragraph?'); | ||
|
|
||
| // Verify that the modal shows code preview | ||
| const modalContent = publishedParagraphPage.confirmationModal.locator('.ant-modal-confirm-content'); | ||
| await expect(modalContent).toContainText('This paragraph contains the following code:'); | ||
| await expect(modalContent).toContainText('Would you like to execute this code?'); | ||
|
|
||
| // Click the Run button in the modal (OK button in confirmation modal) | ||
| const runButton = modal.locator('.ant-modal-confirm-btns .ant-btn-primary'); | ||
| await expect(runButton).toBeVisible(); | ||
| await runButton.click(); | ||
| await expect(modal).toBeHidden(); | ||
| }); | ||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd better add a
.gitignorefile insidezeppelin-reactdirectory to ignoredistandnode_modulesinzeppelin-react.