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

[Feature]: Add Support for specifying settings in pyproject.toml #2715

Closed
aersam opened this issue Jan 15, 2025 · 2 comments
Closed

[Feature]: Add Support for specifying settings in pyproject.toml #2715

aersam opened this issue Jan 15, 2025 · 2 comments

Comments

@aersam
Copy link

aersam commented Jan 15, 2025

🚀 Feature Request

There are settings that cannot be changed in Python (or, I did not find out, how). Eg, how to set video.size that you can do in TypeScript: https://playwright.dev/docs/api/class-testoptions/#test-options-video

It would be best to have that available in pyproject.toml, similar to pyright or other tools

Example

[tool.playwright.options]
video = { mode= "on", size= {height=1900, width=1080 }}

Motivation

Make all options available in a pythonic way

@ltsuda
Copy link

ltsuda commented Jan 16, 2025

This is how to configure browser's viewport using Playwright's Pytest plugin. The page you linked is specific for their Test Runner in JS/TS.

https://playwright.dev/python/docs/test-runners#use-custom-viewport-size

As you can see, you can override the browser_context_args fixture options, they are the same as here.

https://playwright.dev/python/docs/api/class-browser#browser-new-context

There's video option, that if not specified, it's going to be the same as viewport or you can customized it too.

https://playwright.dev/python/docs/api/class-browser#browser-new-context-option-record-video-size

As they created a Pytest plugin, then the only way to configure on pyproject.toml is on the pytest section like below and only these CLI Options:

[tool.pytest.ini_options]
# Run firefox with UI
addopts = "--headed --browser firefox --video=on"

@mxschmitt
Copy link
Member

Duplicate of microsoft/playwright-pytest#69

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