As some of you might have noticed, I’ve come to love Behat, and it’s integration in SilverStripe.
Though it can be a mess to set up, and there’s even some controversy in the core group whether it’s the right tool (
https://github.com/silverstripe-labs/silverstripe-behat-extension/issues/62), I really feel it helps to make sure that my frontend and backend code work as expected when performing updates.
Lately it’s helped me to identify this issue:
https://github.com/silverstripe/silverstripe-cms/issues/1398
I also wrote some behat tests to identify this issue, which showed to have been solved when I updated composer, and hence my behat tests passed:
https://github.com/sheadawson/silverstripe-blocks/pull/68#issuecomment-194494709
In that issue I was suggesting to add my tests to the module, but then it occurred to me that adding those tests would probably only make sense if the module was integrated with a CI server that’s capable of running Behat.
I checked, and saw that the CMS module is running Behat on Travis:
https://travis-ci.org/silverstripe/silverstripe-cms/jobs/114629894
My question is now, is Travis set up so it’s actually running a headless browser to run those tests? To my knowledge you’d have to be using PhantomJS to achieve that. And, if so, are there any instructions on how to set this up?
I’d love to make it easier for modules to include Behat tests, and have them integrated with CI. I started up a document on this:
https://gist.github.com/anselmdk/ee38e089080e3c0b4b88
I’d like to add instructions on it on how to configure that CI server, and ultimately contribute it to the SilverStripe docs. Given of course that people think this is a good idea - which probably depends on whether the core group feels like staying with Behat. Thoughts?
Anselm