Skip to content
Open
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
25 changes: 11 additions & 14 deletions src/org/labkey/test/BaseWebDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import org.apache.commons.lang3.tuple.Pair;
import org.apache.hc.core5.http.HttpStatus;
import org.awaitility.Awaitility;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONObject;
import org.jetbrains.annotations.NotNull;
import org.junit.Assume;
import org.junit.AssumptionViolatedException;
import org.junit.ClassRule;
Expand Down Expand Up @@ -1686,20 +1686,17 @@ public String getBaseURL()
protected void setSelectedFields(String containerPath, String schema, String query, String viewName, String[] fields)
{
pushLocation();
beginAt(WebTestHelper.buildURL("query", containerPath, "internalNewView"));
setFormElement(Locator.name("ff_schemaName"), schema);
setFormElement(Locator.name("ff_queryName"), query);
beginAt(WebTestHelper.buildURL("query", containerPath, "executeQuery", Map.of("schemaName", "query", "queryName", "CustomViews")));
DataRegionTable drt = new DataRegionTable("query", getDriver());
drt.clickInsertNewRow();
waitForElement(Locator.name("quf_Schema"));
setFormElement(Locator.name("quf_Schema"), schema);
setFormElement(Locator.name("quf_QueryName"), query);
if (viewName != null)
setFormElement(Locator.name("ff_viewName"), viewName);
clickButton("Create");
StringBuilder strFields = new StringBuilder(fields[0]);
for (int i = 1; i < fields.length; i ++)
{
strFields.append("&");
strFields.append(fields[i]);
}
setFormElement(Locator.name("ff_columnList"), strFields.toString());
clickButton("Save");
setFormElement(Locator.name("quf_Name"), viewName);
setFormElement(Locator.name("quf_Columns"), String.join("&", fields));
setFormElement(Locator.name("quf_Flags"), "0");
clickButton("Submit");
Comment on lines +1691 to +1699
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the page class returned by clickInsertNewRow instead of hard-coded locators.

popLocation();
}

Expand Down
24 changes: 17 additions & 7 deletions src/org/labkey/test/tests/TimeChartImportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import org.labkey.test.BaseWebDriverTest;
import org.labkey.test.Locator;
import org.labkey.test.TestFileUtils;
import org.labkey.test.WebTestHelper;
import org.labkey.test.categories.Charting;
import org.labkey.test.categories.Daily;
import org.labkey.test.categories.Reports;
import org.labkey.test.components.CustomizeView;
import org.labkey.test.util.DataRegionTable;
import org.labkey.test.util.Ext4Helper;
import org.labkey.test.util.PortalHelper;
Expand All @@ -35,7 +35,6 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* This test imports a folder archive that has 2 subfolders (a date based study and a visit based study) which have been
Expand Down Expand Up @@ -316,13 +315,24 @@ public void verifyMaskedPtidOnPublishStudy()
{
clickTab("Clinical and Assay Data");
waitAndClickAndWait(Locator.linkWithText(chartInfo.getName()));
beginAt(WebTestHelper.buildURL("reports",
getProjectName() + "/" + VISIT_STUDY_FOLDER_NAME + "/" + publishFolderName,
"reportInfo", Map.of("reportId", getUrlParam("reportId"))));
waitForText("Report Debug Information");
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The for-loop above (over VISIT_CHARTS) no longer does anything interesting. Might as well remove it.


// verify the report descriptor XML does not contain the masked ptid
goToSchemaBrowser();
DataRegionTable drt = viewQueryData("core", "Reports");
CustomizeView customizeView = drt.openCustomizeGrid();
customizeView.addColumn("DescriptorXML");
customizeView.applyCustomView();

drt = new DataRegionTable("query", getDriver());
int xmlIdx = drt.getColumnIndex("DescriptorXML");
Comment on lines +327 to +328
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how many reports get created by this test but you might want to increase the grid size to make sure nothing is hiding on later pages.

Suggested change
drt = new DataRegionTable("query", getDriver());
int xmlIdx = drt.getColumnIndex("DescriptorXML");
drt = new DataRegionTable("query", getDriver());
drt.setPageSize(100);
int xmlIdx = drt.getColumnIndex("DescriptorXML");


for (int row=0; row < drt.getDataRowCount(); row++)
{
String descriptor = drt.getDataAsText(row, xmlIdx);
for (String origMouseId : origMouseIds)
{
assertTextNotPresent(origMouseId);
Assert.assertFalse("Unexpected masked ptid in report descriptor : " + descriptor, descriptor.contains(origMouseId));
}
}
}
Expand Down