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

zhouquan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new b9be430  Submarine-334. Update the E2E test framework for workbench-ng
b9be430 is described below

commit b9be4309ee0439b24d9a54b11b99ffe2ef777d2a
Author: Xun Liu <[email protected]>
AuthorDate: Thu Jan 9 16:46:11 2020 +0800

    Submarine-334. Update the E2E test framework for workbench-ng
    
    ### What is this PR for?
    Update the E2E test framework due to the new version of Workbench
    
    ### What type of PR is it?
    Improvement
    
    ### Todos
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/SUBMARINE-334
    
    ### How should this be tested?
    
https://github.com/apache/submarine/blob/master/docs/development/IntegrationTest.md
    
    ### Screenshots (if appropriate)
    
https://travis-ci.org/apache/submarine/builds/633152160?utm_source=github_status&utm_medium=notification
    
    ![ζˆͺεœ– 2020-01-06 δΈ‹εˆ2 32 
26](https://user-images.githubusercontent.com/20109646/71799866-66b8ce00-3091-11ea-9ec3-1a6f1986dee2.png)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? Yes
    
    Author: Xun Liu <[email protected]>
    
    Closes #144 from kevin85421/SUBMARINE-334 and squashes the following 
commits:
    
    371e42f [Xun Liu] SUBMARINE-334. Update the E2E test framework due to the 
new version of Workbench
---
 docs/development/IntegrationTest.md                | 13 ++++++---
 .../org/apache/submarine/WebDriverManager.java     | 18 +++++++------
 .../apache/submarine/integration/HelloWorldIT.java | 31 ----------------------
 .../org/apache/submarine/integration/loginIT.java  |  8 +++---
 4 files changed, 24 insertions(+), 46 deletions(-)

diff --git a/docs/development/IntegrationTest.md 
b/docs/development/IntegrationTest.md
index e49df0a..0269333 100644
--- a/docs/development/IntegrationTest.md
+++ b/docs/development/IntegrationTest.md
@@ -25,14 +25,21 @@ cd submarine/submarine-test/e2e
 
 **If your workbench server is not working on port 32777 
([mini-submarine](https://github.com/apache/submarine/tree/master/dev-support/mini-submarine)
 maps the workbench port 8000 to 32777), please first modify the port in 
WebDriverManager.java line 61  to the port where your workbench run.** 
 
-For linux
+*   Execute the following command in your host machine to get the port   
 ```
-mvn verify
+docker inspect --format='{{(index (index .NetworkSettings.Ports "8080/tcp") 
0).HostPort}}' mini-submarine
 ```
-For MacOS
+
+*   For linux
+ ```
+ mvn verify
+ ```
+
+*   For MacOS
 ```
 mvn clean install -U
 ```
+
 ##### Result
 If all of the function under test are succeeded, it will show.
 ```
diff --git 
a/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java 
b/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java
index 4db04d7..1c9e474 100644
--- 
a/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java
+++ 
b/submarine-test/e2e/src/test/java/org/apache/submarine/WebDriverManager.java
@@ -37,14 +37,14 @@ public class WebDriverManager {
     public static WebDriver getWebDriver() {
         WebDriver driver = null;
         // firefox webdriver
-        if(driver == null) { 
+        if(driver == null) {
             try {
                 // download GeckoDriver
                 downLoadsDir = System.getProperty("user.dir");
                 String tempPath = downLoadsDir + "/Driver/";
                 downloadGeckoDriver(tempPath);
                 if(SystemUtils.IS_OS_MAC_OSX) {
-                    String command = "chmod +x " + tempPath + "geckodriver"; 
+                    String command = "chmod +x " + tempPath + "geckodriver";
                     cmdExec.executeCommandLocalHost(command);
                 }
                 System.setProperty("webdriver.gecko.driver", tempPath + 
"geckodriver");
@@ -62,7 +62,8 @@ public class WebDriverManager {
         driver.get(url);
         return driver;
     }
-    // TODO(Kai-Hsun Chen): need to set the path of geckodriver 
+    
+    // TODO(Kai-Hsun Chen): need to set the path of geckodriver
     public static void downloadGeckoDriver(String tempPath) {
         String geckoDriverUrlString = 
"https://github.com/mozilla/geckodriver/releases/download/v"; + 
GECKODRIVER_VERSION + "/geckodriver-v" + GECKODRIVER_VERSION + "-";
         LOG.info("Gecko version: v" + GECKODRIVER_VERSION + ", will be 
downloaded to " + tempPath);
@@ -82,7 +83,7 @@ public class WebDriverManager {
             } else if (SystemUtils.IS_OS_MAC_OSX) {
                 geckoDriverUrlString += "macos.tar.gz";
             }
-            
+
             File geckoDriver = new File(tempPath + "geckodriver");
             File geckoDriverZip = new File(tempPath + "geckodriver.tar");
             File geckoDriverDir = new File(tempPath);
@@ -104,9 +105,10 @@ public class WebDriverManager {
             LOG.info("[FAIL] Download of Gecko version: v" + 
GECKODRIVER_VERSION + ", falied in path " + tempPath);
             return;
         }
-        LOG.info("[SUCCESS] Download of Gecko version: " + 
GECKODRIVER_VERSION); 
+        LOG.info("[SUCCESS] Download of Gecko version: " + 
GECKODRIVER_VERSION);
     }
-    // TODO(Kai-Hsun Chen): need to be tested on Windows, MacOS, and Linux
+
+    // TODO(Kai-Hsun Chen): need to be tested on MacOS, and Linux
     public static String getFirefoxVersion() {
         String firefoxVersionCmd = "firefox -v";
         String version = "";
@@ -114,10 +116,10 @@ public class WebDriverManager {
             firefoxVersionCmd = "/Applications/Firefox.app/Contents/MacOS/" + 
firefoxVersionCmd;
         }
         try {
-            version = 
cmdExec.executeCommandLocalHost(firefoxVersionCmd).toString(); 
+            version = 
cmdExec.executeCommandLocalHost(firefoxVersionCmd).toString();
         } catch (Exception e) {
             LOG.info("Exception in WebDriverManager while getFirefoxVersion");
         }
-        return version;            
+        return version;
     }
 }
diff --git 
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/HelloWorldIT.java
 
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/HelloWorldIT.java
deleted file mode 100644
index fa5ba13..0000000
--- 
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/HelloWorldIT.java
+++ /dev/null
@@ -1,31 +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.submarine.integration;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.annotations.Test;
-public class HelloWorldIT {
-    @Test
-    public void testThis() {
-        Logger LOG = LoggerFactory.getLogger(this.getClass());
-        LOG.info("IT Hello! World!");
-    }
-}
diff --git 
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
 
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
index d173455..6f09cd9 100644
--- 
a/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
+++ 
b/submarine-test/e2e/src/test/java/org/apache/submarine/integration/loginIT.java
@@ -35,9 +35,9 @@ public class loginIT extends AbstractSubmarineIT{
 
   @Test
   public void loginUser() throws Exception {
-    pollingWait(By.cssSelector("input[id='username']"), 
MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin");
-    pollingWait(By.cssSelector("input[id='password']"), 
MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin");
-    pollingWait(By.cssSelector("button[class='login-button ant-btn 
ant-btn-primary ant-btn-lg']"), MAX_BROWSER_TIMEOUT_SEC).click();
+    pollingWait(By.cssSelector("input[ng-reflect-name='userName']"), 
MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin");
+    pollingWait(By.cssSelector("input[ng-reflect-name='password']"), 
MAX_BROWSER_TIMEOUT_SEC).sendKeys("admin");
+    pollingWait(By.cssSelector("button[class='login-form-button ant-btn 
ant-btn-primary']"), MAX_BROWSER_TIMEOUT_SEC).click();
     sleep(1000,false);
   }
-} 
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to