I don’t have any prior experience with Selenium/WebDriver tests. I know that Play supports Selenium out of the box, but frankly the built in support doesn’t seem to match my expectations:
- I want to setup an automated build that runs the tests on multiple browsers / OSes. I know sites like SauceLabs give you easy access to many different browsers, and would like to leverage that, but from what I gathered the built-in Selenium tests won’t play nice with that.
- More generally, it seems that the built-in tests are written in HTML, and there’s no support for writing tests in Java (which seems to me like a better option).
I tried extending UnitTest and using SauceLabs myself. This seemed to work well, but I hit a roadblock trying to run the same test on multiple browsers. I tried using jUnit’s Parametrized Tests, but that didn’t work out so well (I kept getting errors about my test classes having too many constructors).
Are there best practices for writing System/Selenium tests in Play that:
- Are easily run on multiple browsers as part of a continuous integration system?
- Are written in Java, not HTML?
I did develop this Play! module, which I think may also work for you:
https://github.com/miguelrgonzalez/Play–Selenium-webdrive
It’s still in an really early phase but it’s already functional.
Feel free to fork!