test(e2e): pin the classification Users.spec asserts Data Consumer permissions on - #33042
harsh-vador wants to merge 3 commits into
Conversation
…rmissions on Users.spec asserted that a Data Consumer sees no Manage button on the Tags page, but the page lands on whichever classification the API lists first. Since #31938 the Manage menu also carries Export, gated only on ViewAll, so on any user-created classification a viewer now legitimately sees it. The assertion kept passing only while a system classification (Certification) sorted first. ContextCenterArticles.spec creates `cc_classification_<uuid>` in beforeAll and never deletes it. `cc_` sorts ahead of `Certification`, so once that spec ran in the same server the leaked classification became the default and Users.spec failed — a worker-ordering race, hence the intermittent nightly. - Users.spec: visit Certification explicitly and assert no Manage button; then create a user classification and assert Manage shows Export only (no Import / Edit / Delete). Covers the actual permission rule instead of depending on list order. - ContextCenterArticles.spec: add afterAll that deletes the classification (recursive delete removes its tags). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
Code Review ✅ ApprovedPins the Data Consumer classification permission assertion in Users.spec to OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
closing this pr as test needs to be changed according to new changes |
Describe your changes
Fixes the intermittent failure of
Users.spec.ts › User should have only view permission for glossary and tags for Data Consumerat the Tags-pagemanage-buttonassertion (seen on the Collate AUT nightly, e.g. https://github.com/open-metadata/openmetadata-nightly/actions/runs/34326261170/job/102384516454).Root cause
Add export support for classification and tag level).ClassificationDetailsnow shows the Manage menu whenshowExportOptionis true, which needs onlyViewAllon a non-system classification.DataConsumerPolicygrantsViewAllonall, so a Data Consumer legitimately sees Manage → Export on every user-created classification. The test still asserted the button is never visible.TagsPageopensresponse.data[0]; the API lists classificationsORDER BY name. On a clean DBCertification(system, no Export) is first, so the stale assertion kept passing.ContextCenterArticles.spec.tscreatescc_classification_<uuid>inbeforeAllwith noafterAll.cc_sorts beforeCe, so once that spec has run in the same server the leaked classification is the Tags-page default for everyone. Whether it runs before the Users.spec test depends on worker scheduling → pass/fail alternates run to run.Fix
Users.spec.ts: navigate toCertificationexplicitly (visitClassificationPage) and assert no Manage button. Then create a user classification via API and assert the Data Consumer sees Manage with onlyexport-button(noimport-button,edit-classification,delete-button). Deletes it infinally.ContextCenterArticles.spec.ts:afterAlldeletesarticleTagClassification(recursive → tags too).Follows
PLAYWRIGHT_DEVELOPER_HANDBOOK.md: API setup/cleanup,getByTestId, reuses existingvisitClassificationPageutil, no positional locators.Verification
yarn lint:baseon both files: 0 errors (3 pre-existingno-restricted-syntaxwarnings in Users.spec, untouched lines).tsc -p playwright/tsconfig.json: no new errors (2 pre-existing in Users.spec lines 181/438, present onmain).Type of change
Checklist
Fixes <issue-number>: <short explanation>or a conventional-commit prefix.🤖 Generated with Claude Code