File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
src/org/labkey/test/components/ui Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -253,9 +253,10 @@ public String getDateField(CharSequence fieldIdentifier)
253253 * @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
254254 * @return file attachment component
255255 */
256- public FileAttachmentContainer getFileField (CharSequence fieldIdentifier )
256+ private FileAttachmentContainer getFileField (CharSequence fieldIdentifier )
257257 {
258- return enableAndWait (fieldIdentifier , elementCache ().fileUploadField (fieldIdentifier ));
258+ FieldKey identifier = FileAttachmentContainer .fileUploadFieldKey (fieldIdentifier );
259+ return enableAndWait (identifier , elementCache ().fileUploadField (identifier ));
259260 }
260261
261262 /**
@@ -279,9 +280,10 @@ public EntityBulkUpdateDialog removeFile(CharSequence fieldIdentifier)
279280 return this ;
280281 }
281282
282- public FileUploadField getExistingFileField ( String fieldIdentifier )
283+ public FileUploadField getExistingFileCard ( CharSequence fieldIdentifier )
283284 {
284- return enableAndWait (fieldIdentifier , elementCache ().fileField (fieldIdentifier ));
285+ FieldKey identifier = FileAttachmentContainer .fileUploadFieldKey (fieldIdentifier );
286+ return enableAndWait (identifier , elementCache ().fileField (identifier ));
285287 }
286288
287289 /**
Original file line number Diff line number Diff line change 66import org .labkey .test .components .WebDriverComponent ;
77import org .labkey .test .components .html .FileInput ;
88import org .labkey .test .components .html .Input ;
9+ import org .labkey .test .params .FieldKey ;
910import org .openqa .selenium .ElementNotInteractableException ;
1011import org .openqa .selenium .WebDriver ;
1112import org .openqa .selenium .WebElement ;
@@ -195,6 +196,15 @@ protected class ElementCache extends Component<?>.ElementCache
195196 public Locator fileUploadScrollFooterLoc = Locator .tagWithClass ("div" , "file-upload__scroll-footer" );
196197 }
197198
199+ /**
200+ * File upload fields append "-fileUpload" to the field's fieldKey
201+ * @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
202+ * @return FieldKey with expected suffix
203+ */
204+ public static FieldKey fileUploadFieldKey (CharSequence fieldIdentifier )
205+ {
206+ return FieldKey .fromFieldKey (FieldKey .fromName (fieldIdentifier ) + "-fileUpload" ); // Issue 53394
207+ }
198208
199209 public static class FileAttachmentContainerFinder extends WebDriverComponentFinder <FileAttachmentContainer , FileAttachmentContainerFinder >
200210 {
You can’t perform that action at this time.
0 commit comments