Skip to content

Commit 4bb03fa

Browse files
committed
Merge branch 'develop' into fb_chartErrorBars
2 parents 83723e1 + a3751a7 commit 4bb03fa

3 files changed

Lines changed: 24 additions & 9 deletions

File tree

src/org/labkey/test/pages/core/admin/CustomizeSitePage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static CustomizeSitePage beginAt(WebDriverWrapper driver)
4747

4848
public ShowAdminPage save()
4949
{
50-
clickAndWait(elementCache().saveButton);
50+
clickAndWait(scrollIntoView(elementCache().saveButton));
5151

5252
return new ShowAdminPage(getDriver());
5353
}
@@ -217,7 +217,7 @@ protected ElementCache newElementCache()
217217
return new ElementCache();
218218
}
219219

220-
protected class ElementCache extends LabKeyPage.ElementCache
220+
protected class ElementCache extends LabKeyPage<?>.ElementCache
221221
{
222222
protected final WebElement saveButton = Locator.lkButton("Save").findWhenNeeded(this);
223223

src/org/labkey/test/tests/flow/FlowSpecimenTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.Map;
3333

3434
import static org.junit.Assert.assertEquals;
35+
import static org.junit.Assert.assertFalse;
3536
import static org.junit.Assert.assertTrue;
3637

3738
/**
@@ -227,7 +228,8 @@ private void linkFlowResultsToStudy()
227228
beginAt(WebTestHelper.buildURL("flow", getContainerPath(), "query", Map.of("schemaName", "flow", "query.queryName", "FCSAnalyses")));
228229
click(Locator.checkboxByName(".toggle"));
229230
clickButton("Link to Study");
230-
selectOptionByText(AssayConstants.TARGET_STUDY_FIELD_LOCATOR, "/" + getProjectName() + "/" + STUDY_FOLDER + " (" + STUDY_FOLDER + " Study)");
231+
// Target study is fixed
232+
assertFalse("Target study selector visibility", AssayConstants.TARGET_STUDY_FIELD_LOCATOR.findElement(getDriver()).isDisplayed());
231233
clickButton("Next");
232234
assertTitleContains("Link to " + STUDY_FOLDER + " Study: Verify Results");
233235
// verify specimen information is filled in for '118795.fcs' FCS file

src/org/labkey/test/tests/list/ListTest.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ protected String getProjectName()
208208
return PROJECT_VERIFY;
209209
}
210210

211+
@Override
212+
protected void doCleanup(boolean afterTest)
213+
{
214+
_containerHelper.deleteProject(PROJECT_VERIFY, afterTest);
215+
_containerHelper.deleteProject(PROJECT_OTHER, afterTest);
216+
}
217+
211218
@BeforeClass
212219
public static void setupProject()
213220
{
@@ -1629,7 +1636,7 @@ public void testAutoIncrementKeyEncoded()
16291636
// setup a list with an auto-increment key that we need to make sure is encoded in the form input
16301637
String encodedListName = "autoIncrementEncodeList";
16311638
String keyName = "'><script>alert(\":(\")</script>'";
1632-
String encodedKeyFieldName = EscapeUtil.getFormFieldName(keyName).replaceAll("\"", "&quot;");
1639+
String encodedKeyFieldName = EscapeUtil.getFormFieldName(keyName);
16331640
_listHelper.createList(PROJECT_VERIFY, encodedListName, keyName, col("Name", ColumnType.String));
16341641
_listHelper.goToList(encodedListName);
16351642

@@ -1639,10 +1646,9 @@ public void testAutoIncrementKeyEncoded()
16391646
customizeView.addColumn(EscapeUtil.fieldKeyEncodePart(keyName));
16401647
customizeView.applyCustomView();
16411648

1642-
// insert a new row and verify the key is encoded in the form input
1649+
// insert a new row and verify the key field is not present
16431650
table.clickInsertNewRow();
1644-
String html = getHtmlSource();
1645-
checker().verifyFalse("List key hidden input not present.", html.contains(encodedKeyFieldName));
1651+
checker().withScreenshot().verifyEquals("List fields on insert form.", List.of("quf_Name"), getQueryFormFieldNames());
16461652
String nameValue = "test";
16471653
setFormElement(Locator.name(EscapeUtil.getFormFieldName("Name")), nameValue);
16481654
clickButton("Submit");
@@ -1654,8 +1660,7 @@ public void testAutoIncrementKeyEncoded()
16541660

16551661
// verify name value can be updated
16561662
table.clickEditRow(0);
1657-
html = getHtmlSource();
1658-
checker().verifyTrue("List key hidden input not present.", html.contains(encodedKeyFieldName));
1663+
checker().withScreenshot().verifyEquals("List fields on update form.", List.of("quf_Name", encodedKeyFieldName), getQueryFormFieldNames());
16591664
nameValue = "test updated";
16601665
setFormElement(Locator.name(EscapeUtil.getFormFieldName("Name")), nameValue);
16611666
clickButton("Submit");
@@ -1668,6 +1673,14 @@ public void testAutoIncrementKeyEncoded()
16681673
_listHelper.deleteList();
16691674
}
16701675

1676+
private List<String> getQueryFormFieldNames()
1677+
{
1678+
return Locator.tag("input").attributeStartsWith("name", "quf_")
1679+
.findElements(getDriver()).stream()
1680+
.map(el -> el.getDomAttribute("name"))
1681+
.toList();
1682+
}
1683+
16711684
private void viewRawTableMetadata(String listName)
16721685
{
16731686
goToSchemaBrowser();

0 commit comments

Comments
 (0)