Next to the lecture material, you received an example of a UI and end-to-end test for the ITU-MiniTwit application in the file test_itu_minitwit_ui.py
.
The purpose of this exercise is to make that test run on a given ITU-MiniTwit application. To do so, the following dependencies have to be setup:
pip install selenium
pip install pymongo
pip install pytest
- The Firefox webbrowser (
sudo apt install firefox
) - A so-called driver, which is a progam that can control Firefox programatically:
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz
The example assumes that the driveer is downloaded and extracted to the same directory that contains the testtest_itu_minitwit_ui.py
. tar xzvf geckodriver-v0.32.0-linux64.tar.gz
- After extraction, the downloaded artifact can be removed:
rm geckodriver-v0.32.0-linux64.tar.gz
The application that it tests is the version of ITU-MiniTwit that you got to know during the exercises on Docker: https://github.com/itu-devops/flask-minitwit-mongodb/tree/Containerize (OBS: branch Containerize)
$ git clone https://github.com/HelgeCPH/flask-minitwit-mongodb.git
$ cd flask-minitwit-mongodb
$ git switch Containerize
After editing the docker-compose.yml
file file where you replace youruser
with your respective username, the
application can be started with docker compose up
.
Now, the test itself can be executed via: pytest test_itu_minitwit_ui.py
.
In its current configuration, the tests are executed in headless
mode, i.e., no browser is visible.
Such test can be executed in CI chains within Docker containers too, which usually do not have a display configured.
In case you want to observe the test to run in a visible browser, uncomment lines 69 and 87 in test_itu_minitwit_ui.py
.
Per default, Selenium test are executed in a visible browser, which is what these two line regenerate again.
Analyze software quality and technical debt of your ITU-MiniTwit application with SonarQube (SonarCloud is a readily available hosted version of SonarQube). Do the following once per group:
- Navigate to https://sonarcloud.io/
- Login via GitHub
- Add a new project by clicking the
+
sign on the top right of the window followed byAnalyze new project
- And select the repository or the repositories that you want to assess.
After the analysis is complete, try to understand with the documentation and if necessary with Letouzey "The SQALE method for evaluating technical debt" what is presented as technical debt. Does that correspond to your understanding of technical debt?