Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose CDP in the browser mode #5812

Closed
4 tasks done
sheremet-va opened this issue Jun 1, 2024 · 1 comment
Closed
4 tasks done

Expose CDP in the browser mode #5812

sheremet-va opened this issue Jun 1, 2024 · 1 comment
Labels
feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@sheremet-va
Copy link
Member

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

@sheremet-va sheremet-va added enhancement: pending triage feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority) and removed enhancement: pending triage labels Jun 1, 2024
@sheremet-va
Copy link
Member Author

Resolved in #5938

@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: browser Issues and PRs related to the browser runner p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

1 participant