-
Notifications
You must be signed in to change notification settings - Fork 118
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
Session scoped selenium fixture #176
Comments
I think it will also be valuable to have module scoped browser as well. |
+1 on this. I ran into an issue where I wanted to use the browser instance for a module scope and ended up with the error that i couldn't do so because the selenium fixture scope is only of a function scope, and not configurable to something wider. |
If you have a suggestion for implementing dynamic fixture scopes in pytest then I would be opento adding this. This has been asked for previously (see #59, which includes a somewhat outdated but still feasible workaround). The main reasons plugin has been implemented to use a browser is for isolation. if using the same browser, one test may leave state such as cookies, cache, etc. that may affect a following test. I am not aware of a way to offer dynamic scopes for fixtures, however I do understand the desire for session and module scoped fixtures. If you have a proposal for a solution then please provide additional details. I'll leave this issue open for now, however I do consider it a duplicate of #59. |
By the way, if the issue is the browser popping up frequently, I suggest running it in headless mode, inside a Docker container, or on a remote server. If the issue is the overhead in the browser startup, I suggest running your tests in parallel using pytest-xdist. |
Is there any way I could use this plugin in a session scope. The plugin has been extremely useful, I'm using it to write tests, but I don't want it to close and reopen the browser between every test. Is there any way I could use the selenium fixture in the session scope?
The text was updated successfully, but these errors were encountered: