People I’m working with are well aware that this year, since I have discovered Behat and the concept of BDD (Behavior Driven Development), I’ve been crazy about it. The experience of being a Product Owner for a company using Sylius as their eCommerce framework was enlightening.
The idea of speaking the same language as the programmer, the QA, the business representative and the computer, itself, made my eyes shine.
Anyway, the idea I have been thinking about the last days is to use Behat together with Selenium to create the video documentation of a product.
Because I have realized the best way to illustrate a bug happening on a website is to start VLC or Jing to capture the desktop screen while clicking buttons or links.
And then it struck me: if a bug is not a bug, then the video I have created to demonstrate that could easily serve as a documentation for future reference – if someone decides to report again the same issue.
While I was trying to demonstrate someone they have misunderstood a feature because they do not have the entire context, I thought about doing an effort and create such video documentation for all features we have, so we can prevent this kind of effort.
Then, I soon realized we already have this video documentation for Sylius and for our customized version of it, but it’s available only when the build server is running a job and if you connect with VNC to it.
So, why not using Behat together with Selenium, recording the output in a mp4 video and post it to Youtube, so that everyone interested in something could do a search and see how something is supposed to work before reporting a bug?
From the technical point of view, I have this in mind:
- for the tests based on Selenium already, there could be a trigger that saves the output of XVFB to a mp4 file
- the name of the file shoud be somehow related to the feature file / scenario it is running
- the job is successful, the output should be then uploaded to Youtube and classified based on the feature file information
- semantic name based on the scenario / feature
- description containing all the steps
- a subtitle for the movie describing what’s happening in the video at a certain moment
- maybe a video soundtrack of the current step read by a TextToSound system – why not?
So far, I have the following questions:
- how do I save the output of XVFB in a mp4 file?
- how can I put a subtitle over the XVFB output in sync with that’s happening on the screen? should Behat send through Mink some meta-data that Selenium is hovering over the image?
- is is easier to render an audiofile, separately, with a “before step” hook and then somehow insert that a some points over the video?
Because the effort put in writing some good feature files can pay off multiple times:
- it helps the business to have a better overview about what’s going to be developed and it ensures the expectations are set the right way, on both sides
- it helps the programmer with a clear map of what he has to implement
- it helps the QA to see how to confirm the implementation is correct
- why not help the user to actually see how the system is supposed to behave – rather than read a documentation?