This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch TAP5-2744-fixing-selenium-tests
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to 
refs/heads/TAP5-2744-fixing-selenium-tests by this push:
     new 467082c0b TAP5-2744: upgrading Selenium again
467082c0b is described below

commit 467082c0bb435d208929863f462af3e0eec50959
Author: Thiago H. de Paula Figueiredo <thi...@arsmachina.com.br>
AuthorDate: Wed Dec 28 11:13:21 2022 -0300

    TAP5-2744: upgrading Selenium again
---
 build.gradle                                               |  2 +-
 tapestry-core/build.gradle                                 |  2 +-
 .../apache/tapestry5/integration/cluster/ClusterTests.java |  2 +-
 tapestry-test/build.gradle                                 |  5 +++--
 .../java/org/apache/tapestry5/test/SeleniumTestCase.java   | 14 +++++++-------
 5 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/build.gradle b/build.gradle
index 6f6643a6d..756578bf4 100755
--- a/build.gradle
+++ b/build.gradle
@@ -19,7 +19,7 @@ project.ext.versions = [
     hibernate: "5.4.32.Final",
     slf4j: "1.7.25",
     geb: "2.0",
-    selenium: "4.1.2",
+    selenium: "4.5.0",
     seleniumServer: "4.7.2",
     jackson: "2.13.1",
     jsonschemaGenerator: "4.20.0",
diff --git a/tapestry-core/build.gradle b/tapestry-core/build.gradle
index ee28a124e..142197c01 100644
--- a/tapestry-core/build.gradle
+++ b/tapestry-core/build.gradle
@@ -34,7 +34,7 @@ dependencies {
     implementation "commons-codec:commons-codec:1.10"
     
     testImplementation 
"org.junit.jupiter:junit-jupiter:${versions.junitJupiter}"
-
+    testImplementation "org.apache.httpcomponents:httpclient:4.5.14"
     testRuntimeOnly project(':tapestry-spock')
 
     testRuntimeOnly "org.hsqldb:hsqldb:1.8.0.10"
diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/cluster/ClusterTests.java
 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/cluster/ClusterTests.java
index 30575af50..3b6f5f697 100644
--- 
a/tapestry-core/src/test/java/org/apache/tapestry5/integration/cluster/ClusterTests.java
+++ 
b/tapestry-core/src/test/java/org/apache/tapestry5/integration/cluster/ClusterTests.java
@@ -18,7 +18,7 @@ import com.thoughtworks.selenium.DefaultSelenium;
 import com.thoughtworks.selenium.Selenium;
 import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium;
 
-import io.github.bonigarcia.wdm.FirefoxDriverManager;
+import io.github.bonigarcia.wdm.managers.FirefoxDriverManager;
 
 import org.apache.tapestry5.test.JettyRunner;
 import org.apache.tapestry5.test.TapestryTestConstants;
diff --git a/tapestry-test/build.gradle b/tapestry-test/build.gradle
index 95cdb58fb..008178eea 100644
--- a/tapestry-test/build.gradle
+++ b/tapestry-test/build.gradle
@@ -5,14 +5,15 @@ dependencies {
   api project(":tapestry-test-data")
   api project(":tapestry-runner")
 
-  api ("io.github.bonigarcia:webdrivermanager:2.2.4")
+  implementation ("io.github.bonigarcia:webdrivermanager:5.3.1")
 
   api "org.seleniumhq.selenium:selenium-leg-rc:${versions.selenium}", {
       exclude group: "org.seleniumhq.selenium", module: "jetty-repacked"
       exclude group: "org.testng", module: "testng"
       exclude group: "javax.servlet", module: "javax.servlet-api"
+      exclude group: "org.seleniumhq.selenium", module: 
"selenium-firefox-driver"
   }
-  api "org.seleniumhq.selenium:selenium-support:${versions.selenium}"
+  api "org.seleniumhq.selenium:selenium-java:${versions.seleniumServer}"
 
   api "org.testng:testng:${versions.testng}"
   api "org.easymock:easymock:${versions.easymock}"
diff --git 
a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java 
b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
index 94554c009..d35969f9f 100644
--- 
a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
+++ 
b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java
@@ -19,6 +19,7 @@ import 
com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor;
 
 import org.apache.tapestry5.test.constants.TapestryRunnerConstants;
 import org.openqa.selenium.By;
+import org.openqa.selenium.Capabilities;
 import org.openqa.selenium.JavascriptExecutor;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.StaleElementReferenceException;
@@ -39,10 +40,11 @@ import org.testng.ITestContext;
 import org.testng.annotations.*;
 import org.testng.xml.XmlTest;
 
-import io.github.bonigarcia.wdm.FirefoxDriverManager;
+import io.github.bonigarcia.wdm.managers.FirefoxDriverManager;
 
 import java.io.File;
 import java.lang.reflect.Method;
+import java.time.Duration;
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -215,17 +217,16 @@ public abstract class SeleniumTestCase extends Assert 
implements Selenium
 
         File ffProfileTemplate = new 
File(TapestryRunnerConstants.MODULE_BASE_DIR, 
"src/test/conf/ff_profile_template");
         DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
-        desiredCapabilities.setCapability(FirefoxDriver.MARIONETTE, true);
 
-        FirefoxOptions options = new FirefoxOptions(desiredCapabilities);
-        //options.setLogLevel(FirefoxDriverLogLevel.DEBUG);
+        FirefoxOptions options = new FirefoxOptions(desiredCapabilities); 
+        options.setLogLevel(FirefoxDriverLogLevel.TRACE);
 
         if (ffProfileTemplate.isDirectory() && ffProfileTemplate.exists())
         {
             LOGGER.info("Loading Firefox profile from: {}", ffProfileTemplate);
             FirefoxProfile profile = new FirefoxProfile(ffProfileTemplate);
             options.setProfile(profile);
-            profile.setPreference("intl.accept_languages", "en,fr,de");
+            profile.layoutOnDisk();
         }
         else 
         {
@@ -239,7 +240,6 @@ public abstract class SeleniumTestCase extends Assert 
implements Selenium
 
         CommandProcessor webDriverCommandProcessor = new 
WebDriverCommandProcessor(baseURL, driver);
 
-
         final ErrorReporterImpl errorReporter = new ErrorReporterImpl(driver, 
testContext);
 
         ErrorReportingCommandProcessor commandProcessor = new 
ErrorReportingCommandProcessor(webDriverCommandProcessor,
@@ -1372,7 +1372,7 @@ public abstract class SeleniumTestCase extends Assert 
implements Selenium
 
     protected void waitForCondition(ExpectedCondition condition, long 
timeoutSeconds)
     {
-      WebDriverWait wait = new WebDriverWait(webDriver, timeoutSeconds);
+      WebDriverWait wait = new WebDriverWait(webDriver, 
Duration.ofSeconds(timeoutSeconds));
       wait.until(condition);
     }
 

Reply via email to