archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject archiva git commit: Fix for iexplore driver
Date Sun, 11 Jun 2017 08:46:10 GMT
Repository: archiva
Updated Branches:
  refs/heads/citest c4e7c0735 -> d53e5d926


Fix for iexplore driver


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

Branch: refs/heads/citest
Commit: d53e5d926638d1c13d43d12fe12951f46b24a978
Parents: c4e7c07
Author: Martin Stockhammer <martin_s@apache.org>
Authored: Sun Jun 11 10:45:50 2017 +0200
Committer: Martin Stockhammer <martin_s@apache.org>
Committed: Sun Jun 11 10:45:50 2017 +0200

----------------------------------------------------------------------
 .../web/test/tools/WebdriverUtility.java        | 28 +++++++++++++-------
 1 file changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/d53e5d92/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 a1fbca3..d48072d 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
@@ -96,14 +96,20 @@ public class WebdriverUtility
             }
 
             if (StringUtils.contains(seleniumBrowser, "iexplore")) {
+                DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
+                capabilities.setCapability( InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true );
+                WebDriver driver;
                 if (seleniumRemote)
                 {
-                    return new RemoteWebDriver( new URL( "http://" + seleniumHost + ":" +
seleniumPort + "/wd/hub" ),
-                        DesiredCapabilities.internetExplorer()
+                    driver = new RemoteWebDriver( new URL( "http://" + seleniumHost + ":"
+ seleniumPort + "/wd/hub" ),
+                        capabilities
                     );
                 } else {
-                    new InternetExplorerDriver(  );
+                    driver = new InternetExplorerDriver( capabilities );
                 }
+                driver.manage().window().maximize();
+                return driver;
+
             }
 
             if (StringUtils.contains( seleniumBrowser, "firefox" ))
@@ -120,18 +126,20 @@ public class WebdriverUtility
                 }
             }
 
+            // Default driver
+            DesiredCapabilities capabilities = DesiredCapabilities.htmlUnit();
+            capabilities.setJavascriptEnabled( true );
+            capabilities.setVersion( "firefox-52" );
+            WebDriver driver;
             if ( seleniumRemote )
             {
-                return new RemoteWebDriver( new URL( "http://" + seleniumHost + ":" + seleniumPort
+ "/wd/hub" ),
-                    DesiredCapabilities.htmlUnit()
+                driver = new RemoteWebDriver( new URL( "http://" + seleniumHost + ":" + seleniumPort
+ "/wd/hub" ),
+                    capabilities
                 );
             }
             else
             {
-                DesiredCapabilities capabilities = DesiredCapabilities.htmlUnit();
-                capabilities.setJavascriptEnabled( true );
-                capabilities.setVersion( "firefox-52" );
-                HtmlUnitDriver driver = new HtmlUnitDriver( capabilities  ) {
+                driver = new HtmlUnitDriver( capabilities  ) {
                     @Override
                     protected WebClient modifyWebClient( WebClient client )
                     {
@@ -141,8 +149,8 @@ public class WebdriverUtility
                         return client;
                     }
                 };
-                return driver;
             }
+            return driver;
 
         } catch (MalformedURLException e) {
             throw new RuntimeException("Initializion of remote driver failed");


Mime
View raw message