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

Deprecation warning with headless fixture : how to use Splinter config #181

Open
Ruff9 opened this issue Nov 22, 2023 · 4 comments
Open

Comments

@Ruff9
Copy link

Ruff9 commented Nov 22, 2023

I'm using the splinter_headless() fixture, and I get this warning :

.../venv/lib/python3.10/site-packages/splinter/browser.py:92: DeprecationWarning:
Sending fullscreen, incognito, headless, user_agent to the browser object has been deprecated.
Please pass in a Splinter Config object instead.See: https://splinter.readthedocs.io/en/latest/config.html
for more details
    return driver(config=config, *args, **kwargs)

How can I use a Config object with pytest-splinter ?

@Ruff9 Ruff9 changed the title Deprecation warning Splinter config Deprecation warning with headless fixture : how to use Splinter config Nov 22, 2023
@mpasternak
Copy link
Contributor

This warning comes clearly from splinter code. This is pytest-splinter repository.

pytest-splinter is a thin layer over splinter to make it work easier with splinter.

Please report this bug in splinter repository.

@mpasternak
Copy link
Contributor

After giving it a second of thought more, I see that this is rather pytest-splinter problem. Sorry, @Ruff9 I misunderstood you.

@mpasternak
Copy link
Contributor

How about you use splinter_driver_kwargs? Documented here: https://github.com/pytest-dev/pytest-splinter

@Ruff9
Copy link
Author

Ruff9 commented Nov 23, 2023

I just tried using

@pytest.fixture(scope='session')
def splinter_driver_kwargs():
    return {"headless": True}

instead of

@pytest.fixture(scope='session')
def splinter_headless():
    return True

and the warning is still there. Both are working though, the browser is indeed headless with both fixtures. I can work with that.

But to remove the warning, I would need to use a Config object, as the warning says. And I see no mention of it in the pytest-splinter docs.

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

2 participants