-
Notifications
You must be signed in to change notification settings - Fork 68
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] Config file support #69
Labels
Comments
How about using the pyproject.toml file for configuration.
@pytest.fixture(scope="session")
def playwright_config(request: pytest.FixtureRequest) -> Dict:
rootpath = request.config.rootpath
config_file_path = rootpath / "pyproject.toml"
if not config_file_path.exists():
return {}
with config_file_path.open(mode="rb") as f:
config = tomli.load(f)
return config.get("tool", {}).get("playwright", {})
@pytest.fixture(scope="session")
def browser_type_launch_args(pytestconfig: Any, playwright_config: Dict) -> Dict:
launch_options = {}
headed_option = pytestconfig.getoption("--headed") or playwright_config.get("headed") I am not a seasoned python developer. If this is an acceptable approach, I can open up a PR. |
Pytest provides a way to add ini options to the config and read them: |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same thing as in js/ts world
playwright.config.ts
equivalent for pythonplaywright.conf.py
which would automatically parameterize all the tests.Includes #67
The text was updated successfully, but these errors were encountered: