-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Selenium testing failing #546
Comments
This looks good, thanks for sharing it. I think given the lack of interest from the Flask team in preserving features of the framework that worked before, such as the server shutdown and app.run() integration with the CLI, what you have done is probably the best option. |
So I tried it with these changes and it worked test_selenium.py cls.server_thread = threading.Thread(
target=cls.app.run,
kwargs={
"host": cls.HOST,
"port": cls.PORT,
"debug": False,
"use_reloader": False,
"use_debugger": False,
},
daemon=True
)
cls.server_thread.join(2)
|
Thank you, @miguelgrinberg, for your invaluable help with Flask. We truly appreciate your guidance and expertise as our Flask Mentor. I hope you are doing well. Currently, I am facing two issues with the following approach: Using this method terminates the process and ends all other tests. Unfortunately, I am unable to determine if the other methods are running successfully.
I would greatly appreciate any assistance you can provide in resolving this issue. If there are any suggestions or alternative approaches you could recommend, I would be grateful for your expertise. Thank you once again for your valuable help. |
Hi Miguel,
I'm just about to finish your book, absolutely love it. I've been following along as I read and noticed that the packages are quite outdated (as expected). I decided to code your app using the latest available packages and so far apart from some minor syntax differences it was smooth sailing. This was the case up until the 'End-to-End Testing with Selenium' (15d), it took me 2 days to make it work with
Selenium v4.7.2
andUnittest
and I just wanted to leave it here in case someone else runs into this problem as well as ask if this is the correct way to do it. It feels more like a hack to me rather than the actual solution so I would really appreciate your input.Below are the packages I'm using as well as my solution to the problem. By the way I'm also using
ChromeDriver 108.0.5359.71
I figured out the solution tanks to pallets/flask#2776
requirements/common.txt
requirements/common.txt
main/views.py
config.py
tests/test_selenium.py
The text was updated successfully, but these errors were encountered: