archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject [44/50] archiva git commit: Fixing maven config for remote selenium server
Date Sat, 10 Jun 2017 11:26:29 GMT
Fixing maven config for remote selenium server


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/f242578b
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/f242578b
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/f242578b

Branch: refs/heads/citest
Commit: f242578be0635b7487976c6c0187acb4f70a0b27
Parents: 85352aa
Author: Martin Stockhammer <martin_s@apache.org>
Authored: Fri Jun 9 22:24:54 2017 +0200
Committer: Martin Stockhammer <martin_s@apache.org>
Committed: Fri Jun 9 22:24:54 2017 +0200

----------------------------------------------------------------------
 .../archiva-web/archiva-webapp-test/pom.xml     | 39 +++++++++++++++++++-
 .../web/test/parent/AbstractSeleniumTest.java   |  4 +-
 .../web/test/tools/WebdriverUtility.java        |  4 ++
 3 files changed, 43 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/f242578b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
index a5239a6..40eb946 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
@@ -36,8 +36,7 @@
     <selenium-server.version>3.4.0</selenium-server.version>
     <fluentlenium.version>3.2.0</fluentlenium.version>
     <fluentlenium.festassert.version>0.13.2</fluentlenium.festassert.version>
-    <seleniumHost></seleniumHost>
-    <seleniumPort></seleniumPort>
+
 
     <browserPath></browserPath>
   </properties>
@@ -434,6 +433,7 @@
                 <maxWaitTimeInMs>${maxWaitTimeInMs}</maxWaitTimeInMs>
                 <seleniumHost>${seleniumHost}</seleniumHost>
                 <seleniumPort>${seleniumPort}</seleniumPort>
+                <seleniumRemote>${seleniumRemote}</seleniumRemote>
                 <container.propertiesPortFilePath>${container.propertiesPortFilePath}</container.propertiesPortFilePath>
                 <container.http.port>${container.http.port}</container.http.port>
               </systemPropertyVariables>
@@ -676,6 +676,41 @@
       </properties>
     </profile>
 
+
+    <profile>
+      <id>seleniumHost</id>
+      <activation>
+        <property>
+          <name>!seleniumHost</name>
+        </property>
+      </activation>
+      <properties>
+        <seleniumHost>localhost</seleniumHost>
+      </properties>
+    </profile>
+    <profile>
+      <id>seleniumPort</id>
+      <activation>
+        <property>
+          <name>!seleniumPort</name>
+        </property>
+      </activation>
+      <properties>
+        <seleniumPort></seleniumPort>
+      </properties>
+    </profile>
+    <profile>
+      <id>seleniumRemote</id>
+      <activation>
+        <property>
+          <name>!seleniumRemote</name>
+        </property>
+      </activation>
+      <properties>
+        <seleniumRemote>false</seleniumRemote>
+      </properties>
+    </profile>
+
     <profile>
       <id>htmlunit</id>
       <activation>

http://git-wip-us.apache.org/repos/asf/archiva/blob/f242578b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
index 698d6a0..2cfe070 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
@@ -59,7 +59,7 @@ public abstract class AbstractSeleniumTest
     public String browser = System.getProperty( "browser" );
 
     public String baseUrl =
-        "http://localhost:" + System.getProperty( "tomcat.maven.http.port" ) + "/archiva/index.html?request_lang=en";
+        "http://localhost:" + System.getProperty( "container.http.port" ) + "/archiva/index.html?request_lang=en";
 
     public int maxWaitTimeInMs = Integer.getInteger( "maxWaitTimeInMs" );
 
@@ -67,7 +67,7 @@ public abstract class AbstractSeleniumTest
 
     public int seleniumPort = Integer.getInteger( "seleniumPort", 4444 );
 
-    public boolean remoteSelenium = Boolean.parseBoolean( System.getProperty( "remoteSelenium",
"false" ) );
+    public boolean remoteSelenium = Boolean.parseBoolean( System.getProperty( "seleniumRemote",
"false" ) );
 
     WebDriver webDriver = null;
 

http://git-wip-us.apache.org/repos/asf/archiva/blob/f242578b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
index 0f3af86..12546c3 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
+++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/WebdriverUtility.java
@@ -62,6 +62,10 @@ public class WebdriverUtility
     }
 
     public static WebDriver newWebDriver(String seleniumBrowser, String seleniumHost, int
seleniumPort, boolean seleniumRemote) {
+        log.info("WebDriver {}, {}, {}, {}", seleniumBrowser, seleniumHost, seleniumPort,
seleniumRemote);
+        if (seleniumRemote && StringUtils.isEmpty( seleniumHost )) {
+            throw new IllegalArgumentException( "seleniumHost must be set, when seleniumRemote=true"
);
+        }
         try {
 
             if ( StringUtils.contains(seleniumBrowser, "chrome")) {


Mime
View raw message