Skip to content

Conversation

@dididy
Copy link
Contributor

@dididy dididy commented Dec 30, 2025

What is this PR for?

PR Description

This PR improves the readability and maintainability of the E2E notebook tests.

  • Removed over-abstracted util and wrapper methods
  • Moved test logic from util files into the test cases
  • Simplified page objects to focus on direct UI interactions
  • Consolidated shared logic into a base page class

As a result, the tests are clearer, flatter, and easier to maintain.

What type of PR is it?

Refactoring

Todos

What is the Jira issue?

ZEPPELIN-6358

How should this be tested?

Screenshots (if appropriate)

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

Comment on lines 87 to 110
async clickFirstVisibleElement(
selectors: string[],
options?: {
parent?: Locator;
visibilityTimeout?: number;
clickTimeout?: number;
}
): Promise<boolean> {
const { parent, visibilityTimeout = 2000, clickTimeout = 5000 } = options || {};
const baseLocator = parent || this.page;

for (const selector of selectors) {
try {
const element = baseLocator.locator(selector);
if (await element.isVisible({ timeout: visibilityTimeout })) {
await element.click({ timeout: clickTimeout });
return true;
}
} catch (e) {
continue;
}
}
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could remove this if it isn't used anywhere.

Comment on lines 48 to 53
try {
await this.welcomeTitle.waitFor({ state: 'visible', timeout: 5000 });
return true;
} catch (e) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is not being used.

Comment on lines 57 to 62
if (browserName === 'webkit') {
const currentUrl = page.url();
await page.goto(currentUrl, { waitUntil: 'load' });
} else {
page.reload();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some comments about this if-else branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic was originally added as a workaround for an issue that occurred only on WebKit after upgrading Playwright to a newer version. Since it is expected to work correctly on WebKit with the current Playwright version, I removed the conditional handling. I’ll verify the CI results and address any issues if needed. I also cleaned up other unused and unnecessary methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants