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

Click a specific point rather than a DOM node. #7184

Open
4 tasks done
kwangure opened this issue Jan 6, 2025 · 1 comment
Open
4 tasks done

Click a specific point rather than a DOM node. #7184

kwangure opened this issue Jan 6, 2025 · 1 comment

Comments

@kwangure
Copy link

kwangure commented Jan 6, 2025

Clear and concise description of the problem

Playwright has the ability to click a specific point.

await page.mouse.click(10, 20);

I couldn't find the Vitest API for mouse clicks not tied to a DOM node. Only the following seems possible at the moment.

await userEvent.click(myElement, { position: { x: 1, y: 2 });

This is the request for such an API.

Suggested solution

An equivalent to await page.mouse.click(10, 20); in Vitest.

Alternative

Emitting the click cdp command manually.

Additional context

I'm testing clicking on a top layer. (i.e. a <dialog/> backdrop). I want to click an arbitrary visible point outside the dialog bounding rect...and not the dialog itself.

Validations

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Jan 9, 2025

user-event's pointer API might allow this https://testing-library.com/docs/user-event/pointer. There's a draft PR #6026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants