myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hno...@apache.org
Subject [myfaces-tobago] branch master updated: improve docker-qunit-tests: try to display information after timeout
Date Fri, 15 Jun 2018 17:31:54 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 593de36  improve docker-qunit-tests: try to display information after timeout
593de36 is described below

commit 593de36b171105229f09ef849359c5ff9193655c
Author: Henning Noeth <hnoeth@apache.org>
AuthorDate: Fri Jun 15 16:24:57 2018 +0200

    improve docker-qunit-tests: try to display information after timeout
---
 .../myfaces/tobago/example/demo/qunit/SeleniumBase.java      | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

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
index 98ac78b..621021b 100644
--- 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
@@ -65,7 +65,7 @@ abstract class SeleniumBase {
   }
 
   void setupBrowser(final Browser browser) throws MalformedURLException {
-    MutableCapabilities options = null;
+    MutableCapabilities options;
     switch (browser) {
       case chrome:
         options = new ChromeOptions();
@@ -111,14 +111,20 @@ abstract class SeleniumBase {
 
   void parseQUnitResults(final Browser browser, final String portContextPath, final String
path)
       throws UnknownHostException {
-    WebElement qunitBanner = waitForQUnitBanner();
+    WebElement qunitBanner;
+    try {
+      qunitBanner = waitForQUnitBanner();
+    } 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"));
     Assert.assertTrue("There must be at least one test case.", testCases.size() > 0);
 
-    final boolean testFailed = qunitBanner.getAttribute("class").equals("qunit-fail");
+    final boolean testFailed = !qunitBanner.getAttribute("class").equals("qunit-pass");
 
     int testCaseCount = 1;
     final StringBuilder stringBuilder = new StringBuilder();

-- 
To stop receiving notification emails like this one, please contact
hnoeth@apache.org.

Mime
View raw message