Behat and JS? Go CasperJS
Today while writing tests (shocking, I know), I came across an interesting and unknown (at the time) scenario. For the site, I wanted to test and make sure a certain element was showing up on the page. At the time, I was writing Behat tests to do some functionality and the tests are very simple to write, so I decided to try and create a simple test for my element. Usually this is pretty straightforward:
Given I am on "/" #the homepage Then I should see ".ad-block" element
Given I am on "/" And I wait 4 seconds
That's what I learned today! Luckily, Behat is our Behavior Driven Development testing framework, but we also use CasperJS for our testing. In fact, there were already tests written for other ads on the site. The more you know!