{"id":1262,"date":"2013-04-17T09:44:30","date_gmt":"2013-04-17T07:44:30","guid":{"rendered":"http:\/\/blog.gocept.com\/?p=1262"},"modified":"2013-04-17T09:44:30","modified_gmt":"2013-04-17T07:44:30","slug":"running-tests-using-gocept-selenium-on-travis-ci","status":"publish","type":"post","link":"https:\/\/blog.gocept.com\/2013\/04\/17\/running-tests-using-gocept-selenium-on-travis-ci\/","title":{"rendered":"Running tests using gocept.selenium on Travis-CI"},"content":{"rendered":"

Travis-CI<\/a>\u00a0is a\u00a0free hosted continuous integration platform for the open source community. It has a good integration with Github<\/a>, so each push to a project runs the tests \u00a0of the project.<\/p>\n

gocept.selenium<\/a>\u00a0is a python package our company has developed as a test-friendly Python API for Selenium<\/a>\u00a0which allows to run tests in a browser.<\/p>\n

Travis-CI uses YML-Files<\/a>\u00a0to configure the test run.\u00a0I found only little documentation how to run Selenium tests on Travis-CI. But it is straight forward. The following YML file I took from a personal project of mine<\/a>.\u00a0(I simplified it a bit for this blog post.):<\/p>\n

[code]
\nlanguage: python
\npython:
\n – 2.6
\nbefore_install:
\n – "export DISPLAY=:99.0"
\n – "sh -e \/etc\/init.d\/xvfb start"
\n – "wget
http:\/\/selenium.googlecode.com\/files\/selenium-server-standalone-2.31.0.jar&quot<\/a>;
\n – "java -jar selenium-server-standalone-2.31.0.jar &"
\n – "export GOCEPT_SELENIUM_BROWSER=’*firefox’"
\ninstall:
\n – python bootstrap.py
\n – bin\/buildout
\nscript:
\n – bin\/test
\n[\/code]<\/p>\n

Explanation:<\/p>\n