playwright-pytest icon indicating copy to clipboard operation
playwright-pytest copied to clipboard

chore: introduce asyncio mode

Open mxschmitt opened this issue 2 years ago • 1 comments

This uses async fixtures if the pytest-asyncio plugin is loaded, we might should harden this condition more, since there might be projects where the pytest-asyncio plugin is loaded but the users wants sync fixtures.

Also all the tests got mirrored, changed to the asyncio way of doing this except two UnitTest tests, which are not supported with pytest-asyncio see here.

Ref: https://docs.pytest.org/en/7.1.x/how-to/writing_hook_functions.html#optionally-using-hooks-from-3rd-party-plugins https://github.com/microsoft/playwright-pytest/issues/74


Edit: Ideally we can have sync/async on a folder level.

mxschmitt avatar Sep 01 '23 21:09 mxschmitt

Just a recap of this issue and why we don't proceed:

Ideally we can have sync and async in the same repository and based on if a test file is marked as sync, it uses the sync fixtures or its async and it uses the async Playwright fixtures.

So far I didn't find a great way of doing that Pytest wise.

mxschmitt avatar Jan 20 '24 12:01 mxschmitt