Chore(UI): Fix playwright test failures in AUTs#27706
Conversation
There was a problem hiding this comment.
Pull request overview
Stabilizes Playwright E2E tests in AUT environments by adjusting navigation validation logic and reducing/altering custom-properties cleanup behaviors that can cause test failures.
Changes:
- Simplified dropdown expansion waiting/verification in
validateLeftSidebarWithHiddenItems. - Removed custom-property cleanup helpers from shared entity support classes.
- Updated Custom Properties E2E spec cleanup and adjusted the SQL CodeMirror scroll test input.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/playwright/utils/customizeNavigation.ts | Updates sidebar hidden-item validation flow and dropdown visibility assertions. |
| openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityDataClass.ts | Removes custom-properties schema cleanup from global post-requisites. |
| openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts | Removes per-entity custom-properties cleanup helper and related import. |
| openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts | Removes custom-properties cleanup call in afterAll and tweaks SQL scroll test typing behavior. |
Comments suppressed due to low confidence (2)
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/CustomProperties.spec.ts:312
- This
afterAllnow deletes the entity but no longer cleans up the custom properties created inbeforeAllviaprepareCustomProperty(). SincecreateCustomPropertyForEntity()adds randomcp-*-<uuid>definitions to the entity's metadata type, rerunning against a persistent AUT can accumulate many custom properties and impact other tests. Consider adding a targeted cleanup step that removes only the custom properties created for this test (track the created names frommainEntity.customPropertyValue), rather than removing the entire/customPropertiesarray.
test.afterAll(async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
if (makeInstance !== null) {
await mainEntity.delete(apiContext);
if (key === 'entity_dataProduct') {
for (const domain of (mainEntity as DataProduct).getDomains()) {
await domain.delete(apiContext);
}
}
} else if (tableForColumnTest !== null) {
openmetadata-ui/src/main/resources/ui/playwright/utils/customizeNavigation.ts:103
- For items that are nested under a dropdown (those present in
SIDEBAR_LIST_ITEMS), the code expands the parent, validates the child, then collapses the parent again. After that, the function falls through to the generichiddenItems.includes(item)visibility assertion forapp-bar-item-${item}; at this point the submenu is collapsed, so the child item will typically be hidden and the assertion can fail for non-hidden items. Consider skipping the generic assertion for these nested items (e.g.,continueafter collapsing), or performing theapp-bar-item-${item}assertion while the parent submenu is still expanded.
await page.click(`[data-testid="${items[0]}"]`);
}
if (hiddenItems.includes(item)) {
await expect(
page.getByTestId('left-sidebar').getByTestId(`app-bar-item-${item}`)
).not.toBeVisible();
} else {
Code Review ✅ ApprovedUpdates Playwright selectors and timeout configurations to resolve intermittent test failures in the application under test. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
🟡 Playwright Results — all passed (21 flaky)✅ 3955 passed · ❌ 0 failed · 🟡 21 flaky · ⏭️ 86 skipped
🟡 21 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Failed to cherry-pick changes to the 1.12.7 branch. |
* Fix the failures in ExplorePageRightPanel, EntityPermissions, CustomProperties specs * Fix checkstyle * Fix customizeDetailsPage spec * Fix the test flakiness and failures * fix checkstyle
* Fix the failures in ExplorePageRightPanel, EntityPermissions, CustomProperties specs * Fix checkstyle * Fix customizeDetailsPage spec * Fix the test flakiness and failures * fix checkstyle



Fix the failures in
Failing due to custom property cleanup happening in other spec/ teardown step before tests run. Hence removed the cleanups for custom properties.
Failing due to the query is not long enought to show the scroll bar.
Summary by Gitar
domain.tsto improve test reliability for domain selections.customizeNavigation.tsto refine visibility assertions for nested sidebar items.customProperty.tsby updating the URL filter fromprofiletofields.This will update automatically on new commits.