From abab994f71a2654e2e4acf577d3c4a356a7c6817 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Sat, 10 Jun 2017 13:30:04 +0200 Subject: Fixing issues on ciserver --- archiva-modules/archiva-web/archiva-webapp-test/pom.xml | 8 +++++--- .../org/apache/archiva/web/test/ArchivaAdminTest.java | 17 +++++++++++++++++ .../apache/archiva/web/test/RepositoryAdminTest.java | 2 +- .../apache/archiva/web/test/WebDriverBrowseTest.java | 3 +++ .../java/org/apache/archiva/web/test/WebDriverTest.java | 6 ++++++ 5 files changed, 32 insertions(+), 4 deletions(-) (limited to 'archiva-modules/archiva-web') diff --git a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml index 40eb946be..868f2f506 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml +++ b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml @@ -819,13 +819,15 @@ cleanup-files + clean run - - - + false + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java index 3e177b2aa..37805588a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/ArchivaAdminTest.java @@ -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"); + + } } \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java index c1eccfab9..7b034aa49 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/RepositoryAdminTest.java @@ -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"))); diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java index 17b90155b..e8cd49323 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java @@ -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 elements = find( "#create-admin-link-a" ); if ( !elements.isEmpty() && elements.get( 0 ).displayed() ) diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java index 0cdce6536..35e26b39b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java @@ -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 elements = find("#create-admin-link-a"); if (!elements.isEmpty() && elements.get(0).displayed()) { -- cgit v1.2.3