OSF Selenium Tests
This is the UI test automation for the OSF. It uses Selenium WebDriver and Pytest to create end-to-end OSF tests.
You'll need the webdriver of your choice and Python3.
Installing a webdriver:
In order for Selenium to be able to control your local browser, you will need to install drivers for any browsers in which you desire to run these tests. Start with a driver such as GekoDriver (firefox) or ChromeDriver (Note: it is not suggested you run these tests in Safari or IE).
Go to any of the driver links above, install the applicable driver for your system, and move the executable into your PATH, e. g., place it in /usr/bin or /usr/local/bin.
For MacOSX users:
brew install python3
For Ubuntu users:
apt-get install python3
It is also suggested you use a virtual environment. After completing the installation of Python3, this can be done with the following commands:
pip install virtualenv pip install virtualenvwrapper mkvirtualenv --python=python3 OSF-selenium-tests
Now you can install the requirements:
pip install -r requirements.txt
And you should be good to go!
In order to run the whole test suite simply use pytest:
You can run specific test classes:
Or specific tests:
You can even run tests using custom markers. For example, here's how to run all the OSF smoke tests:
pytest -m smoke_test
See the pytest documentation for more information on usage.