Skip to content

Commit 5c78862

Browse files
committed
Selenium test for GitHub Issue 915: Bulk edit doesn't completely remove attachments for sources
1 parent a12ab93 commit 5c78862

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/org/labkey/test/components/ui/entities/EntityBulkUpdateDialog.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.labkey.test.components.react.FilteringReactSelect;
1717
import org.labkey.test.components.react.ReactDateTimePicker;
1818
import org.labkey.test.components.react.ToggleButton;
19+
import org.labkey.test.components.ui.files.AttachmentCard;
1920
import org.labkey.test.components.ui.files.FileAttachmentContainer;
2021
import org.labkey.test.components.ui.files.FileUploadField;
2122
import 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);

0 commit comments

Comments
 (0)