It could be related to the Python version. I see you are using 3.7. Try a newer one (3.8 or 3.9 or 3.10). I also updated the script to point directly to the newer NYT URL, and to get the words list must faster without any redirects.
I stand corrected. The script works on my iMac under python 3.9 but no longer runs under 3.7. However, on the MBP I also have python 3.9 env activated (conda) but when I run pytest it still seems to be using python 3.7 (not sure how to change that) to see if the new script runs.
On the MBP running with 3.7 the browser window comes up and the 1st word is entered and then it times out. WIth 3.9 the console log for the MBP is here: gist.github.com/ifuchs/e3ee59aec78...
Obviously there is something wrong with the environment on the MBP so it is not your code that is the problem.
YES! Not only did that fix it under 3.9, it now works properly under 3.7 as well (same as on the iMac). Thanks for your help. (So, how to fix the font "issue" on the MBP?)
Not sure about getting the missing fonts on your MBP's Python env, but I've already updated the script on the DEV post to use a selector without the special font, and I'll be shipping that change to the SeleniumBase repo on GitHub within the hour. Thanks for finding that font issue on some Python environments!
button.one-and-a-half is another selector for the Enter button. It has that class name because the button is wider than other buttons on that keyboard.
Thanks. I searched but did not find it in the seleniumbase docs.
Is there a way to run the pytest repetitively so that it shows each path to solution, waits a few seconds and does it again?
It could be related to the Python version. I see you are using
3.7
. Try a newer one (3.8
or3.9
or3.10
). I also updated the script to point directly to the newer NYT URL, and to get the words list must faster without any redirects.The current script on github no longer works on my iMac or MBP (under either python 3.7 or 3.9).
What's the error message? I was able to run it now just fine.
I stand corrected. The script works on my iMac under python 3.9 but no longer runs under 3.7. However, on the MBP I also have python 3.9 env activated (conda) but when I run pytest it still seems to be using python 3.7 (not sure how to change that) to see if the new script runs.
You could try
python3.9 -m pytest
in order to force pytest to use a specific version of Python if that version is installed.On the MBP running with 3.7 the browser window comes up and the 1st word is entered and then it times out. WIth 3.9 the console log for the MBP is here: gist.github.com/ifuchs/e3ee59aec78...
Obviously there is something wrong with the environment on the MBP so it is not your code that is the problem.
Looks to be a missing font issue:
'button[data-key="↵"]'
shows up as
'button[data-key="?"]'
If you change
button[data-key="↵"]
to
button.one-and-a-half
does it start working?
YES! Not only did that fix it under 3.9, it now works properly under 3.7 as well (same as on the iMac). Thanks for your help. (So, how to fix the font "issue" on the MBP?)
and what is button.one-and-a-half?
Not sure about getting the missing fonts on your MBP's Python env, but I've already updated the script on the DEV post to use a selector without the special font, and I'll be shipping that change to the SeleniumBase repo on GitHub within the hour. Thanks for finding that font issue on some Python environments!
button.one-and-a-half
is another selector for the Enter button. It has that class name because the button is wider than other buttons on that keyboard.Thanks. I searched but did not find it in the seleniumbase docs.
Is there a way to run the pytest repetitively so that it shows each path to solution, waits a few seconds and does it again?
One: That
button.one-and-a-half
selector is part of the Wordle website:Two: Here's an example SeleniumBase test for repeating tests: test_repeat_tests.py
All necessary updates to the SeleniumBase GitHub repo have been shipped.
I tried installing pytest-repeat and running
pytest --count=5 wordle_test.py but that only ran it once.
I'll see if I can use your examples do cause it to repeat.
pytest-repeat
is an external plugin that won't work on tests that inheritunittest.TestCase
.