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
4 changes: 2 additions & 2 deletions src/org/labkey/test/pages/core/admin/CustomizeSitePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static CustomizeSitePage beginAt(WebDriverWrapper driver)

public ShowAdminPage save()
{
clickAndWait(elementCache().saveButton);
clickAndWait(scrollIntoView(elementCache().saveButton));

return new ShowAdminPage(getDriver());
}
Expand Down Expand Up @@ -217,7 +217,7 @@ protected ElementCache newElementCache()
return new ElementCache();
}

protected class ElementCache extends LabKeyPage.ElementCache
protected class ElementCache extends LabKeyPage<?>.ElementCache
{
protected final WebElement saveButton = Locator.lkButton("Save").findWhenNeeded(this);

Expand Down
4 changes: 3 additions & 1 deletion src/org/labkey/test/tests/flow/FlowSpecimenTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Map;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
Expand Down Expand Up @@ -227,7 +228,8 @@ private void linkFlowResultsToStudy()
beginAt(WebTestHelper.buildURL("flow", getContainerPath(), "query", Map.of("schemaName", "flow", "query.queryName", "FCSAnalyses")));
click(Locator.checkboxByName(".toggle"));
clickButton("Link to Study");
selectOptionByText(AssayConstants.TARGET_STUDY_FIELD_LOCATOR, "/" + getProjectName() + "/" + STUDY_FOLDER + " (" + STUDY_FOLDER + " Study)");
// Target study is fixed
assertFalse("Target study selector visibility", AssayConstants.TARGET_STUDY_FIELD_LOCATOR.findElement(getDriver()).isDisplayed());
clickButton("Next");
assertTitleContains("Link to " + STUDY_FOLDER + " Study: Verify Results");
// verify specimen information is filled in for '118795.fcs' FCS file
Expand Down
25 changes: 19 additions & 6 deletions src/org/labkey/test/tests/list/ListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ protected String getProjectName()
return PROJECT_VERIFY;
}

@Override
protected void doCleanup(boolean afterTest)
{
_containerHelper.deleteProject(PROJECT_VERIFY, afterTest);
_containerHelper.deleteProject(PROJECT_OTHER, afterTest);
}

@BeforeClass
public static void setupProject()
{
Expand Down Expand Up @@ -1629,7 +1636,7 @@ public void testAutoIncrementKeyEncoded()
// setup a list with an auto-increment key that we need to make sure is encoded in the form input
String encodedListName = "autoIncrementEncodeList";
String keyName = "'><script>alert(\":(\")</script>'";
String encodedKeyFieldName = EscapeUtil.getFormFieldName(keyName).replaceAll("\"", "&quot;");
String encodedKeyFieldName = EscapeUtil.getFormFieldName(keyName);
_listHelper.createList(PROJECT_VERIFY, encodedListName, keyName, col("Name", ColumnType.String));
_listHelper.goToList(encodedListName);

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

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

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

private List<String> getQueryFormFieldNames()
{
return Locator.tag("input").attributeStartsWith("name", "quf_")
.findElements(getDriver()).stream()
.map(el -> el.getDomAttribute("name"))
.toList();
}

private void viewRawTableMetadata(String listName)
{
goToSchemaBrowser();
Expand Down