-
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XWIKI-21848: Migrate NotificationFilterPreferenceLivetableResults to …
…a Live Data source * Fix since values * Introduce integration tests * Introduce page objects for LiveData panels * Fix UserProfile PO to allow following user
- Loading branch information
Showing
25 changed files
with
560 additions
and
51 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
...bjects/src/main/java/org/xwiki/livedata/test/po/AbstractLiveDataAdvancedPanelElement.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,78 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.xwiki.livedata.test.po; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.InvalidElementStateException; | ||
import org.openqa.selenium.Point; | ||
import org.openqa.selenium.WebElement; | ||
import org.xwiki.test.ui.po.BaseElement; | ||
|
||
/** | ||
* Abstract class representing different type of advanced panels in livedata. | ||
* | ||
* @version $Id$ | ||
* @since 16.3.0RC1 | ||
*/ | ||
public abstract class AbstractLiveDataAdvancedPanelElement extends BaseElement | ||
{ | ||
protected final WebElement container; | ||
protected final LiveDataElement liveData; | ||
|
||
/** | ||
* Default constructor. | ||
* @param liveData the livedata the panel belongs to. | ||
* @param container the container of the panel. | ||
*/ | ||
public AbstractLiveDataAdvancedPanelElement(LiveDataElement liveData, WebElement container) | ||
{ | ||
this.liveData = liveData; | ||
this.container = container; | ||
} | ||
|
||
/** | ||
* Close the panel. | ||
*/ | ||
public void closePanel() | ||
{ | ||
getDriver().findElementWithoutWaiting(this.container, By.className("close-button")).click(); | ||
} | ||
|
||
/** | ||
* Allow to click on links that are only visible when the mouse is on them (e.g. delete icons of filters) | ||
* @param linkIdentifiers the identifier to find the link element in the dom. | ||
*/ | ||
protected void clickOnMouseOverLinks(By linkContainer, By linkIdentifiers) | ||
{ | ||
getDriver().findElementsWithoutWaiting(this.container, linkContainer) | ||
.forEach(webElement -> { | ||
// First we move to the link container to make the link appearing | ||
getDriver().createActions().moveToElement(webElement).build().perform(); | ||
WebElement linkElement = getDriver().findElementWithoutWaiting(webElement, linkIdentifiers); | ||
if (!linkElement.isDisplayed()) { | ||
throw new InvalidElementStateException(String.format("The link [%s] should be displayed.", | ||
linkElement)); | ||
} | ||
// Click on the actual link | ||
getDriver().createActions().moveToElement(linkElement).click().build().perform(); | ||
}); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...vedata-test-pageobjects/src/main/java/org/xwiki/livedata/test/po/FiltersPanelElement.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,52 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.xwiki.livedata.test.po; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
|
||
/** | ||
* Represents the advanced panel for filtering columns. | ||
* | ||
* @version $Id$ | ||
* @since 16.3.0RC1 | ||
*/ | ||
public class FiltersPanelElement extends AbstractLiveDataAdvancedPanelElement | ||
{ | ||
/** | ||
* Default constructor. | ||
* @param liveData the livedata of the panel. | ||
* @param container the container of the panel. | ||
*/ | ||
public FiltersPanelElement(LiveDataElement liveData, WebElement container) | ||
{ | ||
super(liveData, container); | ||
} | ||
|
||
/** | ||
* Remove all filters. | ||
*/ | ||
public void clearAllFilters() | ||
{ | ||
this.clickOnMouseOverLinks(By.className("filter-group-title"), By.className("delete-filter-group")); | ||
this.liveData.waitUntilReady(); | ||
} | ||
} |
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
52 changes: 52 additions & 0 deletions
52
...-livedata-test-pageobjects/src/main/java/org/xwiki/livedata/test/po/SortPanelElement.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,52 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.xwiki.livedata.test.po; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
|
||
/** | ||
* Represents the advanced panel for sorting columns. | ||
* | ||
* @version $Id$ | ||
* @since 16.3.0RC1 | ||
*/ | ||
public class SortPanelElement extends AbstractLiveDataAdvancedPanelElement | ||
{ | ||
/** | ||
* Default constructor. | ||
* @param liveData the livedata of the panel. | ||
* @param container the container of the panel. | ||
*/ | ||
public SortPanelElement(LiveDataElement liveData, WebElement container) | ||
{ | ||
super(liveData, container); | ||
} | ||
|
||
/** | ||
* Remove all sorting on all columns. | ||
*/ | ||
public void clearAllSort() | ||
{ | ||
this.clickOnMouseOverLinks(By.className("sort-entry"), By.className("delete-sort")); | ||
this.liveData.waitUntilReady(); | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.