forked from xwikisas/application-admintools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MISC] Add functional tests xwikisas#16
* added tests for health check section * started tests for instance usage section
- Loading branch information
1 parent
ffa9b92
commit 71ebc08
Showing
6 changed files
with
274 additions
and
4 deletions.
There are no files selected for viewing
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
65 changes: 65 additions & 0 deletions
65
...st-pageobjects/src/main/java/com/xwiki/admintools/test/po/DashboardHealthSectionView.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,65 @@ | ||
/* | ||
* 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 com.xwiki.admintools.test.po; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.xwiki.test.ui.po.ViewPage; | ||
|
||
public class DashboardHealthSectionView extends ViewPage | ||
{ | ||
@FindBy(css = "#healthCheck") | ||
private WebElement healthContent; | ||
|
||
@FindBy(css = "a[href='#confirmCacheFlushModal']") | ||
private WebElement flushCacheModalHyperlink; | ||
|
||
public WebElement getHealthJobStartButton() | ||
{ | ||
return healthContent.findElement(By.id("healthCheckJobStart")); | ||
} | ||
|
||
public WebElement getResult() | ||
{ | ||
return healthContent.findElement(By.className("health-check-result-message")); | ||
} | ||
|
||
public WebElement getHealthContent() | ||
{ | ||
return healthContent; | ||
} | ||
|
||
public void clickResultsToggle() | ||
{ | ||
healthContent.findElement(By.className("collapse-toggle")).click(); | ||
} | ||
|
||
public WebElement getLogs() | ||
{ | ||
return healthContent.findElement(By.className("log")); | ||
} | ||
|
||
public FlushCacheModalView clickFlushCacheHyperlink() | ||
{ | ||
flushCacheModalHyperlink.click(); | ||
return new FlushCacheModalView(By.id("confirmCacheFlushModal")); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...est-pageobjects/src/main/java/com/xwiki/admintools/test/po/DashboardUsageSectionView.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,40 @@ | ||
/* | ||
* 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 com.xwiki.admintools.test.po; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.xwiki.test.ui.po.ViewPage; | ||
|
||
public class DashboardUsageSectionView extends ViewPage | ||
{ | ||
@FindBy(css = ".wiki-size-section") | ||
private WebElement instanceUsageContent; | ||
|
||
@FindBy(css = "a[href='#viewWikisSizeModal']") | ||
private WebElement wikiSizeModalHyperlink; | ||
|
||
public WikisSizeModalView getWikisSizeModal() | ||
{ | ||
wikiSizeModalHyperlink.click(); | ||
return new WikisSizeModalView(By.id("viewWikisSizeModal")); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...ools-test-pageobjects/src/main/java/com/xwiki/admintools/test/po/FlushCacheModalView.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,46 @@ | ||
/* | ||
* 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 com.xwiki.admintools.test.po; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.xwiki.test.ui.po.BaseModal; | ||
|
||
public class FlushCacheModalView extends BaseModal | ||
{ | ||
@FindBy(css = "div#confirmCacheFlushModal") | ||
public WebElement content; | ||
|
||
public FlushCacheModalView(By selector) | ||
{ | ||
super(selector); | ||
} | ||
|
||
public void clickConfirmButton() | ||
{ | ||
content.findElement(By.cssSelector("#confirmCacheFlushModal .btn-primary")).click(); | ||
} | ||
|
||
public void clickCancelButton() | ||
{ | ||
content.findElement(By.cssSelector("#confirmCacheFlushModal .btn-default")).click(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...tools-test-pageobjects/src/main/java/com/xwiki/admintools/test/po/WikisSizeModalView.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,48 @@ | ||
/* | ||
* 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 com.xwiki.admintools.test.po; | ||
|
||
import java.util.List; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
import org.xwiki.test.ui.po.BaseModal; | ||
|
||
public class WikisSizeModalView extends BaseModal | ||
{ | ||
@FindBy(css = "div#viewWikisSizeModal") | ||
public WebElement content; | ||
|
||
public WikisSizeModalView(By selector) | ||
{ | ||
super(selector); | ||
} | ||
|
||
public void clickCancelButton() | ||
{ | ||
content.findElement(By.cssSelector("#viewWikisSizeModal .btn-default")).click(); | ||
} | ||
|
||
public List<WebElement> getTableRows() | ||
{ | ||
return content.findElements(By.cssSelector("table > tbody > tr")); | ||
} | ||
} |