-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expose CDP in the browser mode #5812
Copy link
Copy link
Closed
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runnerp2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
Clear and concise description of the problem
It is very useful to have access to the CDP instance from the browser for library authors to build APIs on top of (see: https://github.com/dmtrKovalenko/cypress-real-events)
Suggested solution
Expose cdp method from @vitest/browser/context that returns an object with three methods:
import { cdp } from '@vitest/browser/context'
await cdp.send('Input.dispatchMouseEvent')
cdp.on('Network.requestWillBeSent', doSomething)
cdp.once('Network.requestWillBeSent', doSomethingOnce)Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runnerp2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)