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

Proposal: event wrapper #75

Open
goodoldneon opened this issue May 22, 2022 · 2 comments
Open

Proposal: event wrapper #75

goodoldneon opened this issue May 22, 2022 · 2 comments

Comments

@goodoldneon
Copy link

What's the feasibility for creating an event wrapper that mimics the user-event API? Not something that actually uses user-event, but rather makes Puppeteer event code look like user-event code.

For example, instead of this:

await page.keyboard.type("Gordon")
await page.keyboard.press("Tab")
await page.keyboard.type("Freeman")

You'd do something like this:

const user = userEvent.setup(page)
await user.keyboard("Gordon")
await user.tab()
await user.keyboard("Freeman")

It seems straightforward, but are there dragons I'm missing?

@indifferentghost
Copy link

Did you ever do any further research behind that?

@BudgieInWA
Copy link

This sounds like a great addition. I would love to use the same API for my React unit tests and Puppeteer driven e2e tests.

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

No branches or pull requests

3 participants