Skip to content

Commit 1dc6ffa

Browse files
committed
fix broken tests
1 parent e823443 commit 1dc6ffa

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class HomePage extends BasePage {
6969
this.notebookSection = page.locator('text=Notebook').first();
7070
this.helpSection = page.locator('text=Help').first();
7171
this.communitySection = page.locator('text=Community').first();
72-
this.createNewNoteButton = page.locator('zeppelin-node-list a').filter({ hasText: 'Create new Note' });
72+
this.createNewNoteButton = page.getByText('Create new Note', { exact: true }).first();
7373
this.importNoteButton = page.locator('text=Import Note');
7474
this.searchInput = page.locator('textbox', { hasText: 'Search' });
7575
this.filterInput = page.locator('input[placeholder*="Filter"]');

zeppelin-web-angular/e2e/models/notebook-action-bar-page.util.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,13 @@ export class NotebookActionBarUtil {
6666

6767
const initialCodeVisibility = await this.actionBarPage.isCodeVisible();
6868
await this.actionBarPage.toggleCodeVisibility();
69-
const newCodeVisibility = await this.actionBarPage.isCodeVisible();
7069

70+
// Wait for the icon to change by checking for the expected icon
71+
const expectedIcon = initialCodeVisibility ? 'fullscreen' : 'fullscreen-exit';
72+
const icon = this.actionBarPage.showHideCodeButton.locator('i[nz-icon] svg');
73+
await expect(icon).toHaveAttribute('data-icon', expectedIcon, { timeout: 5000 });
74+
75+
const newCodeVisibility = await this.actionBarPage.isCodeVisible();
7176
expect(newCodeVisibility).toBe(!initialCodeVisibility);
7277

7378
// Verify the button is still functional after click
@@ -80,8 +85,13 @@ export class NotebookActionBarUtil {
8085

8186
const initialOutputVisibility = await this.actionBarPage.isOutputVisible();
8287
await this.actionBarPage.toggleOutputVisibility();
83-
const newOutputVisibility = await this.actionBarPage.isOutputVisible();
8488

89+
// Wait for the icon to change by checking for the expected icon
90+
const expectedIcon = initialOutputVisibility ? 'book' : 'read';
91+
const icon = this.actionBarPage.showHideOutputButton.locator('i[nz-icon] svg');
92+
await expect(icon).toHaveAttribute('data-icon', expectedIcon, { timeout: 5000 });
93+
94+
const newOutputVisibility = await this.actionBarPage.isOutputVisible();
8595
expect(newOutputVisibility).toBe(!initialOutputVisibility);
8696

8797
// Verify the button is still functional after click

zeppelin-web-angular/e2e/models/notebook.util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export class NotebookUtil extends BasePage {
6060

6161
// Wait for the notebook to be created and navigate to it with enhanced error handling
6262
try {
63-
await this.page.waitForURL(url => url.toString().includes('/notebook/'), { timeout: 60000 });
63+
await this.page.waitForURL(url => url.toString().includes('/notebook/'), { timeout: 90000 });
64+
const notebookTitleLocator = this.page.locator('.notebook-title-editor');
65+
await expect(notebookTitleLocator).toHaveText(notebookName, { timeout: 15000 });
6466
} catch (urlError) {
6567
console.warn('URL change timeout, checking current URL:', this.page.url());
6668
// If URL didn't change as expected, check if we're already on a notebook page

0 commit comments

Comments
 (0)