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

Do interactors work with Playwright? #191

Open
paambaati opened this issue Mar 8, 2022 · 1 comment
Open

Do interactors work with Playwright? #191

paambaati opened this issue Mar 8, 2022 · 1 comment

Comments

@paambaati
Copy link

As far as I could tell, there’s no documented support for Playwright.

Can this library made to be work with Playwright? Especially when the DOM is available only lazily?

@cowboyd
Copy link
Member

cowboyd commented Mar 8, 2022

Hi @paambaati! Thanks for your question.

The short answer is that there is no current integration between interactors and playwright. However there is no reason that one couldn't be written. The key thing is that the actual interactor code must be running in the browser. That means they must be bundled and loaded by playwright. If you are using the Playwright Test framework, then there is some extra work required because the actual test runner is running in NodeJS, while the page context is running in the browser.

You would need to add the interactors via some mechanism such as an init script https://playwright.dev/docs/api/class-page#page-add-init-script and then invoke them with a JSHandle https://playwright.dev/docs/api/class-jshandle

Eventually we could bundle this into a @interactors/with-playwright-test package so that you could just import them directly and skip this manual setup.

* extends: [EventEmitter]
JSHandle represents an in-page JavaScript object. JSHandles can be created with the page.evaluateHandle(pageFunction[, arg]) method.

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

2 participants