For reasons beyond us, selenium only wishes to function on my machine, on WSL. I.. don't know what makes my machine able to do it (or what makes other machines unable to run it properly), but here's what I did to get it working on my machine:
On WSL or a Unix system, install Firefox via sudo snap install firefox. This should automatically install the webdriver for Firefox: geckodriver
According to the slides: selenium would automatically install the Firefox webdriver, but for whatever reason, I had to install it manually via this way.
In selenium.py, in setUp(), replace the default path stored in the geckodriver_path variable with wherever geckodriver is located on your machine.
In the WikiPath directory, run python -m unittest tests/selenium.py and hope that it works on your machine.
The selenium tests are as follows:
Check the create account functionality, and check if logging in and out does function properly
Creates a challenge and checks if it displays correctly on /index and on /view
Makes a new account to attempt to submit a submission, and checks if that submission also displays correctly
Note: I've added a bunch of ids to elements in the templates to aid with the selenium tests, so far they serve no use other than these tests.
For reasons beyond us, selenium only wishes to function on my machine, on WSL. I.. don't know what makes my machine able to do it (or what makes other machines unable to run it properly), but here's what I did to get it working on my machine:
sudo snap install firefox
. This should automatically install the webdriver for Firefox: geckodriver According to the slides: selenium would automatically install the Firefox webdriver, but for whatever reason, I had to install it manually via this way.setUp()
, replace the default path stored in thegeckodriver_path
variable with wherever geckodriver is located on your machine.python -m unittest tests/selenium.py
and hope that it works on your machine.The selenium tests are as follows:
Note: I've added a bunch of ids to elements in the templates to aid with the selenium tests, so far they serve no use other than these tests.