Posted by pbuyle on November 28, 2013 at 10:10pm
Hi,
I started using Behat for Drupal, my first scenarios involved verification of form element visibility (implemented through #states). I could'nt find an existing way to easily check the visibility of a form element. So I wrote a couple or steps to check for the (in)visibility of form element identified by their labels. This heavily relies on the default Drupal markup for form elements.
The code can be found at https://gist.github.com/pbuyle/7698675

Comments
Awesome, thanks! I've also
Awesome, thanks! I've also wanted similar steps for making sure that certain roles are only seeing the form elements they should on entity edit forms.
It'd be great to get these added to the Behat Drupal extension:
https://drupal.org/project/drupalextension
I've opened an issue:
https://drupal.org/node/2151935