Skip to content

Conversation

@kshinde3110
Copy link

@kshinde3110 kshinde3110 commented Jan 13, 2026

Describe your changes:

Fixes

I worked on adding some missing classification and tags page tests

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.

Summary by Gitar

  • New E2E test file:
    • Classification.spec.ts with 7 comprehensive test scenarios covering pagination, tag editing, enable/disable, domain management, usage counts, mutually exclusive behavior, and duplicate handling
  • Test coverage expansion:
    • 1,162 lines of Playwright tests using ClassificationClass, TagClass, TableClass, and Domain support classes with API-based setup and UI validation

This will update automatically on new commits.


@github-actions
Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions
Copy link
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.71% (55122/83885) 44.68% (28383/63531) 47.64% (8662/18181)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment on lines 215 to 219
await page.waitForTimeout(500);

const tenPerPageOption = page.getByRole('menuitem', {
name: '10 / Page',
});
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Avoid using arbitrary timeouts. According to the Playwright Developer Handbook, prefer waiting for specific API responses, element visibility, or use waitForAllLoadersToDisappear. Arbitrary timeouts make tests slower and more flaky. Consider waiting for the menu to be visible or for a specific element state instead.

Suggested change
await page.waitForTimeout(500);
const tenPerPageOption = page.getByRole('menuitem', {
name: '10 / Page',
});
const tenPerPageOption = page.getByRole('menuitem', {
name: '10 / Page',
});
await expect(tenPerPageOption).toBeVisible();

Copilot uses AI. Check for mistakes.

// Test changing to 25 per page
await pageSizeDropdown.click();
await page.waitForTimeout(500);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Avoid using arbitrary timeouts. Replace with a wait for the menu option to be visible or the dropdown to be fully rendered.

Copilot uses AI. Check for mistakes.

// Test changing to 50 per page (if available)
await pageSizeDropdown.click();
await page.waitForTimeout(500);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Avoid using arbitrary timeouts. Replace with a wait for the dropdown or specific element to be ready.

Copilot uses AI. Check for mistakes.
@gitar-bot
Copy link

gitar-bot bot commented Jan 21, 2026

Code Review 👍 Approved with suggestions 0 resolved / 5 findings

Good test coverage expansion with several commented-out code blocks that should be cleaned up.

More details 💡 5 suggestions
💡 Quality: Commented-out code left in production

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Classification.spec.ts:675

There's a commented-out wait for response that should either be uncommented and used, or removed entirely if it's not needed:

// await domainOptionToRemove.waitFor({ state: 'visible', timeout: 50000 });

Having commented-out code in tests can be confusing for future maintainers - they won't know if it was intentionally removed or accidentally left behind. If the wait is not needed, remove the comment. If it's needed, uncomment it.

💡 Edge Case: Commented-out response wait may cause flaky tests

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Classification.spec.ts:825-833

In the 'Usage Count Accuracy' test, there's a commented-out waitForResponse for the PATCH request when removing a tag:

// const removeTagResponse = page.waitForResponse(
//   (response) =>
//     response.url().includes('/api/v1/columns/name/') &&
//     response.request().method() === 'PATCH'
// );
...
// await removeTagResponse;

Without waiting for the API response, the test may proceed before the removal is complete, leading to flaky test results. Either uncomment and use the response wait, or verify the implementation works reliably without it.

💡 Quality: Commented-out assertion should be fixed or removed

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Classification.spec.ts:559-563

In the 'Enable/Disable Tag via UI Toggle' test, there's a commented-out assertion:

// Verify that the "Add Asset" button is disabled when the tag is disabled
// await expect(
//   page.getByTestId('data-assets-add-button')
// ).toBeDisabled();

This assertion appears to be important for validating that disabled tags cannot have assets added. If the assertion was failing due to an incorrect test ID (note: the test uses data-classification-add-button elsewhere), update the selector. Otherwise, the assertion should be active to properly validate the expected behavior.

💡 Quality: Commented-out response wait may cause flaky test

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Classification.spec.ts:923-925

In the 'Mutually Exclusive Behavior' test, there's a commented-out waitForResponse:

// await page.waitForResponse(
//   `/api/v1/search/query?q=*${encodeURIComponent(tagA.data.name)}*`
// );

Without waiting for the search response, the test may try to click on the tag option before search results are rendered, potentially causing flaky failures. Consider uncommenting this or using an alternative wait mechanism.

💡 Quality: Large commented-out test should be removed or fixed

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Tags.spec.ts:1307

There's a large commented-out test block (~200 lines) for 'Tag Page Activity Feed' starting at line 1307 with the comment "Commented this since the test is failing". This is problematic because:

  1. It adds significant noise to the codebase
  2. The reason for failure should be investigated and tracked in an issue
  3. If the test isn't needed now, it shouldn't be committed

Recommendation: Either fix the test, remove it entirely, or track the issue in a bug ticket and skip the test with test.skip() which provides better documentation:

test.skip('Tag Page Activity Feed', async ({ page }) => {
  // TODO: Skipped - see issue #XXXX
  ...
});

What Works Well

Comprehensive test coverage for Classification and Tags pages including pagination, CRUD operations, mutually exclusive behavior, and edge cases like duplicate handling. Tests follow good patterns with proper setup/teardown and API response waits.

Recommendations

Consider cleaning up commented-out code before merging. Use test.skip() with issue references instead of commenting out entire tests - this provides better traceability. The commented-out response waits in particular could lead to flaky tests if the async operations aren't completing before assertions run.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link

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.

3 participants