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

Request: extending browser_type_launch_args to work with request #205

Open
jamesbraza opened this issue Feb 5, 2024 · 0 comments
Open

Comments

@jamesbraza
Copy link

It would be cool if one can parameterize browser_type_launch_args using pytest.mark.parameterize's indirect=True flag with the request parameter like so:

import pytest


@pytest.fixture(scope="session")
def browser_type_launch_args(pytestconfig, request) -> dict:
    launch_options = {}
    if pytestconfig.getoption("--headed") or request.param.get("headed"):
        launch_options["headless"] = False
    ...
    return launch_options


@pytest.mark.parametrize(
    "browser_type_launch_args", [{"headed": True}], indirect=True
)
def test_browser_type_launch_args(browser_type_launch_args: dict) -> None:
    pass

This would enable in-source configuration (more readable), without having to pass args externally or via config file.

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

1 participant