You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2018/04/30 16:55:23 UTC

portals-pluto git commit: PLUTO-705: Upgrade to Selenium 3 and make it possible for the TCK to test the switch between http/https via ChromeOptions.setAcceptInsecureCerts(true)

Repository: portals-pluto
Updated Branches:
  refs/heads/master 47d7c0d0f -> 4e1d53513


PLUTO-705: Upgrade to Selenium 3 and make it possible for the TCK to test the switch between http/https via ChromeOptions.setAcceptInsecureCerts(true)


Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/4e1d5351
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/4e1d5351
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/4e1d5351

Branch: refs/heads/master
Commit: 4e1d535136e7f96c439c02263fc491b29f0222c4
Parents: 47d7c0d
Author: vsingleton <vs...@gmail.com>
Authored: Sun Apr 29 19:05:48 2018 -0400
Committer: Neil Griffin <ne...@gmail.com>
Committed: Mon Apr 30 12:51:44 2018 -0400

----------------------------------------------------------------------
 .../portlet/tck/driver/TCKSimpleTestDriver.java | 36 +++++++++++++++-----
 portlet-tck_3.0/pom.xml                         | 18 ++++++----
 2 files changed, 39 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/4e1d5351/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKSimpleTestDriver.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKSimpleTestDriver.java b/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKSimpleTestDriver.java
index 84d0faa..a4bd73a 100644
--- a/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKSimpleTestDriver.java
+++ b/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKSimpleTestDriver.java
@@ -20,7 +20,6 @@ package javax.portlet.tck.driver;
 
 import static org.junit.Assert.*;
 
-import java.io.File;
 import java.io.FileInputStream;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -43,9 +42,8 @@ import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.chrome.ChromeOptions;
 import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.firefox.FirefoxBinary;
 import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.firefox.FirefoxProfile;
+import org.openqa.selenium.firefox.FirefoxOptions;
 import org.openqa.selenium.htmlunit.HtmlUnitDriver;
 import org.openqa.selenium.ie.InternetExplorerDriver;
 import org.openqa.selenium.remote.DesiredCapabilities;
@@ -217,7 +215,9 @@ public class TCKSimpleTestDriver {
       timeout = ((str != null) && str.matches("\\d+")) ? Integer.parseInt(str) : 3; 
       String wd = System.getProperty("test.browser.webDriver");
       String binary = System.getProperty("test.browser.binary");
-      boolean browserDefaultHeadless = browser.equalsIgnoreCase("chrome") || browser.equalsIgnoreCase("htmlunit") ||
+      boolean browserDefaultHeadless = browser.equalsIgnoreCase("chrome") ||
+          browser.equalsIgnoreCase("firefox") ||
+          browser.equalsIgnoreCase("htmlunit") ||
           browser.equalsIgnoreCase("phantomjs");
       String headlessProperty = System.getProperty("test.browser.headless");
       boolean headless = (((headlessProperty == null) || (headlessProperty.length() == 0)) && browserDefaultHeadless);
@@ -241,25 +241,43 @@ public class TCKSimpleTestDriver {
       System.out.println("   headless     =" + headless);
 
       if (browser.equalsIgnoreCase("firefox")) {
-         if ((binary == null) || (binary.length() == 0)) {
-            driver = new FirefoxDriver(new FirefoxProfile());
-         } else {
-            driver = new FirefoxDriver(new FirefoxBinary(new File(binary)), new FirefoxProfile());
+
+         System.setProperty("webdriver.gecko.driver", wd);
+         FirefoxOptions options = new FirefoxOptions();
+         options.setLegacy(true);
+         options.setAcceptInsecureCerts(true);
+
+         if ((binary != null) && (binary.length() != 0)) {
+            options.setBinary(binary);
          }
+
+         if (headless) {
+            options.setHeadless(true);
+         }
+
+         driver = new FirefoxDriver(options);
+
       } else if (browser.equalsIgnoreCase("internetExplorer")) {
          System.setProperty("webdriver.ie.driver", wd);
          driver = new InternetExplorerDriver();
       } else if (browser.equalsIgnoreCase("chrome")) {
+
          System.setProperty("webdriver.chrome.driver", wd);
          ChromeOptions options = new ChromeOptions();
+
          if ((binary != null) && (binary.length() > 0)) {
             options.setBinary(binary);
          }
+
          if (headless) {
             options.addArguments("--headless");
-            options.addArguments("--disable-infobars");
          }
+
+         options.addArguments("--disable-infobars");
+         options.setAcceptInsecureCerts(true);
+
          driver = new ChromeDriver(options);
+
       } else if (browser.equalsIgnoreCase("phantomjs")) {
          DesiredCapabilities capabilities = DesiredCapabilities.phantomjs();
          capabilities.setJavascriptEnabled(true);

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/4e1d5351/portlet-tck_3.0/pom.xml
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/pom.xml b/portlet-tck_3.0/pom.xml
index a61a458..9ba1317 100644
--- a/portlet-tck_3.0/pom.xml
+++ b/portlet-tck_3.0/pom.xml
@@ -216,12 +216,18 @@
             <version>4.11</version>
             <scope>test</scope>
          </dependency>
-         <dependency>
-            <groupId>org.seleniumhq.selenium</groupId>
-            <artifactId>selenium-java</artifactId>
-            <version>2.53.0</version>
-            <scope>test</scope>
-         </dependency>
+         <dependency>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-api</artifactId>
+            <version>3.11.0</version>
+            <scope>compile</scope>
+         </dependency>
+         <dependency>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-java</artifactId>
+            <version>3.11.0</version>
+            <scope>compile</scope>
+         </dependency>
          <dependency>
             <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>htmlunit-driver</artifactId>