Skip to content

test:Added missing test for ontology#27423

Merged
anuj-kumary merged 5 commits intomainfrom
ontology-explorer-specs
Apr 16, 2026
Merged

test:Added missing test for ontology#27423
anuj-kumary merged 5 commits intomainfrom
ontology-explorer-specs

Conversation

@anuj-kumary
Copy link
Copy Markdown
Member

@anuj-kumary anuj-kumary commented Apr 16, 2026

Describe your changes:

Added missing ontology features test

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

@anuj-kumary anuj-kumary self-assigned this Apr 16, 2026
@anuj-kumary anuj-kumary added the UI UI specific issues label Apr 16, 2026
@anuj-kumary anuj-kumary requested a review from a team as a code owner April 16, 2026 08:26
@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.72% (59583/93500) 43.66% (31344/71791) 46.72% (9418/20157)

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 16, 2026

Code Review ⚠️ Changes requested 2 resolved / 3 findings

Adds missing tests for ontology and resolves issues with silent test failures and leaked data attributes. The removal of Node Context Menu tests without replacement must be addressed before proceeding.

⚠️ Quality: Context menu tests removed without replacement

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OntologyExplorer.spec.ts:689-703

The entire Node Context Menu test.describe block was removed, including tests for:

  • Opening context menu on right-click
  • Verifying all menu items are visible (focus, details, open-new-tab, copy-fqn)
  • Closing context menu when clicking outside
  • Opening entity panel via 'View Details' context menu action

These tests covered real user-facing functionality. With the new readNodePositions helper, rewriting them to be deterministic (right-click at a known node position) should be straightforward. Consider re-adding them using clickFirstGraphNode-style helpers with { button: 'right' }.

✅ 2 resolved
Quality: Silent test pass hides failures in Entity Panel Close

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OntologyExplorer.spec.ts:1022-1024
In the 'Entity Panel Close' test, when clickCanvasToFindNode returns false, the test silently passes with expect(true).toBe(true) (line 1023). This means the test can report success without actually verifying the close behavior, masking regressions. If node-clicking is unreliable in CI, consider marking the test as test.fixme() or test.skip() with a reason, rather than silently passing.

Performance: Test-only data attribute serialized to DOM in production

📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/OntologyGraphG6.tsx:58-60 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/OntologyGraphG6.tsx:190 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyGraph.ts:236-238 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyGraph.ts:291-292 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyGraph.ts:370-384
The data-node-positions attribute (line 190 of OntologyGraphG6.tsx) serializes all node positions as JSON into the production DOM on every layout update. This state + attribute exists solely to support Playwright tests reading node coordinates. For graphs with many nodes, JSON.stringify(nodePagePositions) on every layout/fit-view/reset cycle adds unnecessary work and bloats the DOM in production.

Consider gating this behind process.env.NODE_ENV !== 'production' or using Playwright's page.evaluate() to call graph.getNodeData() / graph.getElementPosition() directly on the G6 graph instance, avoiding production code changes entirely.

🤖 Prompt for agents
Code Review: Adds missing tests for ontology and resolves issues with silent test failures and leaked data attributes. The removal of Node Context Menu tests without replacement must be addressed before proceeding.

1. ⚠️ Quality: Context menu tests removed without replacement
   Files: openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/OntologyExplorer.spec.ts:689-703

   The entire `Node Context Menu` test.describe block was removed, including tests for:
   - Opening context menu on right-click
   - Verifying all menu items are visible (focus, details, open-new-tab, copy-fqn)
   - Closing context menu when clicking outside
   - Opening entity panel via 'View Details' context menu action
   
   These tests covered real user-facing functionality. With the new `readNodePositions` helper, rewriting them to be deterministic (right-click at a known node position) should be straightforward. Consider re-adding them using `clickFirstGraphNode`-style helpers with `{ button: 'right' }`.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

🟡 Playwright Results — all passed (27 flaky)

✅ 3655 passed · ❌ 0 failed · 🟡 27 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 477 0 3 4
🟡 Shard 2 648 0 3 7
🟡 Shard 3 651 0 6 1
🟡 Shard 4 629 0 5 27
🟡 Shard 5 610 0 1 42
🟡 Shard 6 640 0 9 8
🟡 27 flaky test(s) (passed on retry)
  • Flow/Metric.spec.ts › Verify Related Metrics Update (shard 1, 1 retry)
  • Pages/Customproperties-part1.spec.ts › Time Interval (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › Automated badge should appear on entity description with Automated source (shard 2, 1 retry)
  • Features/Glossary/GlossaryHierarchy.spec.ts › should cancel move operation (shard 2, 1 retry)
  • Features/Permissions/GlossaryPermissions.spec.ts › Team-based permissions work correctly (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Pipeline (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for SearchIndex (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Owner Rule Any_In (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Rename domain with tags and glossary terms preserves associations (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Add and Remove Assets (shard 5, 1 retry)
  • Pages/HyperlinkCustomProperty.spec.ts › should accept valid http and https URLs (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Container (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Data Model (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@anuj-kumary anuj-kumary enabled auto-merge (squash) April 16, 2026 14:13
@anuj-kumary anuj-kumary merged commit bd51ae1 into main Apr 16, 2026
55 of 56 checks passed
@anuj-kumary anuj-kumary deleted the ontology-explorer-specs branch April 16, 2026 15:43
siddhant1 pushed a commit that referenced this pull request Apr 17, 2026
* test:Added missing test for ontology

* Added other missing part of test

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants