Skip to content
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 @@ -15,6 +15,7 @@
import org.labkey.test.components.react.ReactDateTimePicker;
import org.labkey.test.components.react.ToggleButton;
import org.labkey.test.components.ui.files.FileAttachmentContainer;
import org.labkey.test.components.ui.files.FileUploadField;
import org.labkey.test.params.FieldDefinition;
import org.labkey.test.params.FieldKey;
import org.labkey.test.util.AuditLogHelper;
Expand Down Expand Up @@ -268,6 +269,11 @@ public EntityBulkUpdateDialog removeFile(CharSequence fieldIdentifier)
return this;
}

public FileUploadField getExistingFileField(String fieldIdentifier)
{
return elementCache().fileField(fieldIdentifier);
}

/**
* @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
* @param checked value to set
Expand Down Expand Up @@ -469,6 +475,11 @@ public FileAttachmentContainer fileUploadField(CharSequence fieldIdentifier)
return new FileAttachmentContainer(formRow(fieldIdentifier), getDriver());
}

public FileUploadField fileField(CharSequence fieldIdentifier)
{
return new FileUploadField(Locator.tagWithClass("div", "col-xs-12").findElementOrNull(formRow(fieldIdentifier)), getDriver());
}

final Locator textInputLoc = Locator.tagWithAttribute("input", "type", "text");
final Locator numberInputLoc = Locator.tagWithAttribute("input", "type", "number");
final Locator checkBoxLoc = Locator.tagWithAttribute("input", "type", "checkbox");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public String attachFileExpectingAlert(File file)
/**
* Returns true if there is a file with that name in the current instance
*/
private boolean hasFile(String fileName)
public boolean hasFile(String fileName)
{
return new FileAttachmentEntry.FileAttachmentEntryFinder(getDriver())
.withTitle(fileName).findOptional(this).isPresent();
Expand Down
10 changes: 10 additions & 0 deletions src/org/labkey/test/components/ui/files/FileUploadField.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ public boolean hasAttachedFile()
return !elementCache().fileInputLabel.isDisplayed();
}

public String getExistingFileName()
{
if (hasAttachedFile())
{
AttachmentCard card = elementCache().getExistingAttachment().get();
return card.getFileName();
}
return null;
}

@Override
public WebElement getComponentElement()
{
Expand Down
11 changes: 10 additions & 1 deletion src/org/labkey/test/components/ui/grids/ResponsiveGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,16 @@ private GridFilterModal initFilterColumn(CharSequence columnIdentifier, Filter.O
clickColumnMenuItem(columnIdentifier, "Filter...", false);
GridFilterModal filterModal = new GridFilterModal(getDriver(), this);
if (operator != null)
filterModal.selectExpressionTab().setFilter(new FilterExpressionPanel.Expression(operator, value));
{
if (operator.equals(Filter.Operator.IN) && value instanceof List<?>)
{
List<String> values = (List<String>) value;
filterModal.selectFacetTab().selectValue(values.get(0));
filterModal.selectFacetTab().checkValues(values.toArray(String[]::new));
}
else
filterModal.selectExpressionTab().setFilter(new FilterExpressionPanel.Expression(operator, value));
}
return filterModal;
}

Expand Down