-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
component updates for auto-hit-selection #2218
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
339abaa
component updates for auto-hit-selection
labkey-chrisj c5b3cfe
Merge branch 'develop' into fb_auto_hit_selection
labkey-chrisj d9a4737
cr feedback: wait for dialog close
labkey-chrisj e330d20
Merge branch 'develop' into fb_auto_hit_selection
labkey-chrisj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
src/org/labkey/test/components/domain/HitSelectionDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package org.labkey.test.components.domain; | ||
|
||
import org.labkey.test.Locator; | ||
import org.labkey.test.components.Component; | ||
import org.labkey.test.components.WebDriverComponent; | ||
import org.labkey.test.components.bootstrap.ModalDialog; | ||
import org.labkey.test.components.html.Input; | ||
import org.labkey.test.components.ui.search.FilterExpressionPanel; | ||
import org.labkey.test.pages.LabKeyPage; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
import java.util.List; | ||
|
||
import static org.labkey.test.components.html.Input.Input; | ||
|
||
|
||
public class HitSelectionDialog extends ModalDialog | ||
{ | ||
|
||
public HitSelectionDialog(WebDriver driver) | ||
{ | ||
super(new ModalDialogFinder(driver)); | ||
} | ||
|
||
public List<String> getAvailableFields() | ||
{ | ||
return getWrapper().getTexts(elementCache().findFieldOptions()); | ||
} | ||
|
||
public FilterExpressionPanel selectField(String fieldName) | ||
{ | ||
var fieldItem = elementCache().findFieldOption(fieldName); | ||
fieldItem.click(); | ||
return elementCache().filterExpressionPanel(); | ||
} | ||
|
||
public void cancel() | ||
{ | ||
dismiss("Cancel"); | ||
} | ||
|
||
public void clickApply() | ||
{ | ||
if (!elementCache().submitButton.isEnabled()) | ||
{ | ||
throw new IllegalStateException("Apply button is not enabled."); | ||
} | ||
elementCache().submitButton.click(); | ||
waitForClose(); | ||
} | ||
|
||
@Override | ||
protected ElementCache elementCache() | ||
{ | ||
return (ElementCache) super.elementCache(); | ||
} | ||
|
||
@Override | ||
protected ElementCache newElementCache() | ||
{ | ||
return new ElementCache(); | ||
} | ||
|
||
|
||
protected class ElementCache extends ModalDialog.ElementCache | ||
{ | ||
public final Locator listItemLoc = Locator.byClass("list-group-item"); | ||
|
||
// fields panel | ||
WebElement fieldsPanel = Locator.tagWithClass("div", "field-modal__col") | ||
.withChild(Locator.tagWithClass("div", "field-modal__col-title").withText("Fields")) | ||
.child(Locator.tagWithClass("div", "field-modal__col-content")).findWhenNeeded(this).withTimeout(5000); | ||
protected WebElement findFieldOption(String queryName) | ||
{ | ||
return listItemLoc.withText(queryName).findElement(fieldsPanel); | ||
} | ||
protected List<WebElement> findFieldOptions() | ||
{ | ||
return listItemLoc.findElements(fieldsPanel); | ||
} | ||
|
||
// filter panel | ||
WebElement filterCriteriaPanel = Locator.tagWithClass("div", "field-modal__col") | ||
.withChild(Locator.tagWithClass("div", "field-modal__col-title").withText("Filter Criteria")) | ||
.child(Locator.tagWithClass("div", "field-modal__col-content")).findWhenNeeded(this).withTimeout(5000); | ||
protected final FilterExpressionPanel filterExpressionPanel() | ||
{ | ||
return new FilterExpressionPanel.FilterExpressionPanelFinder(getDriver()).findWhenNeeded(filterCriteriaPanel); | ||
} | ||
|
||
protected final WebElement submitButton = Locator.css(".modal-footer .btn-success").findWhenNeeded(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for dialog to close.
If possible, add some synchronization that waits for the
DomainFieldRow
to update.