Remove the uniqueness constraint for anonymous runInBrowser calls.
Playwright’s TypeScript transformer can produce code that differs from the original source, so multiple runInBrowser calls in the same file are not always reliably distinguishable when serialized into the browser. Requiring a unique ID for every runInBrowser call hurts developer experience.
Approach: Drop the compile-time constraint. Allow multiple runInBrowser calls without unique IDs. At runtime, when we cannot uniquely match a runInBrowser function, throw a clear runtime error that:
- Explains that the function could not be matched
- Instructs users to add unique IDs to their runInBrowser calls
- Asks users to file a GitHub issue (https://github.com/testronaut/testronaut/issues) with their use case so we can improve detection
If the extracted function cannot be found at runtime, users still get a runtime error. We no longer need a config option; we rely on this runtime behavior instead.
Remove the uniqueness constraint for anonymous
runInBrowsercalls.Playwright’s TypeScript transformer can produce code that differs from the original source, so multiple runInBrowser calls in the same file are not always reliably distinguishable when serialized into the browser. Requiring a unique ID for every
runInBrowsercall hurts developer experience.Approach: Drop the compile-time constraint. Allow multiple runInBrowser calls without unique IDs. At runtime, when we cannot uniquely match a runInBrowser function, throw a clear runtime error that:
If the extracted function cannot be found at runtime, users still get a runtime error. We no longer need a config option; we rely on this runtime behavior instead.