When I press "button" by attribute

This step definition is used as a command to press a button, ensuring the correct execution of the expected action.

 

When (I|we)* press "([^"]*)?" by( its)*( "([^"]*)?")* (attribute|attr)

Define the step for pressing the button with the specified ID, class, name, title, or value.

 

Example by direct calling of ID, class:

When I press "#edit-submit" by attribute
When I press ".button" by attr

 

Or match any of the field attributes:

When I press "btn-pressid" by its "id" attr
When I press "Your full name" by "placeholder" attribute
When I press "save-name" by "data-drupal-selector" attr