Skip to content

Commit

Permalink
Try to fix ids for tabs on LoginConfigPage again.
Browse files Browse the repository at this point in the history
Fix tabs for Ontology test.
  • Loading branch information
labkey-danield committed Mar 7, 2024
1 parent 50da173 commit 086f3fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
12 changes: 7 additions & 5 deletions src/org/labkey/test/components/ui/ontology/ConceptInfoTabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,19 @@ protected class ElementCache extends Component<?>.ElementCache
// navigation tabs
WebElement tabListContainer = Locator.tagWithClass("ul", "nav-tabs")
.findWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement overviewTab = Locator.tag("li").withChild(Locator.id("concept-information-tabs-tab-overview"))
WebElement overviewTab = Locator.tagWithAttributeContaining("a", "role", "tab")
.withText("Overview")
.findWhenNeeded(tabListContainer);
WebElement pathInformationTab = Locator.tag("li").withChild(Locator.id("concept-information-tabs-tab-pathinfo"))
WebElement pathInformationTab = Locator.tagWithAttributeContaining("a", "role", "tab")
.withText("Path Information")
.findWhenNeeded(tabListContainer);

// panes
WebElement tabContentContainer = Locator.tagWithClass("div", "tab-content")
.findWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT);

// overview pane
WebElement overviewPane = Locator.id("concept-information-tabs-pane-overview")
WebElement overviewPane = Locator.byClass("ontology-concept-overview-container")
.refindWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement title = Locator.tagWithClass("div", "title").findWhenNeeded(overviewPane);
WebElement codeBox = Locator.tagWithClass("span", "code").findWhenNeeded(overviewPane);
Expand All @@ -136,7 +138,7 @@ Optional<WebElement> noneSelectedElement()
}

// path info pane
WebElement pathInformationPane = Locator.id("concept-information-tabs-pane-pathinfo")
WebElement pathInformationPane = Locator.byClass("ontology-concept-pathinfo-container")
.refindWhenNeeded(this).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement conceptPathContainer()
{
Expand Down Expand Up @@ -164,7 +166,7 @@ List<WebElement> alternateConceptPathParts()

public static class ConceptInfoTabsFinder extends WebDriverComponentFinder<ConceptInfoTabs, ConceptInfoTabsFinder>
{
private final Locator.XPathLocator _baseLocator = Locator.id("concept-information-tabs");
private final Locator.XPathLocator _baseLocator = Locator.byClass("concept-information-tabs");

public ConceptInfoTabsFinder(WebDriver driver)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected class ElementCache extends ModalDialog.ElementCache
.findWhenNeeded(this);

final ConceptInfoTabs infoTabs = new ConceptInfoTabs.ConceptInfoTabsFinder(getDriver())
.findWhenNeeded(this);
.refindWhenNeeded(this);

final ReactSelect ontologySelect = ReactSelect.finder(getDriver()).withId("ontology-select")
.findWhenNeeded(this);
Expand Down
19 changes: 10 additions & 9 deletions src/org/labkey/test/pages/core/login/LoginConfigurePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ public LoginConfigurePage togglePrimaryConfiguration()
public LoginConfigRow getPrimaryConfigurationRow(String description)
{
return new LoginConfigRow.LoginConfigRowFinder(getDriver()).withDescription(description)
.waitFor(elementCache().tabPane1);
.waitFor(elementCache().activeTabPane);
}

public List<LoginConfigRow> getPrimaryConfigurations()
{
togglePrimaryConfiguration();
return new LoginConfigRow.LoginConfigRowFinder(getDriver()).findAll(elementCache().tabPane1);
return new LoginConfigRow.LoginConfigRowFinder(getDriver()).findAll(elementCache().activeTabPane);
}

public LoginConfigurePage toggleSecondaryConfiguration()
Expand All @@ -152,14 +152,14 @@ public LoginConfigurePage toggleSecondaryConfiguration()
public List<LoginConfigRow> getSecondaryConfigurations()
{
toggleSecondaryConfiguration();
return new LoginConfigRow.LoginConfigRowFinder(getDriver()).findAll(elementCache().tabPane2);
return new LoginConfigRow.LoginConfigRowFinder(getDriver()).findAll(elementCache().activeTabPane);
}

public LoginConfigRow getSecondaryConfigurationRow(String description)
{
toggleSecondaryConfiguration();
return new LoginConfigRow.LoginConfigRowFinder(getDriver())
.withDescription(description).waitFor(elementCache().tabPane2);
.withDescription(description).waitFor(elementCache().activeTabPane);
}

public LoginConfigurePage removeConfiguration(String description) // assumes for now we're doing primary only
Expand Down Expand Up @@ -193,11 +193,12 @@ protected class ElementCache extends LabKeyPage.ElementCache
Checkbox selfSignupCheckBox = new Checkbox(this, "Allow self sign up");
Checkbox allowUserEmailEditCheckbox = new Checkbox(this, "Allow users to edit their own email addresses");
Checkbox autoCreateCheckBox = new Checkbox(this,"Auto-create authenticated users");
WebElement tabPanel = Locator.id("tab-panel").refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement panelTab1 = Locator.id("tabs3-tab-primary").refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement tabPane1 = Locator.id("tabs3-pane-primary").refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement panelTab2 = Locator.id("tabs3-tab-secondary").refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement tabPane2 = Locator.id("tabs3-pane-secondary").refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement panelTab1 = Locator.tagWithAttributeContaining("a", "data-event-key", "primary")
.refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement panelTab2 = Locator.tagWithAttributeContaining("a", "data-event-key", "secondary")
.refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
WebElement activeTabPane = Locator.tag("div").withClasses("tab-pane", "active")
.refindWhenNeeded(getDriver()).withTimeout(WAIT_FOR_JAVASCRIPT);
MultiMenu.MultiMenuFinder primaryMenuFinder = new MultiMenu.MultiMenuFinder(getDriver())
.withText("Add New Primary Configuration").timeout(WAIT_FOR_JAVASCRIPT);
BootstrapMenu addPrimaryMenu = primaryMenuFinder.findWhenNeeded(this);
Expand Down

0 comments on commit 086f3fe

Please sign in to comment.