Deletes a field instance through the Field UI.
$bundle_path: Admin path of the bundle that the field instance is to be deleted from.
$field_name: The name of the field.
$label: The label of the field.
$bundle_label: The label of the bundle.
function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) {
// Display confirmation form.
$this
->drupalGet("{$bundle_path}/fields/{$field_name}/delete");
$this
->assertRaw(t('Are you sure you want to delete the field %label', array(
'%label' => $label,
)), 'Delete confirmation was found.');
// Submit confirmation form.
$this
->drupalPost(NULL, array(), t('Delete'));
$this
->assertRaw(t('The field %label has been deleted from the %type content type.', array(
'%label' => $label,
'%type' => $bundle_label,
)), 'Delete message was found.');
// Check that the field does not appear in the overview form.
$this
->assertNoFieldByXPath('//table[@id="field-overview"]//span[@class="label-field"]', $label, 'Field does not appear in the overview page.');
}