Skip to content

Issue 53394: FileInput revert removal of the "-fileUpload" suffix from inputId #2532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ public String getDateField(CharSequence fieldIdentifier)
* @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
* @return file attachment component
*/
public FileAttachmentContainer getFileField(CharSequence fieldIdentifier)
private FileAttachmentContainer getFileField(CharSequence fieldIdentifier)
{
return enableAndWait(fieldIdentifier, elementCache().fileUploadField(fieldIdentifier));
FieldKey identifier = FileAttachmentContainer.fileUploadFieldKey(fieldIdentifier);
return enableAndWait(identifier, elementCache().fileUploadField(identifier));
}

/**
Expand All @@ -279,9 +280,10 @@ public EntityBulkUpdateDialog removeFile(CharSequence fieldIdentifier)
return this;
}

public FileUploadField getExistingFileField(String fieldIdentifier)
public FileUploadField getExistingFileCard(CharSequence fieldIdentifier)
{
return enableAndWait(fieldIdentifier, elementCache().fileField(fieldIdentifier));
FieldKey identifier = FileAttachmentContainer.fileUploadFieldKey(fieldIdentifier);
return enableAndWait(identifier, elementCache().fileField(identifier));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.labkey.test.components.WebDriverComponent;
import org.labkey.test.components.html.FileInput;
import org.labkey.test.components.html.Input;
import org.labkey.test.params.FieldKey;
import org.openqa.selenium.ElementNotInteractableException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
Expand Down Expand Up @@ -195,6 +196,15 @@ protected class ElementCache extends Component<?>.ElementCache
public Locator fileUploadScrollFooterLoc = Locator.tagWithClass("div", "file-upload__scroll-footer");
}

/**
* File upload fields append "-fileUpload" to the field's fieldKey
* @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
* @return FieldKey with expected suffix
*/
public static FieldKey fileUploadFieldKey(CharSequence fieldIdentifier)
{
return FieldKey.fromFieldKey(FieldKey.fromName(fieldIdentifier) + "-fileUpload"); // Issue 53394
}

public static class FileAttachmentContainerFinder extends WebDriverComponentFinder<FileAttachmentContainer, FileAttachmentContainerFinder>
{
Expand Down