Sets the weight of a given Paragraphs type.
string $content_type: Content type name that contains the paragraphs field.
string $paragraphs_type: ID of Paragraph type that will be modified.
int $weight: Weight to be set.
string $paragraphs_field: Paragraphs field name that does the reference.
protected function setParagraphsTypeWeight($content_type, $paragraphs_type, $weight, $paragraphs_field) {
$this
->drupalGet('admin/structure/types/manage/' . $content_type . '/fields/node.' . $content_type . '.' . $paragraphs_field);
$edit['settings[handler_settings][target_bundles_drag_drop][' . $paragraphs_type . '][weight]'] = $weight;
$this
->submitForm($edit, 'Save settings');
}