Skip to content

Commit f08ec0c

Browse files
committed
fix broken tests
1 parent 816f75c commit f08ec0c

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

zeppelin-web-angular/e2e/models/base-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class BasePage {
2222
}
2323

2424
async waitForPageLoad(): Promise<void> {
25-
await this.page.waitForLoadState('domcontentloaded');
26-
await this.loadingScreen.waitFor({ state: 'hidden', timeout: 15000 });
25+
await this.page.waitForLoadState('domcontentloaded', { timeout: 15000 });
26+
await this.page.waitForLoadState('networkidle', { timeout: 30000 });
2727
}
2828
}

zeppelin-web-angular/e2e/utils.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,11 @@ export async function navigateToNotebookWithFallback(page: Page, noteId: string,
317317
await page.waitForLoadState('networkidle', { timeout: 15000 });
318318
await page.waitForSelector('zeppelin-node-list', { timeout: 15000 });
319319

320-
const notebookLink = page.locator(`a[href*="/notebook/"]`).filter({ hasText: notebookName });
321-
await notebookLink.waitFor({ state: 'visible', timeout: 10000 });
322-
await notebookLink.click();
320+
// The link text in the UI is the base name of the note, not the full path.
321+
const baseName = notebookName.split('/').pop();
322+
const notebookLink = page.locator(`a[href*="/notebook/"]`).filter({ hasText: baseName! });
323+
// Use the click action's built-in wait.
324+
await notebookLink.click({ timeout: 10000 });
323325

324326
await page.waitForURL(/\/notebook\/[^\/\?]+/, { timeout: 20000 });
325327
navigationSuccessful = true;
@@ -383,9 +385,10 @@ export async function createTestNotebook(
383385
await page.waitForLoadState('networkidle', { timeout: 15000 });
384386
await page.waitForSelector('zeppelin-node-list', { timeout: 15000 });
385387

386-
const notebookLink = page.locator(`a[href*="/notebook/"]`).filter({ hasText: notebookName });
387-
await notebookLink.waitFor({ state: 'visible', timeout: 10000 });
388-
await notebookLink.click();
388+
// Use baseNotebookName for the filter, as the link text in the UI won't contain the full path.
389+
const notebookLink = page.locator(`a[href*="/notebook/"]`).filter({ hasText: baseNotebookName });
390+
// Use the click action's built-in wait.
391+
await notebookLink.click({ timeout: 10000 });
389392
await page.waitForURL(/\/notebook\/[^\/\?]+/, { timeout: 20000 });
390393

391394
// Extract noteId after successful navigation through home page

0 commit comments

Comments
 (0)