From efa490c75d094e15da70b48d0597dc731bc49b0f Mon Sep 17 00:00:00 2001 From: Alan Vezina Date: Tue, 5 Nov 2024 17:28:20 -0600 Subject: [PATCH] Remove combineParentTypes (#2124) EntityInsertPanel: Add addSource, getSourceSelect --- .../ui/entities/EntityInsertPanel.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/org/labkey/test/components/ui/entities/EntityInsertPanel.java b/src/org/labkey/test/components/ui/entities/EntityInsertPanel.java index ce817d21f5..10b9e7bde6 100644 --- a/src/org/labkey/test/components/ui/entities/EntityInsertPanel.java +++ b/src/org/labkey/test/components/ui/entities/EntityInsertPanel.java @@ -117,6 +117,22 @@ public ReactSelect getParentSelect(String label) return parentEntityTypeSelect(label); } + public EntityInsertPanel addSource(String label, String sourceType) + { + getWrapper().shortWait().until(ExpectedConditions.elementToBeClickable(elementCache().addSource)); + elementCache().addSource.click(); + getWrapper().waitForElement(Locator.tag("label").withChild(Locator.tagWithText("span", label))); + parentEntityTypeSelect(label).select(sourceType); + return this; + } + + public ReactSelect getSourceSelect(String label) + { + if (ReactSelect.finder(getDriver()).followingLabelWithSpan(label).findOptional(this).isEmpty()) + elementCache().addSource.click(); + return parentEntityTypeSelect(label); + } + public EntityInsertPanel clearParents() { Locator loc = Locator.tagWithClass("span", "container--action-button") @@ -423,6 +439,8 @@ protected class ElementCache extends Component.ElementCache { WebElement addParent = Locator.tagWithClass("span", "container--action-button") .containing("Parent").findWhenNeeded(getDriver()); + WebElement addSource = Locator.tagWithClass("span", "container--action-button") + .containing("Source").findWhenNeeded(getDriver()); RadioButton allowMergeRadio = RadioButton.RadioButton(Locator.radioButtonByNameAndValue("insertOption", "true")).findWhenNeeded(this); RadioButton notAllowMergeRadio = RadioButton.RadioButton(Locator.radioButtonByNameAndValue("insertOption", "false")).findWhenNeeded(this);