]> source.dussan.org Git - archiva.git/commitdiff
Adding Null checks for selenium
authorMartin Stockhammer <martin_s@apache.org>
Fri, 30 Mar 2018 15:32:16 +0000 (17:32 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Fri, 30 Mar 2018 15:32:16 +0000 (17:32 +0200)
archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/parent/AbstractSeleniumTest.java
archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/tools/ArchivaSeleniumExecutionRule.java

index 082c4b3731b5b9b11402f11324889b52e55007ea..48a1361c04db38e64c5eae09535d58db8559563f 100644 (file)
@@ -88,16 +88,20 @@ public abstract class AbstractSeleniumTest
 
         baseUrl = WebdriverUtility.getBaseUrl()+"/index.html?request_lang=en";
         open( baseUrl, browser, seleniumHost, seleniumPort, maxWaitTimeInMs, remoteSelenium );
+        Assert.assertNotNull( getWebDriver() );
         getWebDriver().manage().window().maximize();
         assertAdminCreated();
     }
 
     /**
-     * this method is called by the Rule after executing a tests
+     * this method is called by the Rule after executing a test
      */
     public void close()
     {
-        getWebDriver().close();
+        if (getWebDriver()!=null)
+        {
+            getWebDriver( ).close( );
+        }
     }
 
     /**
index f8c107f510669e1e39198852f6daddd082e505f4..b44b918ba87b6ced31bd374e09bce71f5a0ce687 100644 (file)
@@ -52,7 +52,7 @@ public class ArchivaSeleniumExecutionRule
             String fileName =
                 ( (AbstractSeleniumTest) target ).captureScreenShotOnFailure( e, method.getMethod().getName(),
                                                                               target.getClass().getName() );
-            
+            log.info("Screenshot: "+fileName);
             throw new RuntimeException( e.getMessage() + " see screenShot file:" + fileName, e );
         }
         finally