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
8 changes: 7 additions & 1 deletion src/org/labkey/test/components/ui/grids/DetailTableEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import java.util.List;
import java.util.stream.Collectors;

import static org.labkey.test.WebDriverWrapper.WAIT_FOR_JAVASCRIPT;

/**
* automates /QueryModel/DetailPanel.tsx in its editable mode
*/
Expand All @@ -34,7 +36,7 @@ public class DetailTableEdit extends WebDriverComponent<DetailTableEdit.ElementC
private final WebElement _formElement;
private final WebDriver _driver;
private String _title;
private int _readyTimeout = WebDriverWrapper.WAIT_FOR_JAVASCRIPT;
private int _readyTimeout = WAIT_FOR_JAVASCRIPT;

protected DetailTableEdit(WebElement formElement, WebDriver driver)
{
Expand Down Expand Up @@ -452,13 +454,17 @@ public boolean isSaveButtonEnabled()
public DetailDataPanel clickSave()
{
String title = getSourceTitle();
var componentEl = getComponentElement();
getWrapper().shortWait().until(ExpectedConditions.elementToBeClickable(elementCache().saveButton));
elementCache().saveButton.click();

// If save causes some update, wait until it is completed.
getWrapper().longWait().withMessage("Update took too long to complete.")
.until(ExpectedConditions.stalenessOf(elementCache().saveButton));

// ensure we don't find the current component; wait for it to become stale before searching
getWrapper().shortWait().until(ExpectedConditions.stalenessOf(componentEl));

return new DetailDataPanel.DetailDataPanelFinder(getDriver()).withTitle(title).waitFor();
}

Expand Down
4 changes: 2 additions & 2 deletions src/org/labkey/test/tests/ClientAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ private void createUsers()
private void createStudies()
{
// create time-based study
projectMenu().navigateToFolder(getProjectName(), TIME_STUDY_FOLDER);
goToProjectFolder(getProjectName(), TIME_STUDY_FOLDER);
navBar().goToModule("Study");
CreateStudyPage createStudyPage = _studyHelper.startCreateStudy();
createStudyPage.setLabel(TIME_STUDY_NAME)
.setTimepointType(StudyHelper.TimepointType.DATE)
.createStudy();

// create a visit-based study in a different container
projectMenu().navigateToFolder(getProjectName(), VISIT_STUDY_FOLDER);
goToProjectFolder(getProjectName(), VISIT_STUDY_FOLDER);
navBar().goToModule("Study");
CreateStudyPage createVisitStudyPage = _studyHelper.startCreateStudy();
createVisitStudyPage.setLabel(VISIT_STUDY_NAME)
Expand Down
20 changes: 11 additions & 9 deletions src/org/labkey/test/tests/SimpleModuleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ private void doTestCustomFolder()
assertTextPresentInThisOrder("A customized web part", "Data Pipeline", "Experiment Runs", "Sample Type", "Assay List");
assertTextPresent("Run Groups");
assertElementNotPresent(Locator.linkWithText("Create Run Group")); // Not in small Run Groups web-part.
// ensure the mouse isn't inadvertently hovering something else, causing obscuring popup
mouseOver(Locator.tagWithClass("a", "brand-logo"));
portalHelper.checkWebpartPermission("A customized web part", "Read", null);
portalHelper.checkWebpartPermission("Data Pipeline", "Read", null);
}
Expand Down Expand Up @@ -1050,7 +1052,7 @@ private void doTestWebParts()
{
log("Testing web parts in modules...");
//go to project portal
clickProject(getProjectName());
goToProjectHome();

//add Simple Module Web Part
new PortalHelper(this).addWebPart("Simple Module Web Part");
Expand All @@ -1064,7 +1066,7 @@ private void doTestWebParts()
protected void createList() throws Exception
{
//create a list for our query
clickProject(getProjectName());
goToProjectHome();
new PortalHelper(this).addWebPart("Lists");

log("Creating list for query/view/report test...");
Expand All @@ -1090,7 +1092,7 @@ private void doTestQueries()
log("Testing queries in modules...");

//go to query module portal
clickProject(getProjectName());
goToProjectHome();
goToModule("Query");
viewQueryData("lists", "TestQuery");

Expand All @@ -1102,7 +1104,7 @@ private void doTestQueries()
private void doTestQueryViews()
{
log("Testing module-based custom query views...");
clickProject(getProjectName());
goToProjectHome();
clickAndWait(Locator.linkWithText(LIST_NAME));

DataRegionTable table = new DataRegionTable("query", getDriver());
Expand Down Expand Up @@ -1133,13 +1135,13 @@ private void doTestReports()
_rReportHelper.ensureRConfig();

log("Testing module-based JS reports...");
clickProject(getProjectName());
goToProjectHome();
clickAndWait(Locator.linkWithText(LIST_NAME));
DataRegionTable table = new DataRegionTable("query", getDriver());
table.goToReport("Want To Be Cool");
waitForText(WAIT_FOR_JAVASCRIPT, "Less cool than expected. Loaded dependent scripts.");

clickProject(getProjectName());
goToProjectHome();
portalHelper.addWebPart("Report");
setFormElement(Locator.name("title"), "Report Tester Part");
selectOptionByValue(Locator.name("reportId"), "module:simpletest/reports/schemas/lists/People/Less Cool JS Report.js");
Expand Down Expand Up @@ -1241,7 +1243,7 @@ private void doTestImportTemplates() throws Exception
log("Testing import templates...");

//go to query module portal
clickProject(getProjectName());
goToProjectHome();
goToModule("Query");
viewQueryData(VEHICLE_SCHEMA, "Vehicles");
DataRegionTable table = new DataRegionTable("query", getDriver());
Expand Down Expand Up @@ -1848,7 +1850,7 @@ private void doTestCustomLogin()
private void doTestRestrictedModule()
{
log("Create folder with restricted");
clickProject(getProjectName());
goToProjectHome();
_containerHelper.createSubfolder(getProjectName(), RESTRICTED_FOLDER_NAME, RESTRICTED_FOLDER_TYPE);
PortalHelper portalHelper = new PortalHelper(this);
portalHelper.addWebPart("Restricted Module Web Part");
Expand All @@ -1860,7 +1862,7 @@ private void doTestRestrictedModule()
impersonateRole("Reader");
assertTextPresent("This is a web part view in the restricted module."); // Can still see web part
stopImpersonating();
clickProject(getProjectName());
goToProjectHome();
navigateToFolder(getProjectName(), RESTRICTED_FOLDER_NAME);
impersonateRole("Folder Administrator");
goToFolderManagement();
Expand Down