Steps for Drupal form elements visibility

Events happening in the community are now at Drupal community events on www.drupal.org.
pbuyle's picture

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

dsnopek's picture

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

Behat

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: