There is a form having a link clicking on which field set will be collapsed to show fields under it. HTML is shown as below.

<span class="fieldset-legend">
  <a href="#" class="fieldset-title">
    <span class="fieldset-legend-prefix element-invisible">Hide</span>
<span class="summary"></span></span>

How would I go about checking if this link exists (to click on it), and the fields under it are shown?

1 Answer 1


To answer my own question, I realized (even without clicking on the link) that fields can be asserted by DrupalWebTestCase::assertFieldByName().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.