feat(inspector): suggest role locator when duplicate test IDs have unique roles - #330
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue remains from the supplied evidence. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
When several elements share a test ID (e.g. five
getByTestId('PXGGridLayout-Info')), the inspector flagged them all asdupbut still suggested the ambiguous locator.Now, for each group of elements sharing a test ID: if every element in the group has a role locator (
role+name) that matches nothing else in the tree, role becomes the primary locator for the whole group. The test ID stays listed as a secondary locator in the detail pane.dupbadge).Test plan
npm run lintlocator-derivation.test.ts)