File tree Expand file tree Collapse file tree
src/org/labkey/test/components/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,9 +253,9 @@ 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- String identifier = FileAttachmentContainer .fileUploadIdentifier (fieldIdentifier . toString () );
258+ FieldKey identifier = FileAttachmentContainer .fileUploadFieldKey (fieldIdentifier );
259259 return enableAndWait (identifier , elementCache ().fileUploadField (identifier ));
260260 }
261261
@@ -280,9 +280,9 @@ public EntityBulkUpdateDialog removeFile(CharSequence fieldIdentifier)
280280 return this ;
281281 }
282282
283- public FileUploadField getExistingFileField ( String fieldIdentifier )
283+ public FileUploadField getExistingFileCard ( CharSequence fieldIdentifier )
284284 {
285- String identifier = FileAttachmentContainer .fileUploadIdentifier (fieldIdentifier . toString () );
285+ FieldKey identifier = FileAttachmentContainer .fileUploadFieldKey (fieldIdentifier );
286286 return enableAndWait (identifier , elementCache ().fileField (identifier ));
287287 }
288288
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,9 +196,14 @@ protected class ElementCache extends Component<?>.ElementCache
195196 public Locator fileUploadScrollFooterLoc = Locator .tagWithClass ("div" , "file-upload__scroll-footer" );
196197 }
197198
198- public static String fileUploadIdentifier (String fieldIdentifier )
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 )
199205 {
200- return fieldIdentifier + "-fileUpload" ; // Issue 53394
206+ return FieldKey . fromFieldKey ( FieldKey . fromName ( fieldIdentifier ) + "-fileUpload" ) ; // Issue 53394
201207 }
202208
203209 public static class FileAttachmentContainerFinder extends WebDriverComponentFinder <FileAttachmentContainer , FileAttachmentContainerFinder >
You can’t perform that action at this time.
0 commit comments