Skip to content
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

[bot] Merge 23.11 to develop #1772

Merged
merged 2 commits into from
Jan 2, 2024
Merged
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
9 changes: 7 additions & 2 deletions src/org/labkey/test/components/domain/DomainPanel.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package org.labkey.test.components.domain;

import org.labkey.test.BootstrapLocators;
import org.labkey.test.Locator;
import org.labkey.test.components.Component;
import org.labkey.test.components.WebDriverComponent;
import org.labkey.test.util.LabKeyExpectedConditions;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;

import java.util.Optional;

Expand Down Expand Up @@ -62,8 +64,11 @@ protected T setExpanded(boolean expand)
{
elementCache().expandToggle.click();
waitFor(() -> isExpanded() == expand, "Panel failed to " + (expand ? "expand" : "collapse"), 2_000);
getWrapper().shortWait()
.until(LabKeyExpectedConditions.animationIsDone(elementCache().panelBody)); // wait for transition to happen

// wait for transition to happen and no spinners to be present
getWrapper().longWait()
.until(ExpectedConditions.and(LabKeyExpectedConditions.animationIsDone(elementCache().panelBody),
ExpectedConditions.numberOfElementsToBe(BootstrapLocators.loadingSpinner, 0)));
}
return getThis();
}
Expand Down
30 changes: 27 additions & 3 deletions src/org/labkey/test/components/ui/DeleteConfirmationDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,33 @@ public SourcePage clickDismiss()

public DeleteConfirmationDialog setUserComment(String comment)
{
var commentInput = Input.Input(Locator.tagWithClass("textarea", "form-control"), getDriver()).timeout(2000)
.refindWhenNeeded(this);
commentInput.set(comment);

WebDriverWrapper.waitFor(()-> elementCache().commentInput.getComponentElement().isDisplayed(),
"The 'Comment' field is not visible.", 2_500);

elementCache().commentInput.set(comment);
return this;
}

@Override
protected ElementCache newElementCache()
{
return new ElementCache();
}

@Override
protected ElementCache elementCache()
{
return (ElementCache) super.elementCache();
}

protected class ElementCache extends ModalDialog.ElementCache
{

Input commentInput = Input.Input(Locator.tagWithClass("textarea", "form-control"), getDriver()).timeout(2000)
.refindWhenNeeded(this);

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ private void clickButtonWaitForPanel(WebElement button, int wait)
infoCount <= 1);

// A reference to the editing header title
WebElement editorHeading = Locator.tagWithClass("div", "panel-heading").startsWith("Editing").findWhenNeeded(getDriver());
Locator editingLocator = Locator.tagWithClass("div", "panel-heading").startsWith("Editing");

Assert.assertEquals("Cannot find a panel with 'Editing' in the header. There isn't a panel in edit mode.",
1, editingLocator.findElements(getDriver()).size());

// Shouldn't need to do this, but when tests fail, because the panel did not exit edit mode, the button is not in view.
getWrapper().scrollIntoView(button);
Expand All @@ -153,7 +156,8 @@ private void clickButtonWaitForPanel(WebElement button, int wait)

// Wait until the counts of panels not in edit mode increases and the editor heading is no longer visible.
WebDriverWrapper.waitFor(()->
(defaultPanel.findElements(getDriver()).size() > defaultCount) && !editorHeading.isDisplayed(),
defaultPanel.findElements(getDriver()).size() > defaultCount &&
editingLocator.findElements(getDriver()).isEmpty(),
"Panel did not change state.", wait);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.time.Duration;
Expand Down Expand Up @@ -316,11 +317,21 @@ public CustomizeGridViewDialog removeColumn(String column)
public CustomizeGridViewDialog removeColumn(String column, int index)
{
WebElement listItem = getShownInGridListItems(column).get(index);
WebElement removeIcon = Locator.tagWithClass("span", "view-field__action").findWhenNeeded(listItem);

// Make sure the mouse is on the identified row. Tests that remove columns one after another can show the mouse
// hovering for a moment over the remove icon of the previous row.
listItem.click();

WebElement removeIcon = Locator.tagWithClass("span", "view-field__action").findElement(listItem);
getWrapper().mouseOver(removeIcon);
removeIcon.click();

WebDriverWrapper.waitFor(()->!removeIcon.isDisplayed(),
String.format("Column '%s' was not removed from list.", column), 500);
// Move the mouse over the dialog title.
getWrapper().mouseOver(Locator.tagWithClass("h4", "modal-title").findElement(this));

getWrapper().shortWait()
.withMessage(String.format("Column '%s' was not removed from list.", column))
.until(ExpectedConditions.stalenessOf(listItem));

return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected void waitForPage()
}
},
"The 'Background Imports' page did not load in time.",
2_500);
15_000);
}

public static ImportsPage beginAt(WebDriverWrapper webDriverWrapper, String containerPath)
Expand Down
3 changes: 2 additions & 1 deletion src/org/labkey/test/components/ui/pipeline/StatusPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebElement;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -34,7 +35,7 @@ protected void waitForPage()
}
},
"The 'Pipeline Status' page did not load in time.",
2_500);
5_000);
}

public String getPageHeader()
Expand Down