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
10 changes: 5 additions & 5 deletions src/org/labkey/test/components/ui/edit/EditInlineField.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class EditInlineField extends WebDriverComponent<EditInlineField.ElementC
private final WebElement _el;
private final WebDriver _driver;

protected EditInlineField(WebElement element, WebDriver driver)
public EditInlineField(WebElement element, WebDriver driver)
{
_el = element;
_driver = driver;
Expand Down Expand Up @@ -110,15 +110,15 @@ protected ElementCache newElementCache()

protected class ElementCache extends Component<?>.ElementCache
{
final WebElement label = Locator.tagWithClass("span", "edit-inline-field__label")
final WebElement label = Locator.byClass("edit-inline-field__label")
.refindWhenNeeded(this);
final Locator toggleLoc = Locator.tagWithClass("span", "edit-inline-field__toggle");
final Locator toggleLoc = Locator.byClass("edit-inline-field__toggle");
final Locator pencilLoc = Locator.tagWithClass("i", "fa-pencil");
final WebElement input = Locator.css("input.form-control, input.select-input__input, textarea.form-control").refindWhenNeeded(this);

WebElement placeholderElement()
{
return Locator.tagWithClass("span", "edit-inline-field__placeholder")
return Locator.byClass("edit-inline-field__placeholder")
.findElement(this);
}

Expand Down Expand Up @@ -166,7 +166,7 @@ protected Locator locator()
{
if (_label != null)
return _baseLocator.withChild(
Locator.tagWithClass("span", "edit-inline-field__label")
Locator.byClass("edit-inline-field__label")
.containing(_label));
else
return _baseLocator;
Expand Down
21 changes: 14 additions & 7 deletions src/org/labkey/test/components/ui/navigation/SubNavBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ static public SubNavBarFinder finder(WebDriver driver)

public boolean hasTab(String tabText)
{
return getWrapper().isElementPresent(elementCache().getTabLocator(tabText));
return getWrapper().isElementPresent(elementCache().getTabLocator(tabText, false));
}

public void clickTab(String tabText)
{
elementCache().getTab(tabText).click();
clickTab(tabText, false);
}

public void clickTab(String tabText, boolean startsWithText)
{
elementCache().getTab(tabText, startsWithText).click();
}

public String getActiveTab()
Expand Down Expand Up @@ -101,15 +106,17 @@ protected class ElementCache extends Component<?>.ElementCache
WebElement tabScrollContainer = Locator.tagWithClass("div", "tab-scroll-ct").findWhenNeeded(this);
WebElement activeTab = Locator.css("ul.navbar-nav > li.active").findWhenNeeded(this);

Locator.XPathLocator getTabLocator(String text)
Locator.XPathLocator getTabLocator(String text, boolean startsWithText)
{
return Locator.tagWithClass("ul", "nav navbar-nav")
.child(Locator.tag("li")).withText(text);
Locator.XPathLocator loc = Locator.tagWithClass("ul", "nav navbar-nav").child(Locator.tag("li"));
if (startsWithText)
return loc.startsWith(text);
return loc.withText(text);
}

WebElement getTab(String text)
WebElement getTab(String text, boolean startsWithText)
{
return getTabLocator(text).findElement(this);
return getTabLocator(text, startsWithText).findElement(this);
}

}
Expand Down
Loading