Skip to content

Commit 046b264

Browse files
Merge branch 'develop' into fb_allowFileExtensionAutoTest
2 parents e8eb091 + 591b1f3 commit 046b264

File tree

15 files changed

+284
-123
lines changed

15 files changed

+284
-123
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.labkey.remoteapi.CommandException;
55
import org.labkey.test.BootstrapLocators;
66
import org.labkey.test.Locator;
7+
import org.labkey.test.TestProperties;
78
import org.labkey.test.WebDriverWrapper;
89
import org.labkey.test.WebTestHelper;
910
import org.labkey.test.components.Component;
@@ -15,6 +16,7 @@
1516
import org.labkey.test.components.react.ReactDateTimePicker;
1617
import org.labkey.test.components.react.ToggleButton;
1718
import org.labkey.test.components.ui.files.FileAttachmentContainer;
19+
import org.labkey.test.components.ui.files.FileUploadField;
1820
import org.labkey.test.params.FieldDefinition;
1921
import org.labkey.test.params.FieldKey;
2022
import org.labkey.test.util.AuditLogHelper;
@@ -268,6 +270,11 @@ public EntityBulkUpdateDialog removeFile(CharSequence fieldIdentifier)
268270
return this;
269271
}
270272

273+
public FileUploadField getExistingFileField(String fieldIdentifier)
274+
{
275+
return elementCache().fileField(fieldIdentifier);
276+
}
277+
271278
/**
272279
* @param fieldIdentifier Identifier for the field; name ({@link String}) or fieldKey ({@link FieldKey})
273280
* @param checked value to set
@@ -390,7 +397,7 @@ public void clickUpdate(boolean skipAuditEventCheck)
390397
// check for the expected number of Data Changes in the latest audit event records
391398
AuditLogHelper auditLogHelper = new AuditLogHelper(getWrapper(), () -> WebTestHelper.getRemoteApiConnection(false));
392399
String auditEventName = auditLogHelper.getAuditEventNameFromURL();
393-
if (!skipAuditEventCheck && auditEventName != null)
400+
if (!skipAuditEventCheck && auditEventName != null && !TestProperties.isTrialServer())
394401
{
395402
try
396403
{
@@ -469,6 +476,11 @@ public FileAttachmentContainer fileUploadField(CharSequence fieldIdentifier)
469476
return new FileAttachmentContainer(formRow(fieldIdentifier), getDriver());
470477
}
471478

479+
public FileUploadField fileField(CharSequence fieldIdentifier)
480+
{
481+
return new FileUploadField(Locator.tagWithClass("div", "col-xs-12").findElementOrNull(formRow(fieldIdentifier)), getDriver());
482+
}
483+
472484
final Locator textInputLoc = Locator.tagWithAttribute("input", "type", "text");
473485
final Locator numberInputLoc = Locator.tagWithAttribute("input", "type", "number");
474486
final Locator checkBoxLoc = Locator.tagWithAttribute("input", "type", "checkbox");

src/org/labkey/test/components/ui/files/FileAttachmentContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public String attachFileExpectingAlert(File file)
111111
/**
112112
* Returns true if there is a file with that name in the current instance
113113
*/
114-
private boolean hasFile(String fileName)
114+
public boolean hasFile(String fileName)
115115
{
116116
return new FileAttachmentEntry.FileAttachmentEntryFinder(getDriver())
117117
.withTitle(fileName).findOptional(this).isPresent();

src/org/labkey/test/components/ui/files/FileUploadField.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ public boolean hasAttachedFile()
5353
return !elementCache().fileInputLabel.isDisplayed();
5454
}
5555

56+
public String getExistingFileName()
57+
{
58+
if (hasAttachedFile())
59+
{
60+
AttachmentCard card = elementCache().getExistingAttachment().get();
61+
return card.getFileName();
62+
}
63+
return null;
64+
}
65+
5666
@Override
5767
public WebElement getComponentElement()
5868
{

src/org/labkey/test/components/ui/grids/DetailTableEdit.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.labkey.remoteapi.CommandException;
55
import org.labkey.test.BootstrapLocators;
66
import org.labkey.test.Locator;
7+
import org.labkey.test.TestProperties;
78
import org.labkey.test.WebDriverWrapper;
89
import org.labkey.test.WebTestHelper;
910
import org.labkey.test.components.Component;
@@ -511,7 +512,7 @@ public DetailDataPanel clickSave(boolean skipAuditEventCheck)
511512
// check for the expected number of Data Changes in the latest audit event records
512513
AuditLogHelper auditLogHelper = new AuditLogHelper(getWrapper(), () -> WebTestHelper.getRemoteApiConnection(false));
513514
String auditEventName = auditLogHelper.getAuditEventNameFromURL();
514-
if (!skipAuditEventCheck && auditEventName != null)
515+
if (!skipAuditEventCheck && auditEventName != null && !TestProperties.isTrialServer())
515516
{
516517
try
517518
{

src/org/labkey/test/components/ui/grids/ResponsiveGrid.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,16 @@ private GridFilterModal initFilterColumn(CharSequence columnIdentifier, Filter.O
232232
clickColumnMenuItem(columnIdentifier, "Filter...", false);
233233
GridFilterModal filterModal = new GridFilterModal(getDriver(), this);
234234
if (operator != null)
235-
filterModal.selectExpressionTab().setFilter(new FilterExpressionPanel.Expression(operator, value));
235+
{
236+
if (operator.equals(Filter.Operator.IN) && value instanceof List<?>)
237+
{
238+
List<String> values = (List<String>) value;
239+
filterModal.selectFacetTab().selectValue(values.get(0));
240+
filterModal.selectFacetTab().checkValues(values.toArray(String[]::new));
241+
}
242+
else
243+
filterModal.selectExpressionTab().setFilter(new FilterExpressionPanel.Expression(operator, value));
244+
}
236245
return filterModal;
237246
}
238247

src/org/labkey/test/components/ui/navigation/NavBar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void clickHeaderLogo()
3939

4040
public String getHeaderLogoImgSrc()
4141
{
42-
return elementCache().headerLogo.getAttribute("src");
42+
return elementCache().headerLogoImage.getAttribute("src");
4343
}
4444

4545
public HasSearchResults searchFor(String searchString)

src/org/labkey/test/components/ui/pipeline/ImportsPage.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public QueryGrid getImportsGrid()
6161
return grid;
6262
}
6363

64+
public ImportsPage clickCancel()
65+
{
66+
elementCache().cancelButton.click();
67+
return new ImportsPage(this);
68+
}
69+
6470
@Override
6571
protected ElementCache elementCache()
6672
{
@@ -83,6 +89,8 @@ final WebElement pageHeader()
8389
.findWhenNeeded(this);
8490
}
8591

92+
final WebElement cancelButton = Locator.button("Cancel").findWhenNeeded(this);
93+
8694
final QueryGrid pipelineJobsGrid()
8795
{
8896
return new QueryGrid.QueryGridFinder(getDriver()).find(this);

src/org/labkey/test/tests/CustomizeViewTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,11 @@ public void saveFilterTest()
305305
String value = "J";
306306
String[] viewNames = {TRICKY_CHARACTERS + "view", "AAC", "aaa", "aad", "zzz"};
307307

308-
setColumns(fieldKey);
308+
setColumns(LAST_NAME_COLUMN);
309309
for(String name : viewNames)
310310
{
311311
_customizeViewsHelper.openCustomizeViewPanel();
312-
_customizeViewsHelper.addFilter(fieldKey, fieldKey, op, value);
312+
_customizeViewsHelper.addFilter(new String[]{fieldKey}, fieldKey, op, value);
313313
_customizeViewsHelper.saveCustomView(name);
314314
}
315315

src/org/labkey/test/tests/assay/UploadLargeExcelAssayTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected void doCleanup(boolean afterTest)
3939
@BeforeClass
4040
public static void setupProject() throws Exception
4141
{
42-
UploadLargeExcelAssayTest init = (UploadLargeExcelAssayTest) getCurrentTest();
42+
UploadLargeExcelAssayTest init = getCurrentTest();
4343

4444
init.doSetup();
4545
}
@@ -85,9 +85,8 @@ public void testUpload200kRows() throws Exception
8585
String fileName = "200kXlsxFile.xlsx";
8686
var dgen = new TestDataGenerator("samples", "chaos_sample", getProjectName())
8787
.withColumns(ASSAY_FIELDS);
88-
dgen.generateRows(200_000);
8988
log("writing large .xlsx file");
90-
var largeExcelFile = dgen.writeData(fileName);
89+
var largeExcelFile = dgen.writeData(fileName, 200_000);
9190
log("finished writing large .xlsx file");
9291

9392
// import large generated excel to assay1

src/org/labkey/test/tests/component/GridPanelTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.labkey.test.components.ui.search.FilterExpressionPanel;
2424
import org.labkey.test.components.ui.search.FilterFacetedPanel;
2525
import org.labkey.test.params.FieldDefinition;
26+
import org.labkey.test.params.FieldKey;
2627
import org.labkey.test.params.experiment.SampleTypeDefinition;
2728
import org.labkey.test.util.DataRegionTable;
2829
import org.labkey.test.util.SampleTypeHelper;
@@ -63,11 +64,11 @@ public class GridPanelTest extends GridPanelBaseTest
6364
// Column names.
6465
private static final String FILTER_NAME_COL = "Name";
6566
private static final String FILTER_EXPDATE_COL = "Expiration Date";
66-
private static final String FILTER_STRING_COL = TestDataGenerator.randomFieldName("Str", 0, 5);
67-
private static final String FILTER_INT_COL = TestDataGenerator.randomFieldName("Int", 0, 5);
68-
private static final String FILTER_EXTEND_CHAR_COL = TestDataGenerator.randomFieldName("\u0106\u00D8\u0139", 0, 5);
69-
private static final String FILTER_BOOL_COL = TestDataGenerator.randomFieldName("Bool", 0, 5);
70-
private static final String FILTER_DATE_COL = TestDataGenerator.randomFieldName("Date", 0, 5);
67+
private static final String FILTER_STRING_COL = "Str";
68+
private static final String FILTER_INT_COL = "Int";
69+
private static final String FILTER_EXTEND_CHAR_COL = "\u0106\u00D8\u0139";
70+
private static final String FILTER_BOOL_COL = "Bool";
71+
private static final String FILTER_DATE_COL = "Date";
7172
private static final String FILTER_STORED_AMOUNT_COL = "Amount";
7273

7374
// Views and columns used in the views. The views are only applied to the small sample type (Small_SampleType).
@@ -117,7 +118,7 @@ public class GridPanelTest extends GridPanelBaseTest
117118
@BeforeClass
118119
public static void setupProject() throws IOException, CommandException
119120
{
120-
GridPanelTest init = (GridPanelTest) getCurrentTest();
121+
GridPanelTest init = getCurrentTest();
121122

122123
init.doSetup();
123124
}
@@ -196,7 +197,7 @@ private void createSmallSampleType() throws IOException, CommandException
196197
cv.saveCustomView(VIEW_FEWER_COLUMNS);
197198

198199
log(String.format("Finally create a view named '%s' for '%s' that only has a filter.", VIEW_FILTERED_COLUMN, SMALL_SAMPLE_TYPE));
199-
drtSamples.setFilter(FILTER_STRING_COL, "Contains One Of", String.format("%1$s\n%1$s%2$s", stringSetMembers.get(0), stringSetMembers.get(1)));
200+
drtSamples.setFilter(FieldKey.encodePart(FILTER_STRING_COL), "Contains One Of", String.format("%1$s\n%1$s%2$s", stringSetMembers.get(0), stringSetMembers.get(1)));
200201
cv = drtSamples.openCustomizeGrid();
201202
cv.saveCustomView(VIEW_FILTERED_COLUMN);
202203

0 commit comments

Comments
 (0)