Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.labkey.test.WebDriverWrapper;
import org.labkey.test.components.Component;
import org.labkey.test.components.WebDriverComponent;
import org.labkey.test.components.react.BaseReactSelect;
import org.labkey.test.components.react.FilteringReactSelect;
import org.labkey.test.components.react.ReactSelect;
import org.openqa.selenium.NoSuchElementException;
Expand Down Expand Up @@ -303,6 +304,11 @@ public List<ReactSelect> getAllEntityTypes()
.findAll(elementCache());
}

private BaseReactSelect.BaseReactSelectFinder<FilteringReactSelect> getParentFinder(String typeName)
{
return FilteringReactSelect.finder(getDriver()).withNamedInput(String.format("parentEntityValue_%s", typeName));
}

/**
* Get a select for a given parent entity type.
*
Expand All @@ -311,8 +317,7 @@ public List<ReactSelect> getAllEntityTypes()
*/
public FilteringReactSelect getParent(String typeName)
{
return FilteringReactSelect.finder(getDriver()).withNamedInput(String.format("parentEntityValue_%s", typeName))
.find(elementCache());
return getParentFinder(typeName).find(elementCache());
}

/**
Expand Down Expand Up @@ -353,7 +358,7 @@ public ParentEntityEditPanel addParents(String typeName, List<String> parentIds)
if (getEntityType(typeName) == null)
getAddNewEntityTypeSelect().select(typeName);

var selectParent = getParent(typeName);
var selectParent = getParentFinder(typeName).waitFor(elementCache());

// Adding for debugging (trying to understand why save button is not enabled after setting).
getWrapper().log(String.format("Selections before adding: %s", selectParent.getSelections()));
Expand Down Expand Up @@ -496,7 +501,7 @@ protected ElementCache newElementCache()
protected class ElementCache extends Component<?>.ElementCache
{
final WebElement saveButton = Locator.byClass("btn-success").withText("Save").findWhenNeeded(this);
final WebElement cancelButton = Locator.byClass("btn-default").withText("Cancel").findWhenNeeded(this);
final WebElement cancelButton = Locator.byClass("btn-default").withText("Cancel").refindWhenNeeded(this);

// This is the 'Add' button that is contained inside the panel.
final WebElement addButton = Locator
Expand Down