Skip to main content

Behat coverage for all of Drupal - how it could be done

CEO, Co-Founder
Jul 02, 2014

There is a lot of excitement in the Drupal community about Behat, especially from more advanced teams that are investing in their Devops infrastructure. It now even looks like Behat might some day make it into Drupal core. I guess that is why several Web development teams that use BDD (Behavior-Driven Development) have asked me how WalkHub relates to Behat. I’ve written a longer post on the WalkHub blog that explains how it could be done, and what the benefits would be. In this post I will focus on how WalkHub could help the community complete the creation of Behat tests for all of Drupal core and contrib.

Already today some of the biggest Drupal projects get specified in Behat: analysts work with the customer to define a full set of acceptance criteria and those then become the basis for the development of the site. This is a very labor intensive process and there is a significant risk that if the analyst and customer don’t know how Drupal works, existing features will become liabilities instead of time savers when they need to be refactored or sometimes even removed and rebuilt.

But imagine if we would have a complete Behat test coverage for Drupal (at least for core and the most used contrib modules), it would become possible even for smaller projects to create a complete set of ab initio acceptance criteria that explain how Drupal works by default. Kind of like the “Drupal way” but in document format that you can get your customer to sign off on.

After some research I believe that this is exactly what WalkHub could help with: make it really easy to create a Behat test suite for all of Drupal core and the existing contrib modules. Figuring out what selectors you need to use in a scenario step can be a lot of work, and it requires you to go back and forward between your browser and the IDE where you are writing the scenarios for your features. With the WalkHub recorder you don’t need to deal with that anymore. You can simply do the process you need to describe, and we could automatically generate most, if not all of the Gherkin for you scenario.

The added benefit would be that Walkthroughs could be a visual companion for your features. Step-by-step scenarios overlaid on top of your interface are still better than test scenarios, even if they are written in natural language. It would give you another tool to communicate with your customer and to prevent “this is not how I imagined it” scope creep.

What do you think? Can you imagine using WalkHub to document the default admin and editorial workflows in Drupal core and contrib? Do we need Behat tests for that? Is this something you would like to use? If so get in touch. Send me an email at kristof@pronovix.com and/or fill in the following really short form (2 mins tops - promised!):

Kristof Van Tomme is an open source strategist and architect. He is the CEO and co-founder of Pronovix. He’s got a degree in bioengineering and is a regular speaker at conferences in the API, developer relations, and technical writing communities. He is the host of the Developer Success & the Business of APIs and the API Resilience podcasts.

Newsletter

Articles on devportals, DX and API docs, event recaps, webinars, and more. Sign up to be up to date with the latest trends and best practices.

 

Subscribe