@@ -819,13 +819,15 @@ | |||
<executions> | |||
<execution> | |||
<id>cleanup-files</id> | |||
<phase>clean</phase> | |||
<goals> | |||
<goal>run</goal> | |||
</goals> | |||
<configuration> | |||
<tasks> | |||
<delete file="${user.home}/.m2/archiva.xml" quiet="true"/> | |||
</tasks> | |||
<failOnError>false</failOnError> | |||
<target> | |||
<delete file="${user.home}/.m2/archiva.xml" /> | |||
</target> | |||
</configuration> | |||
</execution> | |||
</executions> |
@@ -21,6 +21,8 @@ package org.apache.archiva.web.test; | |||
import org.apache.archiva.web.test.parent.AbstractArchivaTest; | |||
import org.junit.Test; | |||
import org.openqa.selenium.By; | |||
import org.openqa.selenium.WebElement; | |||
import org.openqa.selenium.support.ui.ExpectedConditions; | |||
import org.openqa.selenium.support.ui.WebDriverWait; | |||
@@ -35,4 +37,19 @@ public class ArchivaAdminTest | |||
WebDriverWait wait = new WebDriverWait(getWebDriver(), 30); | |||
wait.until(ExpectedConditions.titleContains("Apache Archiva")); | |||
} | |||
@Test | |||
public void testInitialRepositories() | |||
{ | |||
WebDriverWait wait = new WebDriverWait(getWebDriver(), 20); | |||
WebElement el; | |||
el = wait.until(ExpectedConditions.elementToBeClickable( By.id("menu-repositories-list-a"))); | |||
tryClick( el, ExpectedConditions.presenceOfElementLocated( By.xpath("//table[@id='managed-repositories-table']//td[contains(text(),'internal')]") ), | |||
"Managed Repositories not activated"); | |||
wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//table[@id='managed-repositories-table']//td[contains(text(),'snapshots')]") )); | |||
el = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#remote-repositories-content']"))); | |||
tryClick(el,ExpectedConditions.visibilityOfElementLocated(By.xpath("//table[@id='remote-repositories-table']//td[contains(text(),'central')]")), | |||
"Remote Repositories View not available"); | |||
} | |||
} |
@@ -47,7 +47,7 @@ public class RepositoryAdminTest | |||
@Test | |||
public void testManagedRepository() | |||
{ | |||
login( getAdminUsername(), getAdminPassword() ); | |||
// login( getAdminUsername(), getAdminPassword() ); | |||
WebDriverWait wait = new WebDriverWait(getWebDriver(), 20); | |||
WebElement el; | |||
el = wait.until(ExpectedConditions.elementToBeClickable(By.id("menu-repositories-list-a"))); |
@@ -102,6 +102,9 @@ public class WebDriverBrowseTest | |||
// wait until topbar-menu-container is feeded | |||
await().atMost( 5, TimeUnit.SECONDS ).untilPredicate( ( fl ) -> $( "#topbar-menu" ).present() ); | |||
await().atMost( 10, TimeUnit.SECONDS).untilPredicate( (fl) -> el("#create-admin-link-a").conditions().clickable() || | |||
el("#login-link-a").conditions().clickable() | |||
); | |||
FluentList<FluentWebElement> elements = find( "#create-admin-link-a" ); | |||
if ( !elements.isEmpty() && elements.get( 0 ).displayed() ) |
@@ -42,6 +42,7 @@ import java.io.IOException; | |||
import java.nio.file.Files; | |||
import java.nio.file.Path; | |||
import java.nio.file.Paths; | |||
import java.util.concurrent.TimeUnit; | |||
/** | |||
* @author Olivier Lamy | |||
@@ -89,6 +90,11 @@ public class WebDriverTest | |||
// wait until topbar-menu-container is feeded | |||
//await().atMost(20, TimeUnit.SECONDS).until($("#topbar-menu")).present(); | |||
await().untilPredicate((fl) ->$("#topbar-menu").present()); | |||
await().atMost( 10, TimeUnit.SECONDS).untilPredicate( ( fl) -> el("#create-admin-link-a").conditions().clickable() || | |||
el("#login-link-a").conditions().clickable() | |||
); | |||
FluentList<FluentWebElement> elements = find("#create-admin-link-a"); | |||
if (!elements.isEmpty() && elements.get(0).displayed()) { |