File tree Expand file tree Collapse file tree
src/org/labkey/test/components/ui/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import org .labkey .test .components .react .FilteringReactSelect ;
1717import org .labkey .test .components .react .ReactDateTimePicker ;
1818import org .labkey .test .components .react .ToggleButton ;
19+ import org .labkey .test .components .ui .files .AttachmentCard ;
1920import org .labkey .test .components .ui .files .FileAttachmentContainer ;
2021import org .labkey .test .components .ui .files .FileUploadField ;
2122import org .labkey .test .params .FieldDefinition ;
@@ -294,6 +295,24 @@ public EntityBulkUpdateDialog removeFile(CharSequence fieldIdentifier)
294295 return this ;
295296 }
296297
298+ /**
299+ * Removes an existing attachment displayed as an {@link AttachmentCard} in the bulk update dialog.
300+ * This is used when the rows being edited already have an attachment — the existing file is shown
301+ * as an AttachmentCard with a dropdown menu containing "Remove attachment".
302+ *
303+ * @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
304+ * @return this component
305+ */
306+ public EntityBulkUpdateDialog removeExistingAttachment (CharSequence fieldIdentifier )
307+ {
308+ var row = getFileField (fieldIdentifier );
309+ // setEditableState(fieldIdentifier, true);
310+ // WebElement row = elementCache().formRow(fieldIdentifier);
311+ AttachmentCard card = new AttachmentCard .FileAttachmentCardFinder (getDriver ()).waitFor (row );
312+ card .clickRemove ();
313+ return this ;
314+ }
315+
297316 public FileUploadField getExistingFileCard (CharSequence fieldIdentifier )
298317 {
299318 FieldKey identifier = FileAttachmentContainer .fileUploadFieldKey (fieldIdentifier );
You can’t perform that action at this time.
0 commit comments