misli / fedora-software

Web interface to Fedora Software database
BSD 3-Clause "New" or "Revised" License
12 stars 3 forks source link

Add first tests mainly related to the home page #15

Closed pigjuliux closed 9 years ago

pigjuliux commented 9 years ago

Hi guys.

First of all, as I said via mail to Jozef, I really like the idea behind this project. Since I saw that fedora-software is currently missing automated tests, I've started writing some code.

The approach I'm following is that we may call "outside-in". The steps are the following: 1) Write a sort of storyline by user's point of view, starting from the main pages and details. 2) Write functional - also called acceptance - tests in order to simulate the user's interaction. 3) Write unit tests, in order to tests the behavior of the software on a lower level.

Functional tests are located on "functional_tests/test_base.py" whereas the most appropriate place for unit tests is "fedora_software/tests.py". We might split them and organize the folder following features nor GitHub's issues, but it's not required at this point, since the TestCases are few.

For now, I've written these tests: 1) Steps for Selenium in order to open the home page. 2) A functional test in order to test if the Featured Apps appear on the home page. 3) Some unit tests related to HomeView, FeaturedApp and Component

I know the coverage is still low, but this is a starting point and I hope to write other cases soon.

In order to run the full testing suite, you should follow these steps: 1) Install firefox and selenium 2) Run Django's Webserver on the standard port (8000) 3) python manage.py test

Have a nice week-end


Giulio

GitHub: pigjuliux FAS: juliuxpigface Member of: FedoraQA

jmlich commented 9 years ago

Thanks for contribution. I have to explore your code yet in detail, but it looks promising.