Skip to content

fix(playwright): report given caller paths containing spaces - #128

Merged
slayerjain merged 1 commit into
mainfrom
fix/playwright-given-caller-spaces
Nov 21, 2026
Merged

slayerjain merged 1 commit into
mainfrom
fix/playwright-given-caller-spaces

Conversation

@slayerjain

Copy link
Copy Markdown
Member

Summary

sourceOf in @keploy/playwright previously matched stack-frame locations with [^\s()]+ and decoded file:// URLs via new URL(...).pathname, which broke caller attribution for given() whenever a test path contained spaces (bare paths stopped at the space, and file:// URLs kept %20).

Changes

  • Extract stack-frame locations with balanced/fallback parenthesis unwrapping (unwrapLocation) and decode file:// URLs with fileURLToPath inside a try/catch so malformed URLs skip cleanly.
  • Add unit tests in playwright/test/unit.test.mjs covering spaces, parentheses in paths/function names, async, bare/parenthesized file:// frames, V8 eval frames, and invalid file:// URLs.
  • Add a Playwright end-to-end row and fixture (given caller with spaces.spec.ts) verifying /agent/scope/given reports the on-disk relative path.

Parse V8 stack frames without stopping at whitespace so file paths with
spaces and parentheses resolve cleanly, decode file:// URLs with
fileURLToPath inside try/catch, and add unit and Playwright row
coverage.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
@slayerjain
slayerjain force-pushed the fix/playwright-given-caller-spaces branch from 57a442a to 6c63c0f Compare November 21, 2026 17:48
@slayerjain
slayerjain merged commit 09e4568 into main Nov 21, 2026
8 checks passed
@slayerjain
slayerjain deleted the fix/playwright-given-caller-spaces branch November 21, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant