Skip to content
Snippets Groups Projects
Commit b8dd0d3f authored by Simon Urli's avatar Simon Urli
Browse files

[Misc] Fix EditIT#editwithConflict by removing bad hack in BaseModal

(cherry picked from commit 89a734fc)
parent 5ae36323
No related branches found
No related tags found
No related merge requests found
...@@ -44,8 +44,6 @@ public ImageDialogSelectModal() ...@@ -44,8 +44,6 @@ public ImageDialogSelectModal()
private ImageDialogSelectModal(By selector) private ImageDialogSelectModal(By selector)
{ {
super(selector);
// This modal is added on demand so we can't rely on the base constructor to remove the "fade in" effect. We // This modal is added on demand so we can't rely on the base constructor to remove the "fade in" effect. We
// have to do the wait ourselves. // have to do the wait ourselves.
getDriver().waitUntilElementIsVisible(selector); getDriver().waitUntilElementIsVisible(selector);
......
...@@ -36,20 +36,23 @@ public class BaseModal extends BaseElement ...@@ -36,20 +36,23 @@ public class BaseModal extends BaseElement
{ {
protected WebElement container; protected WebElement container;
/**
* Default constructor when we want to manually set the container. This should be used with caution.
*/
protected BaseModal()
{
}
// This constructor remove the fade effect, but it only takes effect before the modal is opened // This constructor remove the fade effect, but it only takes effect before the modal is opened
// so take care to create the modal before doing the action to open it. // so take care to create the modal before doing the action to open it.
public BaseModal(By selector) public BaseModal(By selector)
{ {
List<WebElement> containers = getDriver().findElementsWithoutWaiting(selector); this.container = getDriver().findElement(selector);
if (!containers.isEmpty()) { // The fade effect is deleted from the modal because there isn't an easy way for waiting on the modal to be
// The modal is present and most probably hidden. // shown. This fade in effect is also not necessary for the test.
this.container = containers.get(0); String className = this.container.getAttribute("class");
// The fade effect is deleted from the modal because there isn't an easy way for waiting on the modal to be className = className.replace("fade", "");
// shown. This "fade in" effect is also not necessary for the test. getDriver().executeScript("arguments[0].setAttribute(\"class\",arguments[1])", this.container, className);
String className = this.container.getAttribute("class");
className = className.replace("fade", "");
getDriver().executeScript("arguments[0].setAttribute(\"class\",arguments[1])", this.container, className);
}
} }
public String getTitle() public String getTitle()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment