You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Fix invalid chained XPath ancestor locator in streak widget test #3303
The test fails because Playwright's locator.locator() method strictly restricts the secondary search to the subtree (descendants) of the first locator. When the test attempts to locate the parent section using streakHeading.locator('xpath=ancestor::div...'), Playwright searches inside the heading element for an ancestor div, which yields zero results. Because the parent container is never found, the subsequent check for longestStreakCard times out and fails.
Additionally, the mockMetricResponse import was missing the .js extension, which can cause module resolution errors (ERR_MODULE_NOT_FOUND) in Next.js/Playwright setups utilizing ES Modules.
Steps to Reproduce
Run the Playwright test "streak widget shows the mocked longest streak value".
The test successfully loads the dashboard and locates the "Commit Streaks" heading.
The test attempts to find the wrapping container by chaining streakHeading.locator('xpath=ancestor::div...').
Because chained locators cannot traverse up the DOM tree, Playwright finds 0 matching container elements.
The test times out and fails waiting for the longest streak card to become visible inside the non-existent container.
Activity
rudrakshtank commentedon Jul 31, 2026
/assign
github-actions commentedon Jul 31, 2026
Assigned to @rudrakshtank! You have 7 days to open a PR. No PR after 7 days = auto-unassigned so others can pick it up. Good luck!
github-actions commentedon Jul 31, 2026
✅ Closed as completed!
If DevTrack has been useful, a ⭐ star on the repo helps the project grow and reach more developers.