You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2021/01/11 21:09:32 UTC

[myfaces-tobago] branch master updated (dcaee3c -> 5da93e9)

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

bommel pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.


    from dcaee3c  fix: comment
     new af371ec  fix: maven docker profile
     new 1fc49e3  fix: maven docker profile
     new 9313c7f  Integration tests with testcontainers
     new 6f5e551  integration-test maven profile
     new f95947f  update FAQ: howto start integration tests in Tobago 5
     new fbfee49  use custom selenium/standalone-firefox
     new 2744a54  chore: remove deprecated junit-platform-surefire-provider
     new a4cba74  better logging for test results
     new 48e6ea5  fix: integration-tests WebDriverException + add logging
     new 7444756  integration-tests: only show path in log (instead of url)
     new 5da93e9  integration-tests: use fixed version for docker container

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                                            |  34 +-
 tobago-example/tobago-example-demo/pom.xml         | 304 +++++-------------
 .../src/main/docker-tests/assembly.xml             |  82 -----
 .../src/main/docker-tests/tomcat/override-web.xml  | 168 ----------
 .../src/main/docker/assembly.xml                   |   2 +-
 .../myfaces/tobago/example/demo/ApiController.java |   4 +
 .../main/webapp/content/10-intro/70-faq/FAQ.xhtml  |  11 +
 .../tobago-example-demo/src/main/webapp/test.xhtml |   2 +-
 .../src/main/webapp/testAccessAllPages.xhtml       |   4 +-
 .../tobago/example/demo/integration/BasicTest.java | 149 +++++++++
 .../example/demo/integration/FrontendBase.java     | 168 ++++++++++
 .../FrontendTest.java}                             |  65 ++--
 .../example/demo/qunit/AccessAllPagesTest.java     | 158 ---------
 .../tobago/example/demo/qunit/SeleniumBase.java    | 354 ---------------------
 .../java/org/junit/rules/ExternalResource.java     |  10 +-
 .../src/test/java/org/junit/rules/TestRule.java    |  11 +-
 .../src/test/resources/logback-test.xml            |  35 ++
 17 files changed, 530 insertions(+), 1031 deletions(-)
 delete mode 100644 tobago-example/tobago-example-demo/src/main/docker-tests/assembly.xml
 delete mode 100644 tobago-example/tobago-example-demo/src/main/docker-tests/tomcat/override-web.xml
 create mode 100644 tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
 create mode 100644 tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
 rename tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/{qunit/StandardTest.java => integration/FrontendTest.java} (52%)
 delete mode 100644 tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/AccessAllPagesTest.java
 delete mode 100644 tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/SeleniumBase.java
 copy tobago-core/src/main/java/org/apache/myfaces/tobago/component/InputSuggest2.java => tobago-example/tobago-example-demo/src/test/java/org/junit/rules/ExternalResource.java (77%)
 copy tobago-core/src/main/java/org/apache/myfaces/tobago/component/InputSuggest2.java => tobago-example/tobago-example-demo/src/test/java/org/junit/rules/TestRule.java (77%)
 create mode 100644 tobago-example/tobago-example-demo/src/test/resources/logback-test.xml


[myfaces-tobago] 05/11: update FAQ: howto start integration tests in Tobago 5

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit f95947f85a350f3b621decbc0de03da6c2be79b5
Author: Henning Nöth <hn...@apache.org>
AuthorDate: Mon Dec 21 16:18:22 2020 +0100

    update FAQ: howto start integration tests in Tobago 5
---
 .../org/apache/myfaces/tobago/example/demo/ApiController.java |  4 ++++
 .../src/main/webapp/content/10-intro/70-faq/FAQ.xhtml         | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ApiController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ApiController.java
index acdad33..bbefc8e 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ApiController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ApiController.java
@@ -78,6 +78,10 @@ public class ApiController implements Serializable {
     return Release.v4_3_0.getVersion();
   }
 
+  public String getVersion500() {
+    return Release.v5_0_0.getVersion();
+  }
+
   public String getCurrentRelease() {
     for (Release release : releases) {
       if (release.isCurrent()) {
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/70-faq/FAQ.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/70-faq/FAQ.xhtml
index 2a87c48..3c86077 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/70-faq/FAQ.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/70-faq/FAQ.xhtml
@@ -335,6 +335,17 @@ mvn -Pdocker-qunit-tests</demo-highlight>
       <demo-highlight language="markup">mvn -Pdocker-qunit-tests docker:start
 mvn -Pdocker-qunit-tests docker:stop</demo-highlight>
     </tc:section>
+
+    <tc:section id="integrationTestTobago5" label="Tobago 5">
+      <p>Since Tobago  #{apiController.version500} the integration tests are reimplemented with jasmine and
+        testcontainers.</p>
+      <p>To run the integration tests:</p>
+      <demo-highlight language="markup">cd tobago-example/tobago-example-demo
+mvn clean install -Pdocker -Pintegration-tests
+      </demo-highlight>
+      <p>The docker container can be rebuild with:</p>
+      <demo-highlight language="markup">mvn package -Pdocker</demo-highlight>
+    </tc:section>
   </tc:section>
 
   <tc:section id="testInBrowser" label="How can I run tests in the browser? (Tobago 3)">


[myfaces-tobago] 03/11: Integration tests with testcontainers

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 9313c7f445f9453a781922dd7cdd352f888a3406
Author: Henning Nöth <hn...@apache.org>
AuthorDate: Tue Dec 15 20:59:28 2020 +0100

    Integration tests with testcontainers
    
    * update junit5; add testcontainers dependencies
    * add TestRule fake class, which is needed for testcontainers
    * better naming package, class, tests
    * refactor integration tests to work with jasmine
---
 pom.xml                                            |  30 +-
 tobago-example/tobago-example-demo/pom.xml         |   2 +-
 .../tobago-example-demo/src/main/webapp/test.xhtml |   2 +-
 .../src/main/webapp/testAccessAllPages.xhtml       |   4 +-
 .../tobago/example/demo/integration/BasicTest.java | 161 ++++++++++
 .../example/demo/integration/FrontendBase.java     | 119 +++++++
 .../example/demo/integration/FrontendTest.java     |  93 ++++++
 .../example/demo/qunit/AccessAllPagesTest.java     | 158 ---------
 .../tobago/example/demo/qunit/SeleniumBase.java    | 354 ---------------------
 .../tobago/example/demo/qunit/StandardTest.java    |  81 -----
 .../src/test/java/org/junit/rules/TestRule.java    |  28 ++
 11 files changed, 433 insertions(+), 599 deletions(-)

diff --git a/pom.xml b/pom.xml
index fbf27d2..79f749f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -448,13 +448,31 @@
       <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-engine</artifactId>
-        <version>5.6.2</version>
+        <version>5.7.0</version>
         <scope>test</scope>
       </dependency>
       <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-params</artifactId>
-        <version>5.6.2</version>
+        <version>5.7.0</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.junit.jupiter</groupId>
+        <artifactId>junit-jupiter-api</artifactId>
+        <version>5.7.0</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.testcontainers</groupId>
+        <artifactId>testcontainers</artifactId>
+        <version>1.15.1</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.testcontainers</groupId>
+        <artifactId>junit-jupiter</artifactId>
+        <version>1.15.1</version>
         <scope>test</scope>
       </dependency>
       <dependency>
@@ -532,6 +550,14 @@
       <artifactId>junit-jupiter-params</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.testcontainers</groupId>
+      <artifactId>testcontainers</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.testcontainers</groupId>
+      <artifactId>junit-jupiter</artifactId>
+    </dependency>
+    <dependency>
       <groupId>ch.qos.logback</groupId>
       <artifactId>logback-classic</artifactId>
       <scope>test</scope>
diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index 3f0d1dc..d9ab0c5 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -144,7 +144,7 @@
         <artifactId>maven-surefire-plugin</artifactId>
         <configuration>
           <excludes>
-            <exclude>qunit/*</exclude>
+            <exclude>integration/*</exclude>
           </excludes>
         </configuration>
       </plugin>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/test.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/test.xhtml
index d06d97b..5b857f6 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/test.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/test.xhtml
@@ -28,7 +28,7 @@
   <tc:script file="#{request.contextPath}/tobago/test/tobago-test-tool.js" type="module"/>
   <tc:script file="#{request.contextPath}/script/tobago-test.js" type="module"/>
   <tc:style file="#{request.contextPath}/style/jasmine-3.5.0.css"/>
-  <tc:script file="#{request.contextPath}/#{param['accessTest'] ? 'error/error' : param['base']}.test.js"
+  <tc:script file="#{request.contextPath}/#{param['basicTest'] ? 'error/error' : param['base']}.test.js"
              type="module"/>
 
   <div id="jasmine-container"></div>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/testAccessAllPages.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/testAccessAllPages.xhtml
index 87e5511..7aa327d 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/testAccessAllPages.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/testAccessAllPages.xhtml
@@ -29,9 +29,9 @@
     <c:forEach items="#{testController.allTestPages}" var="testPage">
       <div class="testframe-wrapper">
         <div>
-          <tc:link label="open in new tab" link="test.xhtml?base=#{testPage.base}&amp;accessTest=true" target="_blank"/>
+          <tc:link label="open in new tab" link="test.xhtml?base=#{testPage.base}&amp;basicTest=true" target="_blank"/>
         </div>
-        <tc:object id="#{testPage.id}" name="test.xhtml?base=#{testPage.base}&amp;accessTest=true">
+        <tc:object id="#{testPage.id}" name="test.xhtml?base=#{testPage.base}&amp;basicTest=true">
           <tc:style height="300px"/>
         </tc:object>
       </div>
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
new file mode 100644
index 0000000..7216c7b
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.example.demo.integration;
+
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.junit.jupiter.Testcontainers;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.lang.invoke.MethodHandles;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URLEncoder;
+import java.net.UnknownHostException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.LocalTime;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+@Testcontainers
+class BasicTest extends FrontendBase {
+
+  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  static LocalTime startTime;
+
+  @BeforeAll
+  public static void setup() {
+    startTime = LocalTime.now();
+  }
+
+  @Test
+  void verifyExceptionTest() throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
+    final String host = InetAddress.getLocalHost().getHostAddress();
+    final int tomcatPort = tomcat.getFirstMappedPort();
+    final String path = "error/exception.xhtml";
+
+    final String base = path.substring(0, path.length() - 6);
+    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
+        + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+
+    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    webDriver.get(url);
+
+    List<WebElement> results = getJasmineResults(webDriver);
+    Assertions.assertTrue(results.size() > 0, "no results detected");
+    for (WebElement result : results) {
+      if ("has no exception".equals(result.getAttribute("title"))) {
+        Assertions.assertEquals("jasmine-failed", result.getAttribute("class"), result.getAttribute("title"));
+      } else {
+        Assertions.assertEquals("jasmine-passed", result.getAttribute("class"), result.getAttribute("title"));
+      }
+    }
+  }
+
+  @Test
+  void verify404Test() throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
+    final String host = InetAddress.getLocalHost().getHostAddress();
+    final int tomcatPort = tomcat.getFirstMappedPort();
+    final String path = "error/404.xhtml";
+
+    final String base = path.substring(0, path.length() - 6);
+    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
+        + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+
+    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    webDriver.get(url);
+
+    List<WebElement> results = getJasmineResults(webDriver);
+    Assertions.assertTrue(results.size() > 0, "no results detected");
+    for (WebElement result : results) {
+      if ("has no 404".equals(result.getAttribute("title"))) {
+        Assertions.assertEquals("jasmine-failed", result.getAttribute("class"), result.getAttribute("title"));
+      } else {
+        Assertions.assertEquals("jasmine-passed", result.getAttribute("class"), result.getAttribute("title"));
+      }
+    }
+  }
+
+  /**
+   * Call every page without a specific *.test.js and run general tests (duplicated Ids, 404, exception, ...).
+   */
+  @ParameterizedTest
+  @MethodSource("basicTestProvider")
+  void basicTest(String path, int testNumber, int testSize)
+      throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
+
+    final String timeLeft = getTimeLeft(startTime, testSize, testNumber);
+    final String host = InetAddress.getLocalHost().getHostAddress();
+    final int tomcatPort = tomcat.getFirstMappedPort();
+
+    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ")"
+        + " - url: http://" + host + ":" + tomcatPort + "/" + path);
+
+    final String base = path.substring(0, path.length() - 6);
+    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
+        + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+
+    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    webDriver.get(url);
+
+    List<WebElement> results = getJasmineResults(webDriver);
+    parseJasmineResults(results);
+  }
+
+  private static Stream<Arguments> basicTestProvider() throws IOException {
+    final List<String> paths = Files.walk(Paths.get("src/main/webapp/content/"))
+        .filter(Files::isRegularFile)
+        .map(Path::toString)
+        .filter(s -> s.endsWith(".xhtml"))
+        .filter(s -> !s.contains("/x-"))
+        .map(s -> s.substring("src/main/webapp/".length()))
+        .sorted()
+        .collect(Collectors.toList());
+
+    for (String standardTestPath : getStandardTestPaths()) {
+      paths.remove(standardTestPath); // already tested by standard test
+    }
+
+    final int testSize = paths.size();
+
+    int testNumber = 1;
+    List<Arguments> arguments = new LinkedList<>();
+    for (String path : paths) {
+      arguments.add(Arguments.of(path, testNumber, testSize));
+      testNumber++;
+    }
+    return arguments.stream();
+  }
+}
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
new file mode 100644
index 0000000..a613c8e
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.example.demo.integration;
+
+import org.apache.commons.lang3.time.DurationFormatUtils;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.openqa.selenium.By;
+import org.openqa.selenium.NoSuchElementException;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.remote.RemoteWebDriver;
+import org.openqa.selenium.support.ui.FluentWait;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.utility.DockerImageName;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.Duration;
+import java.time.LocalTime;
+import java.util.List;
+import java.util.stream.Collectors;
+
+abstract class FrontendBase {
+
+  @SuppressWarnings("rawtypes") // this is how to use testcontainers
+  @Container
+  public static GenericContainer seleniumChrome =
+      new GenericContainer<>(DockerImageName.parse("selenium/standalone-chrome")).withExposedPorts(4444);
+
+  @SuppressWarnings("rawtypes") // this is how to use testcontainers
+  @Container
+  public static GenericContainer tomcat =
+      new GenericContainer(DockerImageName.parse("myfaces/tobago-example-demo")).withExposedPorts(8080);
+
+  private static WebDriver chromeDriver;
+
+  @AfterAll
+  static void tearDown() {
+    if (chromeDriver != null) {
+      chromeDriver.quit();
+    }
+  }
+
+  static List<String> getStandardTestPaths() throws IOException {
+    return Files.walk(Paths.get("src/main/webapp/content/"))
+        .filter(Files::isRegularFile)
+        .map(Path::toString)
+        .filter(s -> s.endsWith(".test.js"))
+        .map(s -> s.substring("src/main/webapp/".length()))
+        .sorted()
+        .map(s -> s.substring(0, s.length() - 8) + ".xhtml")
+        .collect(Collectors.toList());
+  }
+
+  WebDriver getWebDriver(final String host, final Integer port) throws MalformedURLException {
+    if (chromeDriver == null || ((RemoteWebDriver) chromeDriver).getSessionId() == null) {
+      chromeDriver = new RemoteWebDriver(new URL("http://" + host + ":" + port + "/wd/hub"), new ChromeOptions());
+    }
+    return chromeDriver;
+  }
+
+  List<WebElement> getJasmineResults(WebDriver webDriver) {
+    final FluentWait<WebDriver> fluentWait = new FluentWait<>(webDriver)
+        .withTimeout(Duration.ofSeconds(60))
+        .pollingEvery(Duration.ofSeconds(1))
+        .ignoring(NoSuchElementException.class);
+    fluentWait.until(driver -> driver.findElement(By.className("jasmine-overall-result")));
+
+    return webDriver.findElements(By.cssSelector(".jasmine-symbol-summary li"));
+  }
+
+  void parseJasmineResults(List<WebElement> results) {
+    Assertions.assertTrue(results.size() > 0, "no results detected");
+    for (WebElement result : results) {
+      Assertions.assertEquals("jasmine-passed", result.getAttribute("class"), result.getAttribute("title"));
+    }
+  }
+
+  String getTimeLeft(final LocalTime startTime, final int testSize, final int testNo) {
+    final LocalTime now = LocalTime.now();
+    final Duration completeWaitTime = Duration.between(startTime, now).dividedBy(testNo).multipliedBy(testSize);
+    final LocalTime endTime = LocalTime.from(startTime).plus(completeWaitTime);
+    final Duration timeLeft = Duration.between(LocalTime.now(), endTime);
+
+    if (timeLeft.toHours() > 0) {
+      return DurationFormatUtils.formatDuration(timeLeft.toMillis(), "H'h' m'm' s's'");
+    } else if (timeLeft.toMinutes() > 0) {
+      return DurationFormatUtils.formatDuration(timeLeft.toMillis(), "m'm' s's'");
+    } else if (timeLeft.toMillis() >= 0) {
+      return DurationFormatUtils.formatDuration(timeLeft.toMillis(), "s's'");
+    } else {
+      return "---";
+    }
+  }
+}
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
new file mode 100644
index 0000000..db7d116
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.example.demo.integration;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.junit.jupiter.Testcontainers;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.lang.invoke.MethodHandles;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URLEncoder;
+import java.net.UnknownHostException;
+import java.time.LocalTime;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Stream;
+
+@Testcontainers
+class FrontendTest extends FrontendBase {
+
+  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  static LocalTime startTime;
+
+  @BeforeAll
+  public static void setup() {
+    startTime = LocalTime.now();
+  }
+
+  /**
+   * Call every page with a specific *.test.js.
+   */
+  @ParameterizedTest
+  @MethodSource("standardTestProvider")
+  void frontendTest(String path, int testNumber, int testSize)
+      throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
+
+    final String timeLeft = getTimeLeft(FrontendTest.startTime, testSize, testNumber);
+    final String host = InetAddress.getLocalHost().getHostAddress();
+    final int tomcatPort = tomcat.getFirstMappedPort();
+
+    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ")"
+        + " - url: http://" + host + ":" + tomcatPort + "/" + path);
+
+    final String base = path.substring(0, path.length() - 6);
+    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
+
+    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    webDriver.get(url);
+
+    List<WebElement> results = getJasmineResults(webDriver);
+    parseJasmineResults(results);
+  }
+
+  private static Stream<Arguments> standardTestProvider() throws IOException {
+    final List<String> paths = getStandardTestPaths();
+    final int testSize = paths.size();
+
+    int testNumber = 1;
+    List<Arguments> arguments = new LinkedList<>();
+    for (String path : paths) {
+      arguments.add(Arguments.of(path, testNumber, testSize));
+      testNumber++;
+    }
+    return arguments.stream();
+  }
+}
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/AccessAllPagesTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/AccessAllPagesTest.java
deleted file mode 100644
index 8b610f2..0000000
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/AccessAllPagesTest.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.myfaces.tobago.example.demo.qunit;
-
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.MethodSource;
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.lang.invoke.MethodHandles;
-import java.net.MalformedURLException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.time.LocalTime;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-class AccessAllPagesTest extends SeleniumBase {
-
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  /**
-   * Verify qunit test for "no exception".
-   */
-  @ParameterizedTest
-  @MethodSource("verifyNoException404TestProvider")
-  void verifyNoExceptionTest(Browser browser, String serverUrl)
-      throws MalformedURLException, UnsupportedEncodingException {
-    final String path = "error/exception.xhtml";
-    LOG.info("browser: " + browser + " - url: " + serverUrl + "/" + path);
-
-    if (isIgnored(serverUrl, path)) {
-      logIgnoreMessage(serverUrl, path);
-    } else {
-      setupWebDriver(browser, serverUrl, path, true);
-
-      final WebDriver webDriver = getWebDriver(browser);
-      waitForQUnitBanner(webDriver);
-      WebElement qunitTests = webDriver.findElement(By.id("qunit-tests"));
-
-      List<WebElement> results = qunitTests.findElements(By.xpath("li"));
-      boolean testException = false;
-      for (final WebElement result : results) {
-        if ("has no exception".equals(result.findElement(By.className("test-name")).getText())) {
-          Assertions.assertEquals(result.getAttribute("class"), "fail");
-          testException = true;
-        }
-      }
-      Assertions.assertTrue(testException, "Could not verify 'has no exception' test.");
-    }
-  }
-
-  /**
-   * Verify qunit test for "no 404".
-   */
-  @ParameterizedTest
-  @MethodSource("verifyNoException404TestProvider")
-  void verifyNo404Test(Browser browser, String serverUrl) throws MalformedURLException, UnsupportedEncodingException {
-    final String path = "error/404.xhtml";
-    LOG.info("browser: " + browser + " - url: " + serverUrl + "/" + path);
-
-    if (isIgnored(serverUrl, path)) {
-      logIgnoreMessage(serverUrl, path);
-    } else {
-      setupWebDriver(browser, serverUrl, path, true);
-
-      final WebDriver webDriver = getWebDriver(browser);
-      waitForQUnitBanner(webDriver);
-      WebElement qunitTests = webDriver.findElement(By.id("qunit-tests"));
-
-      List<WebElement> results = qunitTests.findElements(By.xpath("li"));
-      boolean test404 = false;
-      for (final WebElement result : results) {
-        if ("has no 404".equals(result.findElement(By.className("test-name")).getText())) {
-          Assertions.assertEquals(result.getAttribute("class"), "fail");
-          test404 = true;
-        }
-      }
-      Assertions.assertTrue(test404, "Could not verify 'has no 404' test.");
-    }
-  }
-
-  private static Stream<Arguments> verifyNoException404TestProvider() throws IOException {
-    List<Arguments> arguments = new LinkedList<>();
-
-    for (Browser browser : Browser.values()) {
-      for (String serverUrl : getServerUrls()) {
-        arguments.add(Arguments.of(browser, serverUrl));
-      }
-    }
-
-    return arguments.stream();
-  }
-
-  @ParameterizedTest
-  @MethodSource("accessAllPagesProvider")
-  void testAccessAllPages(Browser browser, String serverUrl, String path, LocalTime startTime, int testSize, int testNo)
-      throws MalformedURLException, UnsupportedEncodingException {
-
-    double percent = 100 * (double) testNo / testSize;
-    final String timeLeft = getTimeLeft(startTime, testSize, testNo);
-
-    LOG.info("(" + String.format("%.2f", percent) + " % complete" + " | time left: " + timeLeft + ")"
-        + " browser: " + browser + " - url: " + serverUrl + "/" + path);
-
-    if (isIgnored(serverUrl, path)) {
-      logIgnoreMessage(serverUrl, path);
-    } else {
-      setupWebDriver(browser, serverUrl, path, true);
-      parseQUnitResults(browser, serverUrl, path);
-    }
-  }
-
-  private static Stream<Arguments> accessAllPagesProvider() throws IOException {
-    final List<String> paths = Files.walk(Paths.get("src/main/webapp/content/"))
-        .filter(Files::isRegularFile)
-        .map(Path::toString)
-        .filter(s -> s.endsWith(".xhtml"))
-        .filter(s -> !s.contains("/x-"))
-        .map(s -> s.substring("src/main/webapp/".length()))
-        .sorted()
-        .collect(Collectors.toList());
-
-    for (String standardTestPath : getStandardTestPaths()) {
-      paths.remove(standardTestPath); // already tested by standard test
-    }
-
-    return getArguments(paths);
-  }
-}
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/SeleniumBase.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/SeleniumBase.java
deleted file mode 100644
index d025d93..0000000
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/SeleniumBase.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.myfaces.tobago.example.demo.qunit;
-
-import org.apache.commons.lang3.time.DurationFormatUtils;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.params.provider.Arguments;
-import org.openqa.selenium.By;
-import org.openqa.selenium.NoSuchElementException;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeOptions;
-import org.openqa.selenium.remote.RemoteWebDriver;
-import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.FluentWait;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.lang.invoke.MethodHandles;
-import java.net.HttpURLConnection;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.net.UnknownHostException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.time.Duration;
-import java.time.LocalTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-abstract class SeleniumBase {
-
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  private static WebDriver chromeDriver;
-  private static List<String> serverUrls = new ArrayList<>();
-  private static Map<String, String> ignores = new HashMap<>();
-
-  @BeforeAll
-  static void setUp() {
-    ignores.put(":8083/tobago-example-demo-myfaces-2.3",
-        "MyFaces 2.3 don't work with Tomcat 8.5 and openjdk10");
-    ignores.put("tobago-example-demo-mojarra-2.0",
-        "Ajax events don't work with Mojarra 2.0: https://issues.apache.org/jira/browse/TOBAGO-1589");
-    ignores.put("tobago-example-demo-mojarra-2.3",
-        "Currently Tobago demo don't run with Mojarra 2.3 on Tomcat 8.5");
-
-    ignores.put("content/40-test/6000-event/event.xhtml",
-        "Focus/blur event can only be fired if the browser window is in foreground."
-            + " This cannot be guaranteed in selenium tests."
-            + " event.test.js contain focus/blur events");
-
-    final String tobago1910 = "TreeSelect: Single selection nodes are not deselected correctly with mojarra: "
-        + "https://issues.apache.org/jira/browse/TOBAGO-1910";
-    ignores.put("tobago-example-demo-mojarra-2.1/content/20-component/090-tree/01-select/tree-select.xhtml",
-        tobago1910);
-    ignores.put("tobago-example-demo-mojarra-2.2/content/20-component/090-tree/01-select/tree-select.xhtml",
-        tobago1910);
-  }
-
-  @AfterAll
-  static void tearDown() {
-    if (chromeDriver != null) {
-      chromeDriver.quit();
-    }
-  }
-
-  enum Browser {
-    chrome
-    //, firefox // TODO implement firefox
-  }
-
-  static List<String> getServerUrls() throws UnknownHostException, MalformedURLException {
-    if (serverUrls.size() <= 0) {
-      final String hostAddress = InetAddress.getLocalHost().getHostAddress();
-
-      List<String> ports = new ArrayList<>();
-      ports.add("8082"); // Tomcat JRE 8
-      ports.add("8083"); // Tomcat JRE 10
-
-      List<String> contextPaths = new ArrayList<>();
-      contextPaths.add("tobago-example-demo"); // MyFaces 2.0
-      contextPaths.add("tobago-example-demo-myfaces-2.1");
-      contextPaths.add("tobago-example-demo-myfaces-2.2");
-      contextPaths.add("tobago-example-demo-myfaces-2.3");
-      contextPaths.add("tobago-example-demo-mojarra-2.0");
-      contextPaths.add("tobago-example-demo-mojarra-2.1");
-      contextPaths.add("tobago-example-demo-mojarra-2.2");
-      contextPaths.add("tobago-example-demo-mojarra-2.3");
-
-      for (String port : ports) {
-        for (String contextPath : contextPaths) {
-          String url = "http://" + hostAddress + ":" + port + "/" + contextPath;
-          final int status = getStatus(url);
-          if (status == 200) {
-            serverUrls.add(url);
-          } else {
-            LOG.warn("\n⚠️ IGNORED: Tests for " + url + ":\n Server status: " + status);
-          }
-        }
-      }
-    }
-
-    return serverUrls;
-  }
-
-  private static int getStatus(String url) throws MalformedURLException {
-    URL siteURL = new URL(url);
-    try {
-      HttpURLConnection connection = (HttpURLConnection) siteURL.openConnection();
-      connection.setRequestMethod("GET");
-      connection.connect();
-      return connection.getResponseCode();
-    } catch (IOException e) {
-      return -1;
-    }
-  }
-
-  static List<String> getStandardTestPaths() throws IOException {
-    return Files.walk(Paths.get("src/main/webapp/content/"))
-        .filter(Files::isRegularFile)
-        .map(Path::toString)
-        .filter(s -> s.endsWith(".test.js"))
-        .map(s -> s.substring("src/main/webapp/".length()))
-        .sorted()
-        .map(s -> s.substring(0, s.length() - 8) + ".xhtml")
-        .collect(Collectors.toList());
-  }
-
-  boolean isIgnored(final String serverUrl, final String path) {
-    final String url = serverUrl + "/" + path;
-    for (String key : ignores.keySet()) {
-      if (url.contains(key)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  void logIgnoreMessage(final String serverUrl, final String path) {
-    final String url = serverUrl + "/" + path;
-    for (final Map.Entry<String, String> ignore : ignores.entrySet()) {
-      if (url.contains(ignore.getKey())) {
-        final String message = ignore.getValue();
-        LOG.info("\n⚠️ IGNORED: Test for " + url + ":\n" + message);
-        return;
-      }
-    }
-  }
-
-  void setupWebDriver(final Browser browser, final String serverUrl, final String path, final boolean accessTest)
-      throws MalformedURLException, UnsupportedEncodingException {
-    if (Browser.chrome.equals(browser)
-        && (chromeDriver == null) || ((RemoteWebDriver) chromeDriver).getSessionId() == null) {
-      chromeDriver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), new ChromeOptions());
-    }
-
-    final String base = path.substring(0, path.length() - 6);
-    final String url = serverUrl + "/test.xhtml?base="
-        + URLEncoder.encode(base, "UTF-8") + (accessTest ? "&accessTest=true" : "");
-    getWebDriver(browser).get(url);
-  }
-
-  WebDriver getWebDriver(Browser browser) {
-    if (Browser.chrome.equals(browser)) {
-      return chromeDriver;
-    } else {
-      return null;
-    }
-  }
-
-  static Stream<Arguments> getArguments(final List<String> paths) throws MalformedURLException, UnknownHostException {
-    final LocalTime startTime = LocalTime.now();
-    final int testSize = Browser.values().length * getServerUrls().size() * paths.size();
-
-    List<Arguments> arguments = new LinkedList<>();
-
-    int testNo = 1;
-    for (String serverUrl : getServerUrls()) {
-      for (String path : paths) {
-        for (Browser browser : Browser.values()) {
-          arguments.add(Arguments.of(browser, serverUrl, path, startTime, testSize, testNo));
-          testNo++;
-        }
-      }
-    }
-
-    return arguments.stream();
-  }
-
-  String getTimeLeft(final LocalTime startTime, final int testSize, final int testNo) {
-    final LocalTime now = LocalTime.now();
-    final Duration completeWaitTime = Duration.between(startTime, now).dividedBy(testNo).multipliedBy(testSize);
-    final LocalTime endTime = LocalTime.from(startTime).plus(completeWaitTime);
-    final Duration timeLeft = Duration.between(LocalTime.now(), endTime);
-
-    if (timeLeft.toHours() > 0) {
-      return DurationFormatUtils.formatDuration(timeLeft.toMillis(), "H'h' m'm' s's'");
-    } else if (timeLeft.toMinutes() > 0) {
-      return DurationFormatUtils.formatDuration(timeLeft.toMillis(), "m'm' s's'");
-    } else if (timeLeft.toMillis() >= 0) {
-      return DurationFormatUtils.formatDuration(timeLeft.toMillis(), "s's'");
-    } else {
-      return "---";
-    }
-  }
-
-  /**
-   * Wait for the qunit-banner web element and return it.
-   * If the web element is available, the execution of qunit test should be done and it is safe to parse the results.
-   *
-   * @return qunit-banner web element
-   */
-  WebElement waitForQUnitBanner(final WebDriver webDriver) {
-    final FluentWait<WebDriver> fluentWait = new FluentWait<>(webDriver)
-        .withTimeout(Duration.ofSeconds(90))
-        .pollingEvery(Duration.ofSeconds(1))
-        .ignoring(NoSuchElementException.class);
-
-    WebElement qunitBanner = fluentWait.until(driver -> driver.findElement(By.id("qunit-banner")));
-    fluentWait.until(ExpectedConditions.attributeToBeNotEmpty(qunitBanner, "class"));
-
-    return qunitBanner;
-  }
-
-  void parseQUnitResults(final Browser browser, final String serverUrl, final String path) {
-    final WebDriver webDriver = getWebDriver(browser);
-    WebElement qunitBanner;
-    try {
-      qunitBanner = waitForQUnitBanner(webDriver);
-    } catch (Exception e) {
-      qunitBanner = webDriver.findElement(By.id("qunit-banner"));
-    }
-
-    WebElement qunitTestResult = webDriver.findElement(By.id("qunit-testresult"));
-    WebElement qunitTests = webDriver.findElement(By.id("qunit-tests"));
-
-    final List<WebElement> testCases = qunitTests.findElements(By.xpath("li"));
-    Assertions.assertTrue(testCases.size() > 0, "There must be at least one test case.");
-
-    final boolean testFailed = !qunitBanner.getAttribute("class").equals("qunit-pass");
-
-    int testCaseCount = 1;
-    final StringBuilder stringBuilder = new StringBuilder();
-    stringBuilder.append(qunitTestResult.getAttribute("textContent"));
-    stringBuilder.append("\n");
-
-    if (testFailed) {
-      for (final WebElement testCase : testCases) {
-        final String testName = getText(testCase, "test-name");
-        final String testStatus = testCase.getAttribute("class").toUpperCase();
-
-        stringBuilder.append(testCaseCount++);
-        stringBuilder.append(". ");
-        stringBuilder.append(testStatus);
-        stringBuilder.append(": ");
-        stringBuilder.append(testName);
-        stringBuilder.append(" (");
-        stringBuilder.append(getText(testCase, "runtime"));
-        stringBuilder.append(")\n");
-
-        final WebElement assertList = testCase.findElement(By.className("qunit-assert-list"));
-        final List<WebElement> asserts = assertList.findElements(By.tagName("li"));
-        int assertCount = 1;
-        for (final WebElement assertion : asserts) {
-          final String assertStatus = assertion.getAttribute("class");
-
-          stringBuilder.append("- ");
-          if (assertCount <= 9) {
-            stringBuilder.append("0");
-          }
-          stringBuilder.append(assertCount++);
-          stringBuilder.append(". ");
-          stringBuilder.append(assertStatus);
-          stringBuilder.append(": ");
-          stringBuilder.append(getText(assertion, "test-message"));
-          stringBuilder.append(getText(assertion, "runtime"));
-          stringBuilder.append("\n");
-
-          final String assertExpected = getText(assertion, "test-expected");
-          if (!"null".equals(assertExpected)) {
-            stringBuilder.append("-- ");
-            stringBuilder.append(assertExpected);
-            stringBuilder.append("\n");
-          }
-          final String assertResult = getText(assertion, "test-actual");
-          if (!"null".equals(assertResult)) {
-            stringBuilder.append("-- ");
-            stringBuilder.append(assertResult);
-            stringBuilder.append("\n");
-          }
-          final String assertSource = getText(assertion, "test-source");
-          if (!"null".equals(assertSource)) {
-            stringBuilder.append("-- ");
-            stringBuilder.append(assertSource);
-            stringBuilder.append("\n");
-          }
-        }
-
-        stringBuilder.append(getText(testCase, "qunit-source"));
-        stringBuilder.append("\n\n");
-      }
-    }
-
-    final String url = serverUrl + "/" + path;
-    if (testFailed) {
-      final String message = "\n❌ FAILED: Test with '" + browser + "' for " + url + "\n" + stringBuilder.toString();
-      LOG.warn(message);
-      Assertions.fail(message);
-    } else {
-      final String message = "\n✅ PASSED: Test with '" + browser + "' for " + url + "\n" + stringBuilder.toString();
-      LOG.info(message);
-      Assertions.assertTrue(true, message);
-    }
-  }
-
-  private String getText(final WebElement webElement, final String className) {
-    final List<WebElement> elements = webElement.findElements(By.className(className));
-    if (elements.size() > 0) {
-      return elements.get(0).getAttribute("textContent");
-    } else {
-      return "null";
-    }
-  }
-}
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/StandardTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/StandardTest.java
deleted file mode 100644
index b174f0a..0000000
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/qunit/StandardTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.myfaces.tobago.example.demo.qunit;
-
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.MethodSource;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.lang.invoke.MethodHandles;
-import java.net.MalformedURLException;
-import java.net.UnknownHostException;
-import java.time.LocalTime;
-import java.util.List;
-import java.util.stream.Stream;
-
-class StandardTest extends SeleniumBase {
-
-  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-  /**
-   * To test only a singe page, just change browser setup, 'portContextPath' and/or 'path'.
-   * Start the docker container with mvn -Pdocker-qunit-tests docker:start
-   */
-  @Test
-  void testSinglePage() throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
-    final Browser browser = Browser.chrome;
-    final String serverUrl = getServerUrls().get(0);
-    final String path = "content/10-intro/intro.xhtml";
-
-    LOG.info("browser: " + browser + " - url: " + serverUrl + "/" + path);
-
-    setupWebDriver(browser, serverUrl, path, false);
-    parseQUnitResults(browser, serverUrl, path);
-  }
-
-  @ParameterizedTest
-  @MethodSource("standardTestProvider")
-  void testStandard(Browser browser, String serverUrl, String path, LocalTime startTime, int testSize, int testNo)
-      throws MalformedURLException, UnsupportedEncodingException {
-
-    double percent = 100 * (double) testNo / testSize;
-    final String timeLeft = getTimeLeft(startTime, testSize, testNo);
-
-    LOG.info("(" + String.format("%.2f", percent) + " % complete" + " | time left: " + timeLeft + ")"
-        + " browser: " + browser + " - url: " + serverUrl + "/" + path);
-
-    if (isIgnored(serverUrl, path)) {
-      logIgnoreMessage(serverUrl, path);
-    } else {
-      setupWebDriver(browser, serverUrl, path, false);
-      parseQUnitResults(browser, serverUrl, path);
-    }
-  }
-
-  private static Stream<Arguments> standardTestProvider() throws IOException {
-    final List<String> paths = getStandardTestPaths();
-    return getArguments(paths);
-  }
-}
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/junit/rules/TestRule.java b/tobago-example/tobago-example-demo/src/test/java/org/junit/rules/TestRule.java
new file mode 100644
index 0000000..f0f6c69
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/test/java/org/junit/rules/TestRule.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.junit.rules;
+
+/*
+ * the fake class is needed for testcontainers, because of an dependency to junit4
+ * https://github.com/testcontainers/testcontainers-java/issues/970
+ */
+@SuppressWarnings("unused")
+public interface TestRule {
+}


[myfaces-tobago] 09/11: fix: integration-tests WebDriverException + add logging

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 48e6ea5282e7e756d3e40e691a7ca303d1096914
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Sun Jan 10 13:11:32 2021 +0100

    fix: integration-tests WebDriverException + add logging
    
    * use own docker network
    * log warnings from selenium/tomcat container
    * some improvements (wait for container, getTomcatUrl(), container aliases, logback-test.xml)
---
 .../tobago/example/demo/integration/BasicTest.java | 31 ++++++-----------
 .../example/demo/integration/FrontendBase.java     | 39 ++++++++++++++--------
 .../example/demo/integration/FrontendTest.java     |  9 ++---
 .../java/org/junit/rules/ExternalResource.java     | 27 +++++++++++++++
 .../src/test/resources/logback-test.xml            | 35 +++++++++++++++++++
 5 files changed, 101 insertions(+), 40 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
index 19ae800..7c0999f 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
@@ -62,18 +62,15 @@ class BasicTest extends FrontendBase {
 
   @Test
   void verifyExceptionTest() throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
-    final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = getTomcatPort();
     final String path = "error/exception.xhtml";
 
     final String base = path.substring(0, path.length() - 6);
-    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
-        + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
-    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
-    webDriver.get(url);
+    WebDriver webDriver = getWebDriver();
+    webDriver.get(testUrl);
 
-    List<WebElement> results = getJasmineResults(webDriver, url);
+    List<WebElement> results = getJasmineResults(webDriver, testUrl);
     Assertions.assertTrue(results.size() > 0, "no results detected");
     for (WebElement result : results) {
       if ("has no exception".equals(result.getAttribute("title"))) {
@@ -86,18 +83,15 @@ class BasicTest extends FrontendBase {
 
   @Test
   void verify404Test() throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
-    final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = getTomcatPort();
     final String path = "error/404.xhtml";
 
     final String base = path.substring(0, path.length() - 6);
-    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
-        + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
-    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
-    webDriver.get(url);
+    WebDriver webDriver = getWebDriver();
+    webDriver.get(testUrl);
 
-    List<WebElement> results = getJasmineResults(webDriver, url);
+    List<WebElement> results = getJasmineResults(webDriver, testUrl);
     Assertions.assertTrue(results.size() > 0, "no results detected");
     for (WebElement result : results) {
       if ("has no 404".equals(result.getAttribute("title"))) {
@@ -117,17 +111,14 @@ class BasicTest extends FrontendBase {
       throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
 
     final String timeLeft = getTimeLeft(startTime, testSize, testNumber);
-    final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = getTomcatPort();
-    final String pageUrl = "http://" + host + ":" + tomcatPort + "/" + path;
+    final String pageUrl = getTomcatUrl() + "/" + path;
 
     LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - url: " + pageUrl);
 
     final String base = path.substring(0, path.length() - 6);
-    final String testUrl = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
-        + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
-    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
+    WebDriver webDriver = getWebDriver();
     webDriver.get(testUrl);
 
     List<WebElement> results = getJasmineResults(webDriver, pageUrl);
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
index 999bdd9..f9d6744 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
@@ -33,13 +33,18 @@ import org.openqa.selenium.support.ui.FluentWait;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.Wait;
 import org.testcontainers.junit.jupiter.Container;
 import org.testcontainers.utility.DockerImageName;
 
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
+import java.net.InetAddress;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.net.UnknownHostException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -52,17 +57,25 @@ abstract class FrontendBase {
 
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-  @SuppressWarnings("rawtypes") // this is how to use testcontainers
+  private static final Network NETWORK = Network.newNetwork();
+  private static final String SELENIUM_ALIAS = "selenium";
+  private static final String TOMCAT_ALIAS = "tomcat";
+  public static final int SELENIUM_PORT = 4444;
+  public static final int TOMCAT_PORT = 8080;
+
   @Container
-  private static final GenericContainer SELENIUM_FIREFOX =
+  private static final GenericContainer<?> SELENIUM_FIREFOX =
       new GenericContainer<>(DockerImageName.parse("henningn/selenium-standalone-firefox"))
-          .withExposedPorts(4444);
+          .withNetwork(NETWORK).withNetworkAliases(SELENIUM_ALIAS).withExposedPorts(SELENIUM_PORT)
+          .waitingFor(Wait.forHttp("/").forPort(SELENIUM_PORT))
+          .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger(SELENIUM_ALIAS)).withSeparateOutputStreams());
 
-  @SuppressWarnings("rawtypes") // this is how to use testcontainers
   @Container
-  private static final GenericContainer TOMCAT =
-      new GenericContainer(DockerImageName.parse("myfaces/tobago-example-demo"))
-          .withExposedPorts(8080);
+  private static final GenericContainer<?> TOMCAT =
+      new GenericContainer<>(DockerImageName.parse("myfaces/tobago-example-demo"))
+          .withNetwork(NETWORK).withNetworkAliases(TOMCAT_ALIAS).withExposedPorts(TOMCAT_PORT)
+          .waitingFor(Wait.forHttp("/").forPort(TOMCAT_PORT))
+          .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger(TOMCAT_ALIAS)).withSeparateOutputStreams());
 
   private static WebDriver firefoxDriver;
 
@@ -84,8 +97,10 @@ abstract class FrontendBase {
         .collect(Collectors.toList());
   }
 
-  WebDriver getWebDriver(final String host, final Integer port) throws MalformedURLException {
+  WebDriver getWebDriver() throws MalformedURLException, UnknownHostException {
     if (firefoxDriver == null || ((RemoteWebDriver) firefoxDriver).getSessionId() == null) {
+      final String host = InetAddress.getLocalHost().getHostAddress();
+      final int port = SELENIUM_FIREFOX.getFirstMappedPort();
       firefoxDriver = new RemoteWebDriver(new URL("http://" + host + ":" + port + "/wd/hub"), new FirefoxOptions());
     }
     return firefoxDriver;
@@ -146,11 +161,7 @@ abstract class FrontendBase {
     }
   }
 
-  int getFirefoxPort() {
-    return SELENIUM_FIREFOX.getFirstMappedPort();
-  }
-
-  int getTomcatPort() {
-    return TOMCAT.getFirstMappedPort();
+  String getTomcatUrl() {
+    return "http://" + TOMCAT_ALIAS + ":" + TOMCAT_PORT;
   }
 }
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
index e314b32..37a41cb 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
@@ -32,7 +32,6 @@ import org.testcontainers.junit.jupiter.Testcontainers;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.lang.invoke.MethodHandles;
-import java.net.InetAddress;
 import java.net.MalformedURLException;
 import java.net.URLEncoder;
 import java.net.UnknownHostException;
@@ -62,16 +61,14 @@ class FrontendTest extends FrontendBase {
       throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
 
     final String timeLeft = getTimeLeft(FrontendTest.startTime, testSize, testNumber);
-    final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = getTomcatPort();
-    final String pageUrl = "http://" + host + ":" + tomcatPort + "/" + path;
+    final String pageUrl = getTomcatUrl() + "/" + path;
 
     LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - url: " + pageUrl);
 
     final String base = path.substring(0, path.length() - 6);
-    final String testUrl = "http://" + host + ":" + tomcatPort + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
+    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
 
-    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
+    WebDriver webDriver = getWebDriver();
     webDriver.get(testUrl);
 
     List<WebElement> results = getJasmineResults(webDriver, pageUrl);
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/junit/rules/ExternalResource.java b/tobago-example/tobago-example-demo/src/test/java/org/junit/rules/ExternalResource.java
new file mode 100644
index 0000000..810e944
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/test/java/org/junit/rules/ExternalResource.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.junit.rules;
+
+/*
+ * the fake class is needed for testcontainers, because of an dependency to junit4
+ * https://github.com/testcontainers/testcontainers-java/issues/970
+ */
+public abstract class ExternalResource implements TestRule {
+}
diff --git a/tobago-example/tobago-example-demo/src/test/resources/logback-test.xml b/tobago-example/tobago-example-demo/src/test/resources/logback-test.xml
new file mode 100644
index 0000000..1b09d19
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/test/resources/logback-test.xml
@@ -0,0 +1,35 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<configuration>
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
+    </encoder>
+  </appender>
+
+  <root level="info">
+    <appender-ref ref="STDOUT"/>
+  </root>
+
+  <logger name="org.testcontainers" level="INFO"/>
+  <logger name="com.github.dockerjava" level="WARN"/>
+  <logger name="tomcat" level="WARN"/>
+  <logger name="selenium" level="WARN"/>
+</configuration>


[myfaces-tobago] 11/11: integration-tests: use fixed version for docker container

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 5da93e94d55a56d7c50b4c5969b91ecfdffe71e3
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Mon Jan 11 20:06:24 2021 +0100

    integration-tests: use fixed version for docker container
---
 tobago-example/tobago-example-demo/pom.xml                             | 2 +-
 .../apache/myfaces/tobago/example/demo/integration/FrontendBase.java   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index 39cd2d4..8606d45 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -335,7 +335,7 @@
                     </ports>
                   </run>
                   <build>
-                    <from>tomcat</from>
+                    <from>tomcat:9.0.41-jdk11</from>
                     <tags>
                       <tag>${tobago.version}</tag>
                     </tags>
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
index 696666b..319d8f0 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
@@ -65,7 +65,8 @@ abstract class FrontendBase {
 
   @Container
   private static final GenericContainer<?> SELENIUM_FIREFOX =
-      new GenericContainer<>(DockerImageName.parse("henningn/selenium-standalone-firefox"))
+      new GenericContainer<>(DockerImageName
+          .parse("henningn/selenium-standalone-firefox:4.0.0-beta-1-prerelease-20201208"))
           .withNetwork(NETWORK).withNetworkAliases(SELENIUM_ALIAS).withExposedPorts(SELENIUM_PORT)
           .waitingFor(Wait.forHttp("/").forPort(SELENIUM_PORT))
           .withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger(SELENIUM_ALIAS)).withSeparateOutputStreams());


[myfaces-tobago] 04/11: integration-test maven profile

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 6f5e55136d5f2be76314963cbeb933a12a84ec12
Author: Henning Nöth <hn...@apache.org>
AuthorDate: Mon Dec 21 16:09:11 2020 +0100

    integration-test maven profile
    
    * execute frontend tests
    * remove unused qunit profile with associated docker files
---
 tobago-example/tobago-example-demo/pom.xml         | 215 +--------------------
 .../src/main/docker-tests/assembly.xml             |  82 --------
 .../src/main/docker-tests/tomcat/override-web.xml  | 168 ----------------
 3 files changed, 3 insertions(+), 462 deletions(-)

diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index d9ab0c5..aaa95eb 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -269,230 +269,21 @@
     </profile>
 
     <profile>
-      <id>docker-qunit-tests</id>
+      <id>integration-tests</id>
       <build>
         <plugins>
           <plugin>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>exec-maven-plugin</artifactId>
-            <version>${exec.version}</version>
-            <executions>
-              <execution>
-                <phase>package</phase>
-                <goals>
-                  <goal>exec</goal>
-                </goals>
-                <configuration>
-                  <executable>mvn</executable>
-                  <arguments>
-                    <argument>clean</argument>
-                    <argument>package</argument>
-                    <argument>-Pdocker-tomcat</argument>
-                  </arguments>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <groupId>com.soebes.maven.plugins</groupId>
-            <artifactId>iterator-maven-plugin</artifactId>
-            <version>0.5.1</version>
-            <executions>
-              <execution>
-                <phase>package</phase>
-                <goals>
-                  <goal>iterator</goal>
-                </goals>
-                <configuration>
-                  <items>
-                    <item>myfaces-2.1</item>
-                    <item>myfaces-2.2</item>
-                    <item>myfaces-2.3</item>
-                    <item>mojarra-2.0</item>
-                    <item>mojarra-2.1</item>
-                    <item>mojarra-2.2</item>
-                    <item>mojarra-2.3</item>
-                  </items>
-                  <pluginExecutors>
-                    <pluginExecutor>
-                      <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>exec-maven-plugin</artifactId>
-                        <version>${exec.version}</version>
-                      </plugin>
-                      <goal>exec</goal>
-                      <configuration>
-                        <executable>mvn</executable>
-                        <arguments>
-                          <argument>package</argument>
-                          <argument>-Pdocker-tomcat</argument>
-                          <argument>-Djsf=@item@</argument>
-                          <argument>-DfinalName=tobago-example-demo-@item@</argument>
-                        </arguments>
-                      </configuration>
-                    </pluginExecutor>
-                  </pluginExecutors>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <groupId>io.fabric8</groupId>
-            <artifactId>docker-maven-plugin</artifactId>
-            <version>0.25.2</version>
-            <configuration>
-              <startParallel>true</startParallel>
-              <sourceDirectory>src/main/docker-tests</sourceDirectory>
-              <images>
-                <image>
-                  <name>tobago/tomcat8.5-jre8</name>
-                  <build>
-                    <from>tomcat:8.5-jre8</from>
-                    <tags>
-                      <tag>${project.parent.version}</tag>
-                    </tags>
-                    <assembly>
-                      <descriptor>assembly.xml</descriptor>
-                      <basedir>/usr/local/tomcat</basedir>
-                    </assembly>
-                  </build>
-                  <run>
-                    <ports>
-                      <port>8082:8080</port>
-                    </ports>
-                    <wait>
-                      <http>
-                        <url>http://localhost:8082/${project.artifactId}</url>
-                      </http>
-                      <time>180000</time>
-                    </wait>
-                  </run>
-                </image>
-                <image>
-                  <name>tobago/tomcat8.5-jre10</name>
-                  <build>
-                    <from>tomcat:8.5-jre10</from>
-                    <tags>
-                      <tag>${project.parent.version}</tag>
-                    </tags>
-                    <assembly>
-                      <descriptor>assembly.xml</descriptor>
-                      <basedir>/usr/local/tomcat</basedir>
-                    </assembly>
-                  </build>
-                  <run>
-                    <ports>
-                      <port>8083:8080</port>
-                    </ports>
-                    <wait>
-                      <http>
-                        <url>http://localhost:8083/${project.artifactId}</url>
-                      </http>
-                      <time>180000</time>
-                    </wait>
-                  </run>
-                </image>
-                <image>
-                  <alias>selenium-hub</alias>
-                  <name>selenium/hub:${selenium.version}</name>
-                  <run>
-                    <ports>
-                      <port>4444:4444</port>
-                    </ports>
-                    <wait>
-                      <http>
-                        <url>http://localhost:4444</url>
-                        <status>200</status>
-                      </http>
-                      <time>20000</time>
-                    </wait>
-                  </run>
-                </image>
-                <image>
-                  <name>selenium/node-chrome:${selenium.version}</name>
-                  <run>
-                    <dependsOn>
-                      <container>selenium-hub</container>
-                    </dependsOn>
-                    <links>
-                      <link>selenium-hub</link>
-                    </links>
-                    <env>
-                      <HUB_HOST>selenium-hub</HUB_HOST>
-                      <HOB_PORT>4444</HOB_PORT>
-                    </env>
-                    <ports>
-                      <port>5556:5555</port>
-                    </ports>
-                    <wait>
-                      <http>
-                        <url>http://localhost:5556</url>
-                        <status>200</status>
-                      </http>
-                      <time>20000</time>
-                    </wait>
-                  </run>
-                </image>
-                <image>
-                  <name>selenium/node-firefox:${selenium.version}</name>
-                  <run>
-                    <dependsOn>
-                      <container>selenium-hub</container>
-                    </dependsOn>
-                    <links>
-                      <link>selenium-hub</link>
-                    </links>
-                    <env>
-                      <HUB_HOST>selenium-hub</HUB_HOST>
-                      <HOB_PORT>4444</HOB_PORT>
-                    </env>
-                    <ports>
-                      <port>5557:5555</port>
-                    </ports>
-                    <!-- Set shm size to avoid firefox crashes: https://github.com/SeleniumHQ/docker-selenium/tree/3.12.0-boron#running-the-images -->
-                    <shmSize>1073741824</shmSize>
-                    <wait>
-                      <http>
-                        <url>http://localhost:5557</url>
-                        <status>200</status>
-                      </http>
-                      <time>20000</time>
-                    </wait>
-                  </run>
-                </image>
-              </images>
-            </configuration>
-            <executions>
-              <execution>
-                <id>start-container</id>
-                <phase>pre-integration-test</phase>
-                <goals>
-                  <goal>stop</goal>
-                  <goal>build</goal>
-                  <goal>start</goal>
-                </goals>
-              </execution>
-              <execution>
-                <id>stop-container</id>
-                <phase>post-integration-test</phase>
-                <goals>
-                  <goal>stop</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
             <artifactId>maven-failsafe-plugin</artifactId>
             <dependencies>
               <dependency>
                 <groupId>org.junit.platform</groupId>
                 <artifactId>junit-platform-surefire-provider</artifactId>
-                <version>1.2.0</version>
+                <version>1.3.2</version>
               </dependency>
             </dependencies>
             <configuration>
               <includes>
-                <include>qunit/*</include>
+                <include>integration/*</include>
               </includes>
             </configuration>
             <executions>
diff --git a/tobago-example/tobago-example-demo/src/main/docker-tests/assembly.xml b/tobago-example/tobago-example-demo/src/main/docker-tests/assembly.xml
deleted file mode 100644
index e795e1e..0000000
--- a/tobago-example/tobago-example-demo/src/main/docker-tests/assembly.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
-  <id>tobago-example-demo</id>
-  <fileSets>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo-myfaces-2.1.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo-myfaces-2.2.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo-myfaces-2.3.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo-mojarra-2.0.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo-mojarra-2.1.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo-mojarra-2.2.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-    <fileSet>
-      <outputDirectory>webapps</outputDirectory>
-      <includes>
-        <include>tobago-example-demo-mojarra-2.3.war</include>
-      </includes>
-      <directory>target</directory>
-    </fileSet>
-  </fileSets>
-</assembly>
diff --git a/tobago-example/tobago-example-demo/src/main/docker-tests/tomcat/override-web.xml b/tobago-example/tobago-example-demo/src/main/docker-tests/tomcat/override-web.xml
deleted file mode 100644
index 5b69cc5..0000000
--- a/tobago-example/tobago-example-demo/src/main/docker-tests/tomcat/override-web.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-<web-app
-    xmlns="http://java.sun.com/xml/ns/javaee"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
-    version="3.0">
-
-  <display-name>Tobago Demo Application</display-name>
-
-  <!-- for jetty also check src/test/jetty/override-myfaces-web.xml or src/test/jetty/override-mojarra-web.xml -->
-  <context-param>
-    <param-name>javax.faces.PROJECT_STAGE</param-name>
-    <!--<param-value>Development</param-value>-->
-    <param-value>Production</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>com.sun.faces.validateXml</param-name>
-    <param-value>true</param-value>
-  </context-param>
-
-<!-- enable for websockets -->
-  <context-param>
-    <param-name>javax.faces.ENABLE_WEBSOCKET_ENDPOINT</param-name>
-    <param-value>true</param-value>
-  </context-param>
-
-   <!-- disable error handling from myfaces, needed for the demo -->
-  <context-param>
-    <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
-    <param-value>false</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
-    <param-value>true</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
-    <param-value>*.xhtml</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
-    <param-value>true</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
-    <param-value>true</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
-    <param-value>20</param-value>
-  </context-param>
-
-  <context-param>
-    <param-name>org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION</param-name>
-    <param-value>4</param-value>
-  </context-param>
-
-  <listener>
-    <listener-class>org.apache.myfaces.tobago.example.demo.info.ActivitySessionListener</listener-class>
-  </listener>
-
-  <!-- activate this for some containers -->
-  <!--
-  <listener>
-    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-  </listener>
-  -->
-
-  <!-- activate this for some containers -->
-  <listener>
-    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
-  </listener>
-
-  <filter>
-    <filter-name>LoggingMdcFilter</filter-name>
-    <filter-class>org.apache.myfaces.tobago.internal.webapp.LoggingMdcFilter</filter-class>
-  </filter>
-  <filter-mapping>
-    <filter-name>LoggingMdcFilter</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
-
-  <!-- Error handling, see also these classes:
-       org.apache.myfaces.tobago.example.demo.TobagoExceptionHandler
-   -->
-
-  <error-page>
-    <error-code>404</error-code>
-    <location>/error/404.xhtml</location>
-  </error-page>
-
-  <error-page>
-    <error-code>500</error-code>
-    <location>/error/exception.xhtml</location>
-  </error-page>
-
-  <error-page>
-    <exception-type>java.lang.Exception</exception-type>
-    <location>/error/exception.xhtml</location>
-  </error-page>
-
-  <!-- The Usual Welcome File List -->
-  <welcome-file-list>
-    <welcome-file>init.xhtml</welcome-file>
-  </welcome-file-list>
-
-  <session-config>
-    <!-- for WebSphere you need to comment out this block, because WebSphere want to set it himself -->
-    <cookie-config>
-      <http-only>true</http-only>
-      <!-- with secure=true you can only use https, not http -->
-      <!--<secure>true</secure>-->
-    </cookie-config>
-  </session-config>
-
-  <security-constraint>
-    <display-name>Security Constraint</display-name>
-    <web-resource-collection>
-      <web-resource-name>Application Area</web-resource-name>
-      <url-pattern>/content/30-concept/80-security/20-roles/*</url-pattern>
-    </web-resource-collection>
-    <auth-constraint>
-      <role-name>demo-admin</role-name>
-      <role-name>demo-guest</role-name>
-    </auth-constraint>
-  </security-constraint>
-
-  <login-config>
-    <auth-method>FORM</auth-method>
-    <realm-name>demo-realm</realm-name>
-    <form-login-config>
-      <form-login-page>/login.xhtml</form-login-page>
-      <form-error-page>/login.xhtml</form-error-page>
-    </form-login-config>
-  </login-config>
-
-  <security-role>
-    <role-name>demo-admin</role-name>
-  </security-role>
-  <security-role>
-    <role-name>demo-guest</role-name>
-  </security-role>
-
-</web-app>


[myfaces-tobago] 06/11: use custom selenium/standalone-firefox

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit fbfee4970722651fa23079618036e1dc6521e8a4
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Tue Dec 22 16:42:57 2020 +0100

    use custom selenium/standalone-firefox
    
    * use custom firefox image to be able to run on amd64/arm64
    * fix: checkstyle
---
 .../tobago/example/demo/integration/BasicTest.java | 14 +++++-----
 .../example/demo/integration/FrontendBase.java     | 32 ++++++++++++++--------
 .../example/demo/integration/FrontendTest.java     |  6 ++--
 3 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
index 7216c7b..60c72ad 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
@@ -53,7 +53,7 @@ class BasicTest extends FrontendBase {
 
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-  static LocalTime startTime;
+  private static LocalTime startTime;
 
   @BeforeAll
   public static void setup() {
@@ -63,14 +63,14 @@ class BasicTest extends FrontendBase {
   @Test
   void verifyExceptionTest() throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
     final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = tomcat.getFirstMappedPort();
+    final int tomcatPort = getTomcatPort();
     final String path = "error/exception.xhtml";
 
     final String base = path.substring(0, path.length() - 6);
     final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
         + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
-    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
     webDriver.get(url);
 
     List<WebElement> results = getJasmineResults(webDriver);
@@ -87,14 +87,14 @@ class BasicTest extends FrontendBase {
   @Test
   void verify404Test() throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
     final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = tomcat.getFirstMappedPort();
+    final int tomcatPort = getTomcatPort();
     final String path = "error/404.xhtml";
 
     final String base = path.substring(0, path.length() - 6);
     final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
         + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
-    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
     webDriver.get(url);
 
     List<WebElement> results = getJasmineResults(webDriver);
@@ -118,7 +118,7 @@ class BasicTest extends FrontendBase {
 
     final String timeLeft = getTimeLeft(startTime, testSize, testNumber);
     final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = tomcat.getFirstMappedPort();
+    final int tomcatPort = getTomcatPort();
 
     LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ")"
         + " - url: http://" + host + ":" + tomcatPort + "/" + path);
@@ -127,7 +127,7 @@ class BasicTest extends FrontendBase {
     final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
         + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
-    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
     webDriver.get(url);
 
     List<WebElement> results = getJasmineResults(webDriver);
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
index a613c8e..77dacd8 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
@@ -26,7 +26,7 @@ import org.openqa.selenium.By;
 import org.openqa.selenium.NoSuchElementException;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
-import org.openqa.selenium.chrome.ChromeOptions;
+import org.openqa.selenium.firefox.FirefoxOptions;
 import org.openqa.selenium.remote.RemoteWebDriver;
 import org.openqa.selenium.support.ui.FluentWait;
 import org.testcontainers.containers.GenericContainer;
@@ -48,20 +48,22 @@ abstract class FrontendBase {
 
   @SuppressWarnings("rawtypes") // this is how to use testcontainers
   @Container
-  public static GenericContainer seleniumChrome =
-      new GenericContainer<>(DockerImageName.parse("selenium/standalone-chrome")).withExposedPorts(4444);
+  private static final GenericContainer SELENIUM_FIREFOX =
+      new GenericContainer<>(DockerImageName.parse("henningn/selenium-standalone-firefox"))
+          .withExposedPorts(4444);
 
   @SuppressWarnings("rawtypes") // this is how to use testcontainers
   @Container
-  public static GenericContainer tomcat =
-      new GenericContainer(DockerImageName.parse("myfaces/tobago-example-demo")).withExposedPorts(8080);
+  private static final GenericContainer TOMCAT =
+      new GenericContainer(DockerImageName.parse("myfaces/tobago-example-demo"))
+          .withExposedPorts(8080);
 
-  private static WebDriver chromeDriver;
+  private static WebDriver firefoxDriver;
 
   @AfterAll
   static void tearDown() {
-    if (chromeDriver != null) {
-      chromeDriver.quit();
+    if (firefoxDriver != null) {
+      firefoxDriver.quit();
     }
   }
 
@@ -77,10 +79,10 @@ abstract class FrontendBase {
   }
 
   WebDriver getWebDriver(final String host, final Integer port) throws MalformedURLException {
-    if (chromeDriver == null || ((RemoteWebDriver) chromeDriver).getSessionId() == null) {
-      chromeDriver = new RemoteWebDriver(new URL("http://" + host + ":" + port + "/wd/hub"), new ChromeOptions());
+    if (firefoxDriver == null || ((RemoteWebDriver) firefoxDriver).getSessionId() == null) {
+      firefoxDriver = new RemoteWebDriver(new URL("http://" + host + ":" + port + "/wd/hub"), new FirefoxOptions());
     }
-    return chromeDriver;
+    return firefoxDriver;
   }
 
   List<WebElement> getJasmineResults(WebDriver webDriver) {
@@ -116,4 +118,12 @@ abstract class FrontendBase {
       return "---";
     }
   }
+
+  int getFirefoxPort() {
+    return SELENIUM_FIREFOX.getFirstMappedPort();
+  }
+
+  int getTomcatPort() {
+    return TOMCAT.getFirstMappedPort();
+  }
 }
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
index db7d116..96ae25c 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
@@ -46,7 +46,7 @@ class FrontendTest extends FrontendBase {
 
   private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-  static LocalTime startTime;
+  private static LocalTime startTime;
 
   @BeforeAll
   public static void setup() {
@@ -63,7 +63,7 @@ class FrontendTest extends FrontendBase {
 
     final String timeLeft = getTimeLeft(FrontendTest.startTime, testSize, testNumber);
     final String host = InetAddress.getLocalHost().getHostAddress();
-    final int tomcatPort = tomcat.getFirstMappedPort();
+    final int tomcatPort = getTomcatPort();
 
     LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ")"
         + " - url: http://" + host + ":" + tomcatPort + "/" + path);
@@ -71,7 +71,7 @@ class FrontendTest extends FrontendBase {
     final String base = path.substring(0, path.length() - 6);
     final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
 
-    WebDriver webDriver = getWebDriver(host, seleniumChrome.getFirstMappedPort());
+    WebDriver webDriver = getWebDriver(host, getFirefoxPort());
     webDriver.get(url);
 
     List<WebElement> results = getJasmineResults(webDriver);


[myfaces-tobago] 02/11: fix: maven docker profile

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 1fc49e3d07f4e850a7f1addc1250eae068b4bd51
Author: Henning Nöth <hn...@apache.org>
AuthorDate: Tue Dec 15 20:59:20 2020 +0100

    fix: maven docker profile
    
    * tobago version removed from name, is now docker tag
    * added missing dependencies to create a demo.war for tomcat
    * use tomcat:latest
    * demo starts without context path
    * update docker-maven-plugin
---
 tobago-example/tobago-example-demo/pom.xml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index 78adb45..3f0d1dc 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -544,7 +544,7 @@
             <configuration>
               <images>
                 <image>
-                  <name>myfaces/tobago-example-demo:${tobago.version}</name>
+                  <name>myfaces/tobago-example-demo</name>
                   <run>
                     <ports>
                       <port>8080:8080</port>
@@ -552,6 +552,9 @@
                   </run>
                   <build>
                     <from>tomcat</from>
+                    <tags>
+                      <tag>${tobago.version}</tag>
+                    </tags>
                     <assembly>
                       <descriptor>assembly.xml</descriptor>
                       <basedir>/usr/local/tomcat</basedir>


[myfaces-tobago] 07/11: chore: remove deprecated junit-platform-surefire-provider

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 2744a54fce9555d8c2c0b699cf1f213917152264
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Tue Dec 22 16:43:05 2020 +0100

    chore: remove deprecated junit-platform-surefire-provider
    
    * junit-platform-surefire-provider is deprecated and removed; use maven-surefire-plugin native support instead
    * update maven-surefire-plugin and maven-failsafe-plugin
---
 pom.xml                                    | 4 ++--
 tobago-example/tobago-example-demo/pom.xml | 7 -------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index 79f749f..d2b6728 100644
--- a/pom.xml
+++ b/pom.xml
@@ -854,7 +854,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.22.1</version>
+          <version>2.22.2</version>
           <configuration>
             <argLine>-Duser.language=en -Duser.region=US</argLine>
             <!--
@@ -870,7 +870,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-failsafe-plugin</artifactId>
-          <version>2.22.1</version>
+          <version>2.22.2</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index aaa95eb..39cd2d4 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -274,13 +274,6 @@
         <plugins>
           <plugin>
             <artifactId>maven-failsafe-plugin</artifactId>
-            <dependencies>
-              <dependency>
-                <groupId>org.junit.platform</groupId>
-                <artifactId>junit-platform-surefire-provider</artifactId>
-                <version>1.3.2</version>
-              </dependency>
-            </dependencies>
             <configuration>
               <includes>
                 <include>integration/*</include>


[myfaces-tobago] 01/11: fix: maven docker profile

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit af371ecdd072a2c715aa8fa99653d6cc0f530f4e
Author: Henning Nöth <hn...@apache.org>
AuthorDate: Tue Dec 15 19:56:52 2020 +0100

    fix: maven docker profile
    
    * added missing dependencies to create a demo.war for tomcat
    * use tomcat:latest
    * demo starts without context path
    * update docker-maven-plugin
---
 tobago-example/tobago-example-demo/pom.xml         | 77 +++++++++++++++++++++-
 .../src/main/docker/assembly.xml                   |  2 +-
 2 files changed, 76 insertions(+), 3 deletions(-)

diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index 63cdced..78adb45 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -540,7 +540,7 @@
           <plugin>
             <groupId>io.fabric8</groupId>
             <artifactId>docker-maven-plugin</artifactId>
-            <version>0.22.1</version>
+            <version>0.34.1</version>
             <configuration>
               <images>
                 <image>
@@ -551,7 +551,7 @@
                     </ports>
                   </run>
                   <build>
-                    <from>tomcat:8.5.15-jre8</from>
+                    <from>tomcat</from>
                     <assembly>
                       <descriptor>assembly.xml</descriptor>
                       <basedir>/usr/local/tomcat</basedir>
@@ -563,9 +563,82 @@
                 </image>
               </images>
             </configuration>
+            <executions>
+              <execution>
+                <id>build</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>build</goal>
+                </goals>
+              </execution>
+            </executions>
           </plugin>
         </plugins>
       </build>
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.myfaces.core</groupId>
+          <artifactId>myfaces-api</artifactId>
+          <version>${myfaces23.version}</version>
+          <scope>compile</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.myfaces.core</groupId>
+          <artifactId>myfaces-impl</artifactId>
+          <version>${myfaces23.version}</version>
+          <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.slf4j</groupId>
+          <artifactId>jcl-over-slf4j</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.openwebbeans</groupId>
+          <artifactId>openwebbeans-jsf</artifactId>
+          <version>${openwebbeans.version}</version>
+          <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.openwebbeans</groupId>
+          <artifactId>openwebbeans-web</artifactId>
+          <version>${openwebbeans.version}</version>
+          <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.openwebbeans</groupId>
+          <artifactId>openwebbeans-resource</artifactId>
+          <version>${openwebbeans.version}</version>
+          <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.apache.myfaces.tobago</groupId>
+          <artifactId>tobago-config-owb</artifactId>
+          <version>${tobago.version}</version>
+          <scope>runtime</scope>
+        </dependency>
+        <dependency>
+          <groupId>jakarta.inject</groupId>
+          <artifactId>jakarta.inject-api</artifactId>
+          <version>1.0.1</version>
+          <scope>compile</scope>
+        </dependency>
+        <dependency>
+          <groupId>jakarta.enterprise</groupId>
+          <artifactId>jakarta.enterprise.cdi-api</artifactId>
+          <scope>compile</scope>
+        </dependency>
+        <!-- this enables the development mode -->
+        <dependency>
+          <groupId>org.apache.myfaces.tobago</groupId>
+          <artifactId>tobago-config-dev</artifactId>
+          <version>${tobago.version}</version>
+        </dependency>
+        <dependency> <!-- add JAXB to run the demo with Java 11 and higher -->
+          <groupId>javax.xml.bind</groupId>
+          <artifactId>jaxb-api</artifactId>
+          <version>2.3.1</version>
+        </dependency>
+      </dependencies>
     </profile>
 
     <profile>
diff --git a/tobago-example/tobago-example-demo/src/main/docker/assembly.xml b/tobago-example/tobago-example-demo/src/main/docker/assembly.xml
index 622e57e..98cff35 100644
--- a/tobago-example/tobago-example-demo/src/main/docker/assembly.xml
+++ b/tobago-example/tobago-example-demo/src/main/docker/assembly.xml
@@ -30,7 +30,7 @@
       <!--<useProjectArtifact>true</useProjectArtifact>-->
       <useTransitiveDependencies>false</useTransitiveDependencies>
       <outputDirectory>webapps</outputDirectory>
-      <outputFileNameMapping>tobago-example-demo.war</outputFileNameMapping>
+      <outputFileNameMapping>ROOT.war</outputFileNameMapping>
     </dependencySet>
   </dependencySets>
 


[myfaces-tobago] 08/11: better logging for test results

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit a4cba74acf621b6dfe95772e3bce3118accff818
Author: Henning Nöth <hn...@apache.org>
AuthorDate: Thu Dec 24 00:03:22 2020 +0100

    better logging for test results
---
 .../tobago/example/demo/integration/BasicTest.java | 16 +++++-----
 .../example/demo/integration/FrontendBase.java     | 37 +++++++++++++++++++---
 .../example/demo/integration/FrontendTest.java     | 12 +++----
 3 files changed, 46 insertions(+), 19 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
index 60c72ad..19ae800 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
@@ -73,7 +73,7 @@ class BasicTest extends FrontendBase {
     WebDriver webDriver = getWebDriver(host, getFirefoxPort());
     webDriver.get(url);
 
-    List<WebElement> results = getJasmineResults(webDriver);
+    List<WebElement> results = getJasmineResults(webDriver, url);
     Assertions.assertTrue(results.size() > 0, "no results detected");
     for (WebElement result : results) {
       if ("has no exception".equals(result.getAttribute("title"))) {
@@ -97,7 +97,7 @@ class BasicTest extends FrontendBase {
     WebDriver webDriver = getWebDriver(host, getFirefoxPort());
     webDriver.get(url);
 
-    List<WebElement> results = getJasmineResults(webDriver);
+    List<WebElement> results = getJasmineResults(webDriver, url);
     Assertions.assertTrue(results.size() > 0, "no results detected");
     for (WebElement result : results) {
       if ("has no 404".equals(result.getAttribute("title"))) {
@@ -119,19 +119,19 @@ class BasicTest extends FrontendBase {
     final String timeLeft = getTimeLeft(startTime, testSize, testNumber);
     final String host = InetAddress.getLocalHost().getHostAddress();
     final int tomcatPort = getTomcatPort();
+    final String pageUrl = "http://" + host + ":" + tomcatPort + "/" + path;
 
-    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ")"
-        + " - url: http://" + host + ":" + tomcatPort + "/" + path);
+    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - url: " + pageUrl);
 
     final String base = path.substring(0, path.length() - 6);
-    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
+    final String testUrl = "http://" + host + ":" + tomcatPort + "/test.xhtml?base="
         + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
     WebDriver webDriver = getWebDriver(host, getFirefoxPort());
-    webDriver.get(url);
+    webDriver.get(testUrl);
 
-    List<WebElement> results = getJasmineResults(webDriver);
-    parseJasmineResults(results);
+    List<WebElement> results = getJasmineResults(webDriver, pageUrl);
+    parseJasmineResults(results, pageUrl);
   }
 
   private static Stream<Arguments> basicTestProvider() throws IOException {
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
index 77dacd8..999bdd9 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
@@ -24,16 +24,20 @@ import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.Assertions;
 import org.openqa.selenium.By;
 import org.openqa.selenium.NoSuchElementException;
+import org.openqa.selenium.TimeoutException;
 import org.openqa.selenium.WebDriver;
 import org.openqa.selenium.WebElement;
 import org.openqa.selenium.firefox.FirefoxOptions;
 import org.openqa.selenium.remote.RemoteWebDriver;
 import org.openqa.selenium.support.ui.FluentWait;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testcontainers.containers.GenericContainer;
 import org.testcontainers.junit.jupiter.Container;
 import org.testcontainers.utility.DockerImageName;
 
 import java.io.IOException;
+import java.lang.invoke.MethodHandles;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.file.Files;
@@ -46,6 +50,8 @@ import java.util.stream.Collectors;
 
 abstract class FrontendBase {
 
+  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
   @SuppressWarnings("rawtypes") // this is how to use testcontainers
   @Container
   private static final GenericContainer SELENIUM_FIREFOX =
@@ -85,20 +91,41 @@ abstract class FrontendBase {
     return firefoxDriver;
   }
 
-  List<WebElement> getJasmineResults(WebDriver webDriver) {
+  List<WebElement> getJasmineResults(WebDriver webDriver, String url) {
     final FluentWait<WebDriver> fluentWait = new FluentWait<>(webDriver)
         .withTimeout(Duration.ofSeconds(60))
         .pollingEvery(Duration.ofSeconds(1))
         .ignoring(NoSuchElementException.class);
-    fluentWait.until(driver -> driver.findElement(By.className("jasmine-overall-result")));
+    try {
+      fluentWait.until(driver -> driver.findElement(By.className("jasmine-overall-result")));
+    } catch (TimeoutException e) {
+      Assertions.fail(url + " timeout");
+    }
 
     return webDriver.findElements(By.cssSelector(".jasmine-symbol-summary li"));
   }
 
-  void parseJasmineResults(List<WebElement> results) {
-    Assertions.assertTrue(results.size() > 0, "no results detected");
+  void parseJasmineResults(List<WebElement> results, String url) {
+    Assertions.assertTrue(results.size() > 0, url + " no results detected");
+
+    StringBuilder stringBuilder = new StringBuilder();
+    stringBuilder.append("\n");
+    stringBuilder.append(url);
+    for (WebElement result : results) {
+      stringBuilder.append("\n");
+      if ("jasmine-passed".equals(result.getAttribute("class"))) {
+        stringBuilder.append("✅ passed");
+      } else {
+        stringBuilder.append("❌ failed");
+      }
+      stringBuilder.append(": ");
+      stringBuilder.append(result.getAttribute("title"));
+    }
+    LOG.info(stringBuilder.toString());
+
     for (WebElement result : results) {
-      Assertions.assertEquals("jasmine-passed", result.getAttribute("class"), result.getAttribute("title"));
+      Assertions.assertEquals("jasmine-passed", result.getAttribute("class"),
+          url + " " + result.getAttribute("title"));
     }
   }
 
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
index 96ae25c..e314b32 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
@@ -64,18 +64,18 @@ class FrontendTest extends FrontendBase {
     final String timeLeft = getTimeLeft(FrontendTest.startTime, testSize, testNumber);
     final String host = InetAddress.getLocalHost().getHostAddress();
     final int tomcatPort = getTomcatPort();
+    final String pageUrl = "http://" + host + ":" + tomcatPort + "/" + path;
 
-    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ")"
-        + " - url: http://" + host + ":" + tomcatPort + "/" + path);
+    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - url: " + pageUrl);
 
     final String base = path.substring(0, path.length() - 6);
-    final String url = "http://" + host + ":" + tomcatPort + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
+    final String testUrl = "http://" + host + ":" + tomcatPort + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
 
     WebDriver webDriver = getWebDriver(host, getFirefoxPort());
-    webDriver.get(url);
+    webDriver.get(testUrl);
 
-    List<WebElement> results = getJasmineResults(webDriver);
-    parseJasmineResults(results);
+    List<WebElement> results = getJasmineResults(webDriver, pageUrl);
+    parseJasmineResults(results, pageUrl);
   }
 
   private static Stream<Arguments> standardTestProvider() throws IOException {


[myfaces-tobago] 10/11: integration-tests: only show path in log (instead of url)

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bommel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 74447568c2f1fbcac7e9de3283a308659474ed38
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Sun Jan 10 13:36:00 2021 +0100

    integration-tests: only show path in log (instead of url)
---
 .../tobago/example/demo/integration/BasicTest.java | 25 ++++++++++------------
 .../example/demo/integration/FrontendBase.java     | 12 +++++------
 .../example/demo/integration/FrontendTest.java     | 12 +++++------
 3 files changed, 22 insertions(+), 27 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
index 7c0999f..25e6c8a 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/BasicTest.java
@@ -35,7 +35,6 @@ import org.testcontainers.junit.jupiter.Testcontainers;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.lang.invoke.MethodHandles;
-import java.net.InetAddress;
 import java.net.MalformedURLException;
 import java.net.URLEncoder;
 import java.net.UnknownHostException;
@@ -65,12 +64,12 @@ class BasicTest extends FrontendBase {
     final String path = "error/exception.xhtml";
 
     final String base = path.substring(0, path.length() - 6);
-    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+    final String url = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
     WebDriver webDriver = getWebDriver();
-    webDriver.get(testUrl);
+    webDriver.get(url);
 
-    List<WebElement> results = getJasmineResults(webDriver, testUrl);
+    List<WebElement> results = getJasmineResults(webDriver, path);
     Assertions.assertTrue(results.size() > 0, "no results detected");
     for (WebElement result : results) {
       if ("has no exception".equals(result.getAttribute("title"))) {
@@ -86,12 +85,12 @@ class BasicTest extends FrontendBase {
     final String path = "error/404.xhtml";
 
     final String base = path.substring(0, path.length() - 6);
-    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+    final String url = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
     WebDriver webDriver = getWebDriver();
-    webDriver.get(testUrl);
+    webDriver.get(url);
 
-    List<WebElement> results = getJasmineResults(webDriver, testUrl);
+    List<WebElement> results = getJasmineResults(webDriver, path);
     Assertions.assertTrue(results.size() > 0, "no results detected");
     for (WebElement result : results) {
       if ("has no 404".equals(result.getAttribute("title"))) {
@@ -111,18 +110,16 @@ class BasicTest extends FrontendBase {
       throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
 
     final String timeLeft = getTimeLeft(startTime, testSize, testNumber);
-    final String pageUrl = getTomcatUrl() + "/" + path;
-
-    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - url: " + pageUrl);
+    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - path: " + path);
 
     final String base = path.substring(0, path.length() - 6);
-    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
+    final String url = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8") + "&basicTest=true";
 
     WebDriver webDriver = getWebDriver();
-    webDriver.get(testUrl);
+    webDriver.get(url);
 
-    List<WebElement> results = getJasmineResults(webDriver, pageUrl);
-    parseJasmineResults(results, pageUrl);
+    List<WebElement> results = getJasmineResults(webDriver, path);
+    parseJasmineResults(results, path);
   }
 
   private static Stream<Arguments> basicTestProvider() throws IOException {
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
index f9d6744..696666b 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendBase.java
@@ -106,7 +106,7 @@ abstract class FrontendBase {
     return firefoxDriver;
   }
 
-  List<WebElement> getJasmineResults(WebDriver webDriver, String url) {
+  List<WebElement> getJasmineResults(WebDriver webDriver, String path) {
     final FluentWait<WebDriver> fluentWait = new FluentWait<>(webDriver)
         .withTimeout(Duration.ofSeconds(60))
         .pollingEvery(Duration.ofSeconds(1))
@@ -114,18 +114,18 @@ abstract class FrontendBase {
     try {
       fluentWait.until(driver -> driver.findElement(By.className("jasmine-overall-result")));
     } catch (TimeoutException e) {
-      Assertions.fail(url + " timeout");
+      Assertions.fail(path + " timeout");
     }
 
     return webDriver.findElements(By.cssSelector(".jasmine-symbol-summary li"));
   }
 
-  void parseJasmineResults(List<WebElement> results, String url) {
-    Assertions.assertTrue(results.size() > 0, url + " no results detected");
+  void parseJasmineResults(List<WebElement> results, String path) {
+    Assertions.assertTrue(results.size() > 0, path + " no results detected");
 
     StringBuilder stringBuilder = new StringBuilder();
     stringBuilder.append("\n");
-    stringBuilder.append(url);
+    stringBuilder.append(path);
     for (WebElement result : results) {
       stringBuilder.append("\n");
       if ("jasmine-passed".equals(result.getAttribute("class"))) {
@@ -140,7 +140,7 @@ abstract class FrontendBase {
 
     for (WebElement result : results) {
       Assertions.assertEquals("jasmine-passed", result.getAttribute("class"),
-          url + " " + result.getAttribute("title"));
+          path + " " + result.getAttribute("title"));
     }
   }
 
diff --git a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
index 37a41cb..853b06e 100644
--- a/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
+++ b/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/integration/FrontendTest.java
@@ -61,18 +61,16 @@ class FrontendTest extends FrontendBase {
       throws MalformedURLException, UnknownHostException, UnsupportedEncodingException {
 
     final String timeLeft = getTimeLeft(FrontendTest.startTime, testSize, testNumber);
-    final String pageUrl = getTomcatUrl() + "/" + path;
-
-    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - url: " + pageUrl);
+    LOG.info("(" + testNumber + "/" + testSize + " | time left: " + timeLeft + ") - path: " + path);
 
     final String base = path.substring(0, path.length() - 6);
-    final String testUrl = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
+    final String url = getTomcatUrl() + "/test.xhtml?base=" + URLEncoder.encode(base, "UTF-8");
 
     WebDriver webDriver = getWebDriver();
-    webDriver.get(testUrl);
+    webDriver.get(url);
 
-    List<WebElement> results = getJasmineResults(webDriver, pageUrl);
-    parseJasmineResults(results, pageUrl);
+    List<WebElement> results = getJasmineResults(webDriver, path);
+    parseJasmineResults(results, path);
   }
 
   private static Stream<Arguments> standardTestProvider() throws IOException {