Open jnjgomez10 opened 1 year ago
AFAICT, it also doesn't work with Browser.new_context
(e.g., using the browser
fixture to create a context with a different scale factor browser.new_context(device_scale_factor=2)
); not sure if that ends up using the same APIRequestContext
in the end.
Edit: Ah, maybe what I'm seeing is #99.
And this is particularly problematic as the only way to test chrome extensions is by creating a new context as per https://playwright.dev/python/docs/chrome-extensions
Please help :)
In fact I just reimplemented my fixture copying it from https://github.com/microsoft/playwright-pytest/blob/fb2e7c74bbce5913897b75be35311e22480fa5ab/pytest_playwright/pytest_playwright.py#L232 and creating the context the way I need it and everything worked as expected. Might not help in all cases but to me it kinda solved....
I've found the same issue, if this is not by design.
It appears that we should use fixture new_context
, so tracing/videos/screenshots are taken automatically if enabled but new_context
is a function
fixture and not session
.
https://github.com/microsoft/playwright-pytest/issues/232 https://github.com/microsoft/playwright-pytest/pull/216
Context: I am using playwright to test REST API endpoints. I do not see trace.zip after I run pytest --tracing=on.
Code Snippet
Simple test script
Describe the bug
pytest --tracing=on test_mytest.py does not produce trace.zip