Browse Source

docker and testcase config for e2e test (#2028)

* github action for e2e test

* github action for e2e test

* github action for e2e test

* chromedriver

* e2e

* driver option

* t

* args bug

* check

* restore docker
pull/2/head
khadgarmage 5 years ago committed by GitHub
parent
commit
ee3c0aedc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      .github/workflows/ci_e2e.yml
  2. 2
      .github/workflows/ci_ut.yml
  3. 2
      e2e/pom.xml
  4. 13
      e2e/src/test/java/org/apache/dolphinscheduler/base/BaseDriver.java
  5. 2
      e2e/src/test/java/org/apache/dolphinscheduler/data/LoginData.java
  6. 2
      e2e/src/test/java/org/apache/dolphinscheduler/data/security/TenantManageData.java
  7. 6
      e2e/src/test/resources/config/config.properties
  8. 6
      e2e/testng.xml

12
.github/workflows/ci_e2e.yml

@ -48,8 +48,18 @@ jobs:
docker run -dit -e POSTGRESQL_USERNAME=test -e POSTGRESQL_PASSWORD=test -p 8888:8888 dolphinscheduler:$VERSION all
- name: Check Server Status
run: sh ./dockerfile/hooks/check
- name: Prepare e2e env
run: |
sudo apt-get install -y libxss1 libappindicator1 libindicator7 xvfb unzip
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
sudo apt-get install -f -y
wget -N https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
- name: Run e2e Test
run: echo "Run e2e Test"
run: cd ./e2e && mvn -B clean test
- name: Collect logs
run: |
mkdir -p ${LOG_DIR}

2
.github/workflows/ci_ut.yml

@ -20,7 +20,7 @@ env:
DOCKER_DIR: ./docker
LOG_DIR: /tmp/dolphinscheduler
name: Test Coveralls Parallel
name: Unit Test
jobs:

2
e2e/pom.xml

@ -64,7 +64,7 @@
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.jedis</artifactId>
<version>2.6.0_2-SNAPSHOT</version>
<version>2.6.2_1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>

13
e2e/src/test/java/org/apache/dolphinscheduler/base/BaseDriver.java

@ -22,8 +22,10 @@ import org.apache.dolphinscheduler.util.PropertiesReader;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.PageLoadStrategy;
/**
* base driver class
@ -81,7 +83,16 @@ public class BaseDriver {
public void startBrowser() throws Exception {
// set chrome driver
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
driver = new ChromeDriver();
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setPageLoadStrategy(PageLoadStrategy.NONE);
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--disable-gpu");
chromeOptions.addArguments("--whitelisted-ips");
chromeOptions.addArguments("--disable-infobars");
chromeOptions.addArguments("--disable-browser-side-navigation");
driver = new ChromeDriver(chromeOptions);
/* driver setting wait time */
// implicitly wait time

2
e2e/src/test/java/org/apache/dolphinscheduler/data/LoginData.java

@ -39,5 +39,5 @@ public class LoginData {
*/
public static final String PASSWORD = PropertiesReader.getKey("PASSWORD");
public static final String TENANT = "租户管理 - DolphinScheduler";
public static final String TENANT = "Tenant Manage - DolphinScheduler";
}

2
e2e/src/test/java/org/apache/dolphinscheduler/data/security/TenantManageData.java

@ -48,7 +48,7 @@ public class TenantManageData {
*/
public static final String DESCRIPTION = "creat tenant test";
public static final String TENANAT_MANAGE = "租户管理 - DolphinScheduler";
public static final String TENANAT_MANAGE = "Tenant Manage - DolphinScheduler";

6
e2e/src/test/resources/config/config.properties

@ -17,15 +17,15 @@
############### project ##############
# login url
LOGIN_URL=http://ark1:12345/dolphinscheduler
LOGIN_URL=http://127.0.0.1:8888/dolphinscheduler/
#login username
USER_NAME=admin
#login password
PASSWORD=123456
PASSWORD=dolphinscheduler123
############### web driver ##############
# driver path
driver.chromeDriver=/Users/chenxingchun/Documents/easyscheduler/selenium/chromeDriver
driver.chromeDriver=/usr/local/bin/chromedriver
# implicitly wait(s)
driver.timeouts.implicitlyWait=10
# show wait(s)

6
e2e/testng.xml

@ -6,9 +6,9 @@
<!--&lt;!&ndash;<package name="org.apache.dolphinscheduler.testcase.security.TenantManageTest"/>&ndash;&gt;-->
<!--<package name="org.apache.dolphinscheduler.testcase.security.*"/>-->
<!--</packages>-->
<!--<classes>-->
<!--<class name="org.apache.dolphinscheduler.testcase.security.UserManageTest"></class>-->
<!--</classes>-->
<classes>
<class name="org.apache.dolphinscheduler.testcase.security.TenantManageTest"></class>
</classes>
</test>
<!--<suite-files>-->

Loading…
Cancel
Save