// Check #field_prefix and #field_suffix placement.
$this->
assertSession()->
elementExists('xpath', '//span[@class="field-prefix"]/following-sibling::div[@id="edit-form-radios-test"]'
);
$this->
assertSession()->
elementExists('xpath', '//span[@class="field-suffix"]/preceding-sibling::div[@id="edit-form-radios-test"]'
);
// Check #prefix and #suffix placement. Both elements placed before the form
// item.
$this->
assertSession()->
elementExists('xpath', '//div[@id="form-test-textfield-title-prefix"]/following-sibling::div[contains(@class, \'js-form-item-form-textfield-test-title\')]'
);
$this->
assertSession()->
elementExists('xpath', '//div[@id="form-test-textfield-title-suffix"]/preceding-sibling::div[contains(@class, \'js-form-item-form-textfield-test-title\')]'
);
// Check title attribute for radios and checkboxes.
$this->
assertSession()->
elementAttributeContains('css', '#edit-form-checkboxes-title-attribute', 'title', 'Checkboxes test (Required)'
);
$this->
assertSession()->
elementAttributeContains('css', '#edit-form-radios-title-attribute', 'title', 'Radios test (Required)'
);
// Check Title/Label not displayed when 'visually-hidden' attribute is set
// in checkboxes.
$this->
assertSession()->
elementExists('xpath', '//fieldset[@id="edit-form-checkboxes-title-invisible--wrapper"]/legend/span[contains(@class, "visually-hidden")]'
);
// Check Title/Label not displayed when 'visually-hidden' attribute is set
// in radios.
$this->
assertSession()->
elementExists('xpath', '//fieldset[@id="edit-form-radios-title-invisible--wrapper"]/legend/span[contains(@class, "visually-hidden")]'
);
}