Centralised tests with Selenium, Flask, and Bootstrap

In Gigas, we started to have tests soon using Selenium, having spreadsheet files where we put descriptions about tests suites and some html files we use to execute with the great Selenium Firefox Plugin. Later we write manually the tests results in the spreadsheet file and we share it with the others.

That's over, We have started a web service using the Flask framework and the cool Twitter Bootstrap design with some Glyphicons. It also uses the Flask-Login extension for authentication and a couple of pickle files to store some persistent data we need.

The process is the following: We record and write some asserts and verifies commands using the Firefox Selenium Plugin, then we can upload it to this new web service. The service executes in the background the selenium standalone server with the htmlSuite option using python subprocess. This could be an example of the command:


java -jar /usr/share/selenium-server/selenium-server-standalone.jar -htmlSuite https://dev.gigas.local ./test_suites/04-0002.01-20120507.html results.html

It stores the result in a html file, we parse it and return the Ajax response in JSON to show them.

To execute Firefox without using the X server, we do it on Xvfb, a virtual X server that doesn't show the graphical output.

This is an example of the first version, I recorded it last thursday. :-)

References:

Javier Aguirre

Read more posts by this author.

comments powered by Disqus