Hi,
I'm pretty new to Drupal and coding - I'm not a developer but I work in a drupal agency. So right now I have to write Behat tests to test functionalities of our features in Drupal 8. The tests need element IDs in the most cases but whyever there are hardly no IDs to select.
So my idea was to add IDs to certain elements like buttons (dropbuttons for example) or radio buttons.
I'm testing the Paragraphs module right now and need an ID for the "Add Paragraph" dropbutton where you can select the paragraphs. How can I add an ID there?
I hope you understand my intentions and forgive me if my question sounds stupid :)
Thanks a lot,
Julia
Comments
HTML IDs? Or data IDs on the
HTML IDs? Or data IDs on the back-end (php/db)?
HTML IDs i think so I can
HTML IDs i think so I can select them as CSS selectors for the behat tests.
Have you looked at hook_form
Have you looked at hook_form_alter or overriding the template?
For example
For example
You may have to dig deeper in
You may have to dig deeper in the $form array to set the id of the <input> form element. Otherwise you're just setting the id of a wrapping div.