Browse Source

[Test-2995][e2e] run workflow and timing testCase (#3201)

* add LoginTest license

* Delete useless packages

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* e2e add project and workflow case

* Update worker_group_id to worker_group in init.sql

* Update worker_group_id to worker_group in init.sql

* Update worker_group_id to worker_group

* Increase dataX environment variable, sslTrust default value

* modify dataX environment variable

* update e2e chrome version

* add alert manage testcase and Optimize test case execution order

* add e2e to create and to  edit  queue

* update e2e chrome version

* add e2e token testcase

* add e2e token testcase

* add e2e to run workflow testcase

* add e2e timing testcase

* add e2e timing testcase

* add e2e timing testcase

* add e2e timing testcase

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* Merge remote-tracking branch 'upstream/dev' into dev

# Conflicts:
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
#	e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

* edit user

* edit user

* edit user

* edit user

* edit user

* Update TimingLocator.java

* modify ci log

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

modify artifact version

* Update ci_e2e.yml

* Update ci_e2e.yml

modify /var/lib/docker/volumes  permissions

* Update ci_e2e.yml

modify ci logs

* Update ci_e2e.yml

Modify log file permissions

* Update ci_e2e.yml

modify logs

* Update ci_e2e.yml

modify logs

* Update ci_e2e.yml

modify logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* Update ci_e2e.yml

modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* Update ci_e2e.yml

modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify ci logs

* modify tenant

* modify alert wait time

* modify queue wait time

* modify alert wait time

* modify alert wait time

* modify alert wait time

* modify alert wait time

* modify alert wait time

* modify alert wait time

* modify button xpath

* modify queue xpath

* Ignore edit user

* modify alert wait time

* print delete user log

* modify the xpath of delete user button

* modify timing wait time

Co-authored-by: chenxingchun <438044805@qq.com>
Co-authored-by: dailidong <dailidong66@gmail.com>
pull/3/MERGE
xingchun-chen 4 years ago committed by GitHub
parent
commit
e97b4707a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/ci_e2e.yml
  2. 13
      docker/docker-swarm/docker-compose.yml
  3. 17
      e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java
  4. 32
      e2e/src/test/java/org/apache/dolphinscheduler/data/project/RunWorkflowData.java
  5. 35
      e2e/src/test/java/org/apache/dolphinscheduler/data/project/TimingData.java
  6. 10
      e2e/src/test/java/org/apache/dolphinscheduler/data/security/UserManageData.java
  7. 18
      e2e/src/test/java/org/apache/dolphinscheduler/locator/project/CreateWorkflowLocator.java
  8. 48
      e2e/src/test/java/org/apache/dolphinscheduler/locator/project/RunWorkflowLocator.java
  9. 61
      e2e/src/test/java/org/apache/dolphinscheduler/locator/project/TimingLocator.java
  10. 2
      e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java
  11. 22
      e2e/src/test/java/org/apache/dolphinscheduler/locator/security/UserManageLocator.java
  12. 1
      e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateProjectPage.java
  13. 29
      e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateWorkflowPage.java
  14. 53
      e2e/src/test/java/org/apache/dolphinscheduler/page/project/RunWorkflowPage.java
  15. 134
      e2e/src/test/java/org/apache/dolphinscheduler/page/project/TimingPage.java
  16. 8
      e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
  17. 8
      e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java
  18. 79
      e2e/src/test/java/org/apache/dolphinscheduler/page/security/UserManagePage.java
  19. 11
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java
  20. 4
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java
  21. 41
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestRunWorkflow.java
  22. 75
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestTiming.java
  23. 18
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java
  24. 19
      e2e/testng.xml

4
.github/workflows/ci_e2e.yml

@ -66,9 +66,9 @@ jobs:
run: cd ./e2e && mvn -B clean test run: cd ./e2e && mvn -B clean test
- name: Collect logs - name: Collect logs
if: failure() if: failure()
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v2
with: with:
name: dslogs name: dslogs
path: /var/lib/docker/volumes/docker-swarm_dolphinscheduler-logs/_data path: ${{ github.workspace }}/docker/docker-swarm/dolphinscheduler-logs

13
docker/docker-swarm/docker-compose.yml

@ -72,7 +72,7 @@ services:
- dolphinscheduler-postgresql - dolphinscheduler-postgresql
- dolphinscheduler-zookeeper - dolphinscheduler-zookeeper
volumes: volumes:
- dolphinscheduler-logs:/opt/dolphinscheduler/logs - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs
networks: networks:
- dolphinscheduler - dolphinscheduler
@ -95,7 +95,7 @@ services:
depends_on: depends_on:
- dolphinscheduler-api - dolphinscheduler-api
volumes: volumes:
- dolphinscheduler-logs:/var/log/nginx - ./dolphinscheduler-logs:/var/log/nginx
networks: networks:
- dolphinscheduler - dolphinscheduler
@ -133,7 +133,7 @@ services:
depends_on: depends_on:
- dolphinscheduler-postgresql - dolphinscheduler-postgresql
volumes: volumes:
- dolphinscheduler-logs:/opt/dolphinscheduler/logs - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs
networks: networks:
- dolphinscheduler - dolphinscheduler
@ -168,7 +168,7 @@ services:
- dolphinscheduler-postgresql - dolphinscheduler-postgresql
- dolphinscheduler-zookeeper - dolphinscheduler-zookeeper
volumes: volumes:
- dolphinscheduler-logs:/opt/dolphinscheduler/logs - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs
networks: networks:
- dolphinscheduler - dolphinscheduler
@ -210,9 +210,7 @@ services:
- type: volume - type: volume
source: dolphinscheduler-worker-data source: dolphinscheduler-worker-data
target: /tmp/dolphinscheduler target: /tmp/dolphinscheduler
- type: volume - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs
source: dolphinscheduler-logs
target: /opt/dolphinscheduler/logs
networks: networks:
- dolphinscheduler - dolphinscheduler
@ -225,7 +223,6 @@ volumes:
dolphinscheduler-postgresql-initdb: dolphinscheduler-postgresql-initdb:
dolphinscheduler-zookeeper: dolphinscheduler-zookeeper:
dolphinscheduler-worker-data: dolphinscheduler-worker-data:
dolphinscheduler-logs:
configs: configs:
dolphinscheduler-worker-task-env: dolphinscheduler-worker-task-env:

17
e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java

@ -167,6 +167,23 @@ public class BrowserCommon {
return inputElement; return inputElement;
} }
/**
* input element after clearing
*
* @param locator By
* @param content Input content
* @return inputElement
*/
public WebElement clearSendInput(By locator, String content) {
WebElement inputElement = locateElement(locator);
//input date
inputElement.clear();
inputElement.sendKeys(Keys.HOME,Keys.chord(Keys.SHIFT,Keys.END));
inputElement.sendKeys(content);
return inputElement;
}
/** /**
* clear element * clear element
* *

32
e2e/src/test/java/org/apache/dolphinscheduler/data/project/RunWorkflowData.java

@ -0,0 +1,32 @@
/*
* 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.dolphinscheduler.data.project;
public class RunWorkflowData {
/**
* run workflow data
*/
//input shell task name
public static final String RECIPIENT = "123456789@qq.com";
//input shell task description
public static final String Cc = "qwe12312sds@qq.com";
public static final String RUN_WORKFLOW_TITLE = "工作流定义 - DolphinScheduler";
}

35
e2e/src/test/java/org/apache/dolphinscheduler/data/project/TimingData.java

@ -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.
*/
package org.apache.dolphinscheduler.data.project;
public class TimingData {
/**
* timing data
*/
//input shell task name
public static final String RECIPIENT = "test123456@qq.com";
//input shell task description
public static final String Cc = "test.123qwe@qq.com";
public static final String EDIT_RECIPIENT = "test.edit123456@qq.com";
public static final String EDIT_Cc = "test.edit123qwe@qq.com";
public static final String WORKFLOW_TITLE = "工作流定义 - DolphinScheduler";
public static final String TIMING_TITLE = "定时任务列表 - DolphinScheduler";
}

10
e2e/src/test/java/org/apache/dolphinscheduler/data/security/UserManageData.java

@ -18,6 +18,9 @@ package org.apache.dolphinscheduler.data.security;
public class UserManageData { public class UserManageData {
/**
* create user
*/
public static final String USERNAME = "selenium_user_1"; public static final String USERNAME = "selenium_user_1";
public static final String PASSWORD = "123456qwe"; public static final String PASSWORD = "123456qwe";
@ -28,4 +31,11 @@ public class UserManageData {
public static final String USER_MANAGE = "用户管理 - DolphinScheduler"; public static final String USER_MANAGE = "用户管理 - DolphinScheduler";
/**
* edit user
*/
public static final String EDIT_USERNAME = "selenium_user_edit";
public static final String EDIT_PASSWORD = "123456qwe";
public static final String EDIT_EMAIL = "123456_edit@qq.com";
public static final String EDIT_PHONE = "15800001111";
} }

18
e2e/src/test/java/org/apache/dolphinscheduler/locator/project/CreateWorkflowLocator.java

@ -136,8 +136,7 @@ public class CreateWorkflowLocator {
//select tenant //select tenant
public static final By CLICK_TENANT = By.xpath("//div[4]/div/div/div/input"); public static final By CLICK_TENANT = By.xpath("//div[4]/div/div/div/input");
public static final By SELECT_TENANT = By.xpath("//div[2]/div/div/div/ul/li/span"); public static final By SELECT_TENANT = By.xpath("//div[4]/div/div[2]/div/div/div/ul/li[2]/span");
//click workflow timeout alarm //click workflow timeout alarm
public static final By CLICK_WORKFLOW_TIMEOUT_ALARM = By.xpath("//span[2]/span/span"); public static final By CLICK_WORKFLOW_TIMEOUT_ALARM = By.xpath("//span[2]/span/span");
@ -172,11 +171,24 @@ public class CreateWorkflowLocator {
//scroll to element bottom //scroll to element bottom
public static final By SCROLL_BOTTOM = By.xpath("//span/a/em"); public static final By SCROLL_BOTTOM = By.xpath("//span/a/em");
/**
* online workflow
*/
// click online workflow button
public static final By CLICK_ONLINE_WORKFLOW_BUTTON = By.xpath("//div[1]/div/table/tr[2]/td[10]/button[4]");
/**
* offline workflow
*/
// click offline workflow button
public static final By CLICK_OFFLINE_WORKFLOW_BUTTON = By.xpath("//div[1]/div/table/tr[2]/td[10]/button[4]");
/** /**
* delete workflow * delete workflow
*/ */
//click delete workflow button //click delete workflow button
public static final By DELETE_WORKFLOW_BOTTOM = By.xpath("//span/button/i"); public static final By DELETE_WORKFLOW_BOTTOM = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[10]/span/button");
//click confirm delete workflow button //click confirm delete workflow button
public static final By CONFIRM_DELETE_WORKFLOW_BOTTOM = By.xpath("//div[2]/div/button[2]/span"); public static final By CONFIRM_DELETE_WORKFLOW_BOTTOM = By.xpath("//div[2]/div/button[2]/span");

48
e2e/src/test/java/org/apache/dolphinscheduler/locator/project/RunWorkflowLocator.java

@ -0,0 +1,48 @@
/*
* 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.dolphinscheduler.locator.project;
import org.openqa.selenium.By;
public class RunWorkflowLocator {
/**
* run workflow
*/
// click run workflow button
public static final By CLICK_RUN_WORKFLOW_BUTTON = By.xpath("//div[1]/div/table/tr[2]/td[10]/button[2]");
//set running parameters
public static final By SELECT_FAILURE_STRATEGY_END = By.xpath("//div[5]/div/div[2]/div/div[3]/div[2]/div/label[2]/span[1]/input");
public static final By SELECT_FAILURE_STRATEGY_CONTINUE = By.xpath("//div[3]/div[2]/div/label[1]/span[1]/input");
public static final By CLICK_NOTICE_STRATEGY = By.xpath("//div[4]/div[2]/div/div[1]/div/input");
public static final By SELECT_NOTICE_STRATEGY = By.xpath("//div/ul/li[4]/span");
public static final By CLICK_PROCESS_PRIORITY = By.xpath("//div/div/div/div/div/span[2]");
public static final By SELECT_PROCESS_PRIORITY_HIGHEST = By.xpath("//li[1]/li/span");
public static final By CLICK_WORKER_GROUP = By.xpath("//div[6]/div[2]/div/div[1]/div/input");
public static final By SELECT_WORKER_GROUP = By.xpath("//div[5]/div/div[2]/div/div[6]/div[2]/div/div[2]/div/div/div/ul/li/span");
public static final By CLICK_NOTICE_GROUP = By.xpath("//div[7]/div[2]/div/div[1]/div/input");
public static final By SELECT_NOTICE_GROUP = By.xpath("//div[5]/div/div[2]/div/div[7]/div[2]/div/div[2]/div/div/div/ul/li/span");
public static final By INPUT_RECIPIENT = By.xpath("//div[8]/div[2]/div/div/span/span/input");
public static final By INPUT_Cc = By.xpath("//div[9]/div[2]/div/div/span/span/input");
public static final By CLICK_RUNNING_BUTTON = By.xpath("//div[11]/button[2]");
}

61
e2e/src/test/java/org/apache/dolphinscheduler/locator/project/TimingLocator.java

@ -0,0 +1,61 @@
/*
* 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.dolphinscheduler.locator.project;
import org.openqa.selenium.By;
public class TimingLocator {
// create timing button
public static final By CLICK_TIMING_BUTTON = By.xpath("//button[3]");
public static final By CLICK_EXECUTION_TIMING_BUTTON = By.xpath("//div[3]/button/span");
public static final By SELECT_FAILURE_STRATEGY_END = By.xpath("//label[2]/span/input");
public static final By SELECT_FAILURE_STRATEGY_CONTINUE = By.xpath("//div[2]/div/label/span[2]");
public static final By CLICK_NOTICE_STRATEGY = By.xpath("//div[6]/div[2]/div/div/div/input");
public static final By SELECT_NOTICE_STRATEGY = By.xpath("//div[2]/div/div/div/ul/li[4]/span");
public static final By CLICK_PROCESS_PRIORITY = By.xpath("//div[7]/div[2]/div/div/div/div/div/span[2]");
public static final By SELECT_PROCESS_PRIORITY = By.xpath("//li/li/span");
public static final By CLICK_WORKER_GROUP = By.xpath("//div[8]/div[2]/div/div/div/input");
public static final By SELECT_WORKER_GROUP = By.xpath("//div[8]/div[2]/div/div[2]/div/div/div/ul/li/span");
public static final By CLICK_NOTICE_GROUP = By.xpath("//div[9]/div[2]/div/div/div/input");
public static final By SELECT_NOTICE_GROUP = By.xpath("//div[9]/div[2]/div/div[2]/div/div/div/ul/li/span");
public static final By INPUT_RECIPIENT = By.xpath("//div[10]/div[2]/div/div/span/span/input");
public static final By INPUT_Cc = By.xpath("//div[11]/div[2]/div/div/span/span/input");
public static final By CLICK_CREATE_BUTTON = By.xpath("//div[12]/button[2]/span");
//edit timing
public static final By CLICK_TIMING_MANAGEMENT_BUTTON = By.xpath("//div[2]/div/div[3]/div[1]/div/table/tr[2]/td[10]/button[6]");
public static final By CLICK_EDIT_TIMING_BUTTON = By.xpath("//div[2]/div[3]/div/div[2]/div[1]/table/tr[2]/td[10]/button[1]");
//online timing
public static final By CLICK_ONLINE_TIMING_BUTTON = By.xpath("//td[10]/button[2]");
//offline timing
public static final By CLICK_OFFLINE_TIMING_BUTTON = By.xpath("//div[2]/div[3]/div/div[2]/div[1]/table/tr[2]/td[10]/button[2]");
//delete timing
public static final By CLICK_DELETE_TIMING_BUTTON = By.xpath("//div[2]/div[3]/div/div[2]/div[1]/table/tr[2]/td[10]/span/button");
public static final By CLICK_CONFIRM_DELETE_TIMING_BUTTON = By.xpath("//div[2]/div/button[2]/span");
}

2
e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java

@ -20,7 +20,7 @@ import org.openqa.selenium.By;
public class TokenManageLocator { public class TokenManageLocator {
//create token //create token
public static final By CLICK_TOKEN_MANAGE = By.xpath("//div[7]/div/a/div/a/span"); public static final By CLICK_TOKEN_MANAGE = By.xpath("/html/body/div[1]/div[2]/div/div[1]/div[7]/div/a/div/a/span");
public static final By CLICK_CREATE_TOKEN = By.xpath("//div[2]/div/div[2]/div[2]/div/div[1]/button/span"); public static final By CLICK_CREATE_TOKEN = By.xpath("//div[2]/div/div[2]/div[2]/div/div[1]/button/span");

22
e2e/src/test/java/org/apache/dolphinscheduler/locator/security/UserManageLocator.java

@ -20,6 +20,9 @@ import org.openqa.selenium.By;
public class UserManageLocator { public class UserManageLocator {
/**
* create user
*/
public static final By CLICK_USER_MANAGE = By.xpath("//div[3]/div/a/div/a/span"); public static final By CLICK_USER_MANAGE = By.xpath("//div[3]/div/a/div/a/span");
public static final By CLICK_CREATE_USER_BUTTON = By.xpath("//span[contains(.,'创建用户')]"); public static final By CLICK_CREATE_USER_BUTTON = By.xpath("//span[contains(.,'创建用户')]");
@ -36,13 +39,26 @@ public class UserManageLocator {
public static final By SELECT_QUEUE = By.xpath("//div[4]/div[2]/div/div[2]/div/div/div/ul/li/span"); public static final By SELECT_QUEUE = By.xpath("//div[4]/div[2]/div/div[2]/div/div/div/ul/li/span");
public static final By TENANT_INPUT_EMAIL = By.xpath("//div[5]/div[2]/div/input"); public static final By INPUT_EMAIL = By.xpath("//div[5]/div[2]/div/input");
public static final By INPUT_PHONE = By.xpath("//div[6]/div[2]/div/input");
public static final By SELECT_STOP_STATE = By.xpath("//div[7]/div[2]/div/label[2]/span/input");
public static final By TENANT_INPUT_PHONE = By.xpath("//div[6]/div[2]/div/input"); public static final By SELECT_ENABLE_STATE = By.xpath("//div[7]/div[2]/div/label[1]/span/input");
public static final By SUBMIT = By.xpath("//div[3]/button[2]/span"); public static final By SUBMIT = By.xpath("//div[3]/button[2]/span");
public static final By DELETE_USER_BUTTON = By.xpath("//span[2]/button"); /**
* edit user
*/
public static final By EDIT_GENERAL_USER_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[11]/button");
public static final By EDIT_ADMIN_USER_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[3]/td[11]/button");
/**
* delete user
*/
public static final By DELETE_USER_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[11]/span[2]/button");
public static final By CONFIRM_DELETE_USER_BUTTON = By.xpath("//div[2]/div/button[2]/span"); public static final By CONFIRM_DELETE_USER_BUTTON = By.xpath("//div[2]/div/button[2]/span");
} }

1
e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateProjectPage.java

@ -31,7 +31,6 @@ public class CreateProjectPage extends PageCommon {
* jump to ProjectManagePage * jump to ProjectManagePage
*/ */
public boolean jumpProjectManagePage() throws InterruptedException { public boolean jumpProjectManagePage() throws InterruptedException {
Thread.sleep(TestConstant.THREE_THOUSAND);
clickTopElement(CreateProjectLocator.PROJECT_MANAGE); clickTopElement(CreateProjectLocator.PROJECT_MANAGE);
Thread.sleep(TestConstant.ONE_THOUSAND); Thread.sleep(TestConstant.ONE_THOUSAND);
return ifTitleContains(CreateProjectData.PROJECT_TITLE); return ifTitleContains(CreateProjectData.PROJECT_TITLE);

29
e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateWorkflowPage.java

@ -20,6 +20,7 @@ import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.constant.TestConstant; import org.apache.dolphinscheduler.constant.TestConstant;
import org.apache.dolphinscheduler.data.project.CreateWorkflowData; import org.apache.dolphinscheduler.data.project.CreateWorkflowData;
import org.apache.dolphinscheduler.locator.project.CreateWorkflowLocator; import org.apache.dolphinscheduler.locator.project.CreateWorkflowLocator;
import org.apache.dolphinscheduler.locator.project.RunWorkflowLocator;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
public class CreateWorkflowPage extends PageCommon { public class CreateWorkflowPage extends PageCommon {
@ -183,13 +184,37 @@ public class CreateWorkflowPage extends PageCommon {
Thread.sleep(TestConstant.ONE_THOUSAND); Thread.sleep(TestConstant.ONE_THOUSAND);
//click add button //click add button
clickButton(CreateWorkflowLocator.CLICK_ADD_BUTTON);
System.out.println("submit workflow"); System.out.println("submit workflow");
clickButton(CreateWorkflowLocator.CLICK_ADD_BUTTON);
return ifTitleContains(CreateWorkflowData.CREATE_WORKFLOW_TITLE); return ifTitleContains(CreateWorkflowData.CREATE_WORKFLOW_TITLE);
} }
public boolean onlineWorkflow() throws InterruptedException {
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE);
// click online button
System.out.println("Click online workflow button");
clickButton(CreateWorkflowLocator.CLICK_ONLINE_WORKFLOW_BUTTON);
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
}
public boolean offlineWorkflow() throws InterruptedException {
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE);
// click offline button
System.out.println("offline workflow");
Thread.sleep(500);
clickButton(CreateWorkflowLocator.CLICK_OFFLINE_WORKFLOW_BUTTON);
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
}
public boolean deleteWorkflow() throws InterruptedException { public boolean deleteWorkflow() throws InterruptedException {
//click delete project //click delete workflow
Thread.sleep(500);
clickButton(CreateWorkflowLocator.DELETE_WORKFLOW_BOTTOM); clickButton(CreateWorkflowLocator.DELETE_WORKFLOW_BOTTOM);
//click confirm delete project //click confirm delete project

53
e2e/src/test/java/org/apache/dolphinscheduler/page/project/RunWorkflowPage.java

@ -0,0 +1,53 @@
/*
* 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.dolphinscheduler.page.project;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.data.project.RunWorkflowData;
import org.apache.dolphinscheduler.locator.project.RunWorkflowLocator;
import org.openqa.selenium.WebDriver;
public class RunWorkflowPage extends PageCommon {
public RunWorkflowPage(WebDriver driver) {
super(driver);
}
public boolean runWorkflow() throws InterruptedException {
// click run workflow button
System.out.println("Click run workflow button");
Thread.sleep(1000);
clickButton(RunWorkflowLocator.CLICK_RUN_WORKFLOW_BUTTON);
Thread.sleep(1000);
clickElement(RunWorkflowLocator.SELECT_FAILURE_STRATEGY_END);
clickElement(RunWorkflowLocator.SELECT_FAILURE_STRATEGY_CONTINUE);
clickElement(RunWorkflowLocator.CLICK_NOTICE_STRATEGY);
clickElement(RunWorkflowLocator.SELECT_NOTICE_STRATEGY);
Thread.sleep(500);
clickElement(RunWorkflowLocator.CLICK_PROCESS_PRIORITY);
clickElement(RunWorkflowLocator.SELECT_PROCESS_PRIORITY_HIGHEST);
clickElement(RunWorkflowLocator.CLICK_WORKER_GROUP);
clickElement(RunWorkflowLocator.SELECT_WORKER_GROUP);
clickElement(RunWorkflowLocator.CLICK_NOTICE_GROUP);
clickElement(RunWorkflowLocator.SELECT_NOTICE_GROUP);
sendInput(RunWorkflowLocator.INPUT_RECIPIENT, RunWorkflowData.RECIPIENT);
sendInput(RunWorkflowLocator.INPUT_Cc,RunWorkflowData.Cc);
clickButton(RunWorkflowLocator.CLICK_RUNNING_BUTTON);
return ifTitleContains(RunWorkflowData.RUN_WORKFLOW_TITLE);
}
}

134
e2e/src/test/java/org/apache/dolphinscheduler/page/project/TimingPage.java

@ -0,0 +1,134 @@
/*
* 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.dolphinscheduler.page.project;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.data.project.TimingData;
import org.apache.dolphinscheduler.locator.project.RunWorkflowLocator;
import org.apache.dolphinscheduler.locator.project.TimingLocator;
import org.openqa.selenium.WebDriver;
public class TimingPage extends PageCommon {
public TimingPage(WebDriver driver) {
super(driver);
}
/**
* create timing
*/
public boolean createTiming() throws InterruptedException {
// click timing button
System.out.println("Click timing button");
Thread.sleep(1000);
clickButton(TimingLocator.CLICK_TIMING_BUTTON);
System.out.println("Click execution timing button");
clickButton(TimingLocator.CLICK_EXECUTION_TIMING_BUTTON);
Thread.sleep(1000);
clickElement(TimingLocator.SELECT_FAILURE_STRATEGY_END);
clickElement(TimingLocator.SELECT_FAILURE_STRATEGY_CONTINUE);
clickElement(TimingLocator.CLICK_NOTICE_STRATEGY);
clickElement(TimingLocator.SELECT_NOTICE_STRATEGY);
Thread.sleep(500);
clickElement(TimingLocator.CLICK_PROCESS_PRIORITY);
clickElement(TimingLocator.SELECT_PROCESS_PRIORITY);
clickElement(TimingLocator.CLICK_WORKER_GROUP);
clickElement(TimingLocator.SELECT_WORKER_GROUP);
clickElement(TimingLocator.CLICK_NOTICE_GROUP);
clickElement(TimingLocator.SELECT_NOTICE_GROUP);
sendInput(TimingLocator.INPUT_RECIPIENT, TimingData.RECIPIENT);
sendInput(TimingLocator.INPUT_Cc,TimingData.Cc);
clickButton(TimingLocator.CLICK_CREATE_BUTTON);
return ifTitleContains(TimingData.WORKFLOW_TITLE);
}
/**
* edit timing
*/
public boolean editTiming() throws InterruptedException {
// click timing button
System.out.println("Click timing management button");
clickButton(TimingLocator.CLICK_TIMING_MANAGEMENT_BUTTON);
Thread.sleep(500);
System.out.println("Click edit timing button");
clickButton(TimingLocator.CLICK_EDIT_TIMING_BUTTON);
Thread.sleep(500);
System.out.println("Click execution timing button");
clickButton(TimingLocator.CLICK_EXECUTION_TIMING_BUTTON);
Thread.sleep(1000);
clickElement(TimingLocator.SELECT_FAILURE_STRATEGY_END);
clickElement(TimingLocator.SELECT_FAILURE_STRATEGY_CONTINUE);
clickElement(TimingLocator.CLICK_NOTICE_STRATEGY);
clickElement(TimingLocator.SELECT_NOTICE_STRATEGY);
Thread.sleep(500);
clickElement(TimingLocator.CLICK_PROCESS_PRIORITY);
clickElement(TimingLocator.SELECT_PROCESS_PRIORITY);
clickElement(TimingLocator.CLICK_WORKER_GROUP);
clickElement(TimingLocator.SELECT_WORKER_GROUP);
clickElement(TimingLocator.CLICK_NOTICE_GROUP);
clickElement(TimingLocator.SELECT_NOTICE_GROUP);
sendInput(TimingLocator.INPUT_RECIPIENT, TimingData.EDIT_RECIPIENT);
sendInput(TimingLocator.INPUT_Cc,TimingData.EDIT_Cc);
clickButton(TimingLocator.CLICK_CREATE_BUTTON);
return ifTitleContains(TimingData.TIMING_TITLE );
}
/**
* online timing
*/
public boolean onlineTiming() throws InterruptedException {
// click online timing button
System.out.println("Click online timing button");
Thread.sleep(500);
clickButton(TimingLocator.CLICK_ONLINE_TIMING_BUTTON);
return ifTitleContains(TimingData.TIMING_TITLE );
}
/**
* offline timing
*/
public boolean offlineTiming() throws InterruptedException {
// click offline timing button
System.out.println("Click offline timing button");
Thread.sleep(500);
clickButton(TimingLocator.CLICK_OFFLINE_TIMING_BUTTON);
return ifTitleContains(TimingData.TIMING_TITLE );
}
/**
* delete timing
*/
public boolean deleteTiming() throws InterruptedException {
// click offline timing button
System.out.println("Click delete timing button");
Thread.sleep(500);
clickButton(TimingLocator.CLICK_DELETE_TIMING_BUTTON);
clickButton(TimingLocator.CLICK_CONFIRM_DELETE_TIMING_BUTTON);
return ifTitleContains(TimingData.WORKFLOW_TITLE );
}
}

8
e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java

@ -37,14 +37,18 @@ public class AlertManagePage extends PageCommon {
*/ */
public boolean createAlert() throws InterruptedException { public boolean createAlert() throws InterruptedException {
// click alert manage // click alert manage
Thread.sleep(500);
System.out.println("start click alert manage button");
clickElement(AlertManageLocator.CLICK_ALERT_MANAGE); clickElement(AlertManageLocator.CLICK_ALERT_MANAGE);
Thread.sleep(1000); Thread.sleep(500);
// click create alert button // click create alert button
System.out.println("start click create alert button");
clickElement(AlertManageLocator.CLICK_CREATE_ALERT); clickElement(AlertManageLocator.CLICK_CREATE_ALERT);
Thread.sleep(1000); Thread.sleep(500);
// input alert data // input alert data
System.out.println("start input alert ");
sendInput(AlertManageLocator.INPUT_ALERT_NAME, AlertManageData.ALERT_NAME); sendInput(AlertManageLocator.INPUT_ALERT_NAME, AlertManageData.ALERT_NAME);
clickElement(AlertManageLocator.CLICK_ALERT_TYPE); clickElement(AlertManageLocator.CLICK_ALERT_TYPE);

8
e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

@ -37,14 +37,18 @@ public class QueueManagePage extends PageCommon {
*/ */
public boolean createQueue() throws InterruptedException { public boolean createQueue() throws InterruptedException {
// click queue manage // click queue manage
Thread.sleep(500);
System.out.println("start click queue manage button");
clickElement(QueueManageLocator.CLICK_QUEUE_MANAGE); clickElement(QueueManageLocator.CLICK_QUEUE_MANAGE);
Thread.sleep(1000); Thread.sleep(500);
// click create queue button // click create queue button
System.out.println("start click create queue button");
clickElement(QueueManageLocator.CLICK_CREATE_QUEUE); clickElement(QueueManageLocator.CLICK_CREATE_QUEUE);
Thread.sleep(1000); Thread.sleep(500);
// input queue data // input queue data
System.out.println("start input queue");
sendInput(QueueManageLocator.INPUT_QUEUE_NAME, QueueManageData.QUEUE_NAME); sendInput(QueueManageLocator.INPUT_QUEUE_NAME, QueueManageData.QUEUE_NAME);
sendInput(QueueManageLocator.INPUT_QUEUE_VALUE, QueueManageData.QUEUE_VALUE); sendInput(QueueManageLocator.INPUT_QUEUE_VALUE, QueueManageData.QUEUE_VALUE);

79
e2e/src/test/java/org/apache/dolphinscheduler/page/security/UserManagePage.java

@ -27,7 +27,7 @@ public class UserManagePage extends PageCommon {
} }
/** /**
* createTenant * create user
* *
* @return Whether to enter the specified page after creat tenant * @return Whether to enter the specified page after creat tenant
*/ */
@ -45,8 +45,10 @@ public class UserManagePage extends PageCommon {
clickButton(UserManageLocator.SELECT_TENANT); clickButton(UserManageLocator.SELECT_TENANT);
clickButton(UserManageLocator.CLICK_QUEUE); clickButton(UserManageLocator.CLICK_QUEUE);
clickButton(UserManageLocator.SELECT_QUEUE); clickButton(UserManageLocator.SELECT_QUEUE);
sendInput(UserManageLocator.TENANT_INPUT_EMAIL, UserManageData.EMAIL); sendInput(UserManageLocator.INPUT_EMAIL, UserManageData.EMAIL);
sendInput(UserManageLocator.TENANT_INPUT_PHONE, UserManageData.PHONE); sendInput(UserManageLocator.INPUT_PHONE, UserManageData.PHONE);
clickElement(UserManageLocator.SELECT_STOP_STATE);
clickElement(UserManageLocator.SELECT_ENABLE_STATE);
// click button // click button
clickButton(UserManageLocator.SUBMIT); clickButton(UserManageLocator.SUBMIT);
@ -55,15 +57,84 @@ public class UserManagePage extends PageCommon {
return ifTitleContains(UserManageData.USER_MANAGE); return ifTitleContains(UserManageData.USER_MANAGE);
} }
public boolean deleteUser() throws InterruptedException { /**
* edit general user
*/
public boolean editGeneralUser() throws InterruptedException {
//edit general user
// click user manage
System.out.println("start edit general user");
Thread.sleep(500);
clickElement(UserManageLocator.CLICK_USER_MANAGE);
// click edit user button
clickButton(UserManageLocator.EDIT_GENERAL_USER_BUTTON );
// input user data
clearSendInput(UserManageLocator.INPUT_USERNAME, UserManageData.EDIT_USERNAME);
clearSendInput(UserManageLocator.INPUT_PASSWORD, UserManageData.EDIT_PASSWORD);
clickButton(UserManageLocator.CLICK_TENANT);
clickButton(UserManageLocator.SELECT_TENANT);
clickButton(UserManageLocator.CLICK_QUEUE);
clickButton(UserManageLocator.SELECT_QUEUE);
clearSendInput(UserManageLocator.INPUT_EMAIL, UserManageData.EDIT_EMAIL);
clearSendInput(UserManageLocator.INPUT_PHONE, UserManageData.EDIT_PHONE);
clickElement(UserManageLocator.SELECT_STOP_STATE);
clickElement(UserManageLocator.SELECT_ENABLE_STATE);
// click button
clickButton(UserManageLocator.SUBMIT);
System.out.println("end edit general user");
// Whether to enter the specified page after submit
return ifTitleContains(UserManageData.USER_MANAGE);
}
/**
* edit admin user
*/
public boolean editAdminlUser() throws InterruptedException {
//edit admin user
// click user manage
System.out.println("start edit admin user");
Thread.sleep(500);
clickElement(UserManageLocator.CLICK_USER_MANAGE);
// click edit user button
clickButton(UserManageLocator.EDIT_ADMIN_USER_BUTTON );
// select tenant
clickButton(UserManageLocator.CLICK_TENANT);
clickButton(UserManageLocator.SELECT_TENANT);
// click button
clickButton(UserManageLocator.SUBMIT);
System.out.println("end edit admin user");
Thread.sleep(500);
// Whether to enter the specified page after submit
return ifTitleContains(UserManageData.USER_MANAGE);
}
/**
* delete user
*/
public boolean deleteUser() throws InterruptedException {
System.out.println("jump to user manage");
// click user manage // click user manage
clickElement(UserManageLocator.CLICK_USER_MANAGE); clickElement(UserManageLocator.CLICK_USER_MANAGE);
// click delete user button // click delete user button
System.out.println("click delete user");
clickButton(UserManageLocator.DELETE_USER_BUTTON ); clickButton(UserManageLocator.DELETE_USER_BUTTON );
// click confirm delete button // click confirm delete button
System.out.println("click confirm delete user");
clickButton(UserManageLocator.CONFIRM_DELETE_USER_BUTTON); clickButton(UserManageLocator.CONFIRM_DELETE_USER_BUTTON);
// Whether to enter the specified page after submit // Whether to enter the specified page after submit

11
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java

@ -29,12 +29,15 @@ public class TestDeleteWorkflow extends BaseTest {
public void testDeleteWorkflow() throws InterruptedException { public void testDeleteWorkflow() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver); createProjectPage = new CreateProjectPage(driver);
//jump to project manage page //jump to project manage page
System.out.println("jump to the project manage page to delete workflow"); // System.out.println("jump to the project manage page to delete workflow");
createProjectPage.jumpProjectManagePage(); // createProjectPage.jumpProjectManagePage();
createWorkflowPage = new CreateWorkflowPage(driver); createWorkflowPage = new CreateWorkflowPage(driver);
createWorkflowPage.jumpWorkflowPage(); // createWorkflowPage.jumpWorkflowPage();
//assert tenant manage page System.out.println("start offline workflow");
assert createWorkflowPage.offlineWorkflow();
System.out.println("end offline workflow");
System.out.println("start delete workflow"); System.out.println("start delete workflow");
assert createWorkflowPage.deleteWorkflow(); assert createWorkflowPage.deleteWorkflow();
System.out.println("end delete workflow"); System.out.println("end delete workflow");

4
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java

@ -40,6 +40,10 @@ public class TestCreateWorkflow extends BaseTest {
assert createWorkflowPage.createWorkflow(); assert createWorkflowPage.createWorkflow();
assert createWorkflowPage.saveWorkflow(); assert createWorkflowPage.saveWorkflow();
System.out.println("end create workflow"); System.out.println("end create workflow");
System.out.println("start online workflow");
assert createWorkflowPage.onlineWorkflow();
System.out.println("end online workflow");
System.out.println("==================================="); System.out.println("===================================");
} }
} }

41
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestRunWorkflow.java

@ -0,0 +1,41 @@
/*
* 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.dolphinscheduler.testcase.testProject;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.apache.dolphinscheduler.page.project.CreateWorkflowPage;
import org.apache.dolphinscheduler.page.project.RunWorkflowPage;
import org.testng.annotations.Test;
public class TestRunWorkflow extends BaseTest {
private CreateWorkflowPage createWorkflowPage;
private CreateProjectPage createProjectPage;
private RunWorkflowPage runWorkflowPage;
@Test(groups={"functionTests","runWorkflow"},dependsOnGroups = { "login","workflow" },description = "TestRunWorkflow")
public void testRunWorkflow() throws InterruptedException {
runWorkflowPage = new RunWorkflowPage(driver);
createProjectPage = new CreateProjectPage(driver);
System.out.println("start run workflow");
assert runWorkflowPage.runWorkflow();
System.out.println("end run workflow");
System.out.println("===================================");
}
}

75
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestTiming.java

@ -0,0 +1,75 @@
/*
* 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.dolphinscheduler.testcase.testProject;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.TimingPage;
import org.testng.annotations.Test;
public class TestTiming extends BaseTest {
private TimingPage timingPage;
@Test(groups={"functionTests","createTiming"},dependsOnGroups = { "login","workflow"},description = "TestCreateTiming")
public void testCreateTiming() throws InterruptedException {
timingPage = new TimingPage(driver);
System.out.println("start create timing");
assert timingPage.createTiming();
System.out.println("end create timing");
System.out.println("===================================");
}
@Test(groups={"functionTests","timing"},dependsOnGroups = { "login","workflow"},description = "TestEditTiming")
public void testEditTiming() throws InterruptedException {
timingPage = new TimingPage(driver);
System.out.println("start edit timing");
assert timingPage.editTiming();
System.out.println("end edit timing");
System.out.println("===================================");
}
@Test(groups={"functionTests","timing"},dependsOnGroups = { "login","workflow" },description = "TestOnlineTiming")
public void testOnlineTiming() throws InterruptedException {
timingPage = new TimingPage(driver);
System.out.println("start online timing");
assert timingPage.onlineTiming();
System.out.println("end online timing");
System.out.println("===================================");
}
@Test(groups={"functionTests","timing"},dependsOnGroups = { "login","workflow"},description = "TestOfflineTiming")
public void testOfflineTiming() throws InterruptedException {
timingPage = new TimingPage(driver);
System.out.println("start offline timing");
assert timingPage.offlineTiming();
System.out.println("end offline timing");
System.out.println("===================================");
}
@Test(groups={"functionTests","timing"},dependsOnGroups = { "login","workflow"},description = "TestDeleteTiming")
public void testDeleteTiming() throws InterruptedException {
timingPage = new TimingPage(driver);
System.out.println("start delete timing");
assert timingPage.deleteTiming();
System.out.println("end delete timing");
System.out.println("===================================");
}
}

18
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java

@ -23,14 +23,26 @@ import org.testng.annotations.Test;
public class TestUserManage extends BaseTest { public class TestUserManage extends BaseTest {
private UserManagePage userManagePage; private UserManagePage userManagePage;
@Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "TestUserManage") @Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "TestCreateUser")
public void testUserManage() throws InterruptedException { public void testCreateUser() throws InterruptedException {
userManagePage = new UserManagePage(driver); userManagePage = new UserManagePage(driver);
//assert user manage page //create user
System.out.println("start create user"); System.out.println("start create user");
assert userManagePage.createUser(); assert userManagePage.createUser();
System.out.println("end create user"); System.out.println("end create user");
System.out.println("==================================="); System.out.println("===================================");
}
@Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "TestEditUser")
public void testEditUser() throws InterruptedException {
userManagePage = new UserManagePage(driver);
//edit user
System.out.println("start edit user");
assert userManagePage.editGeneralUser();
assert userManagePage.editAdminlUser();
System.out.println("end edit user");
System.out.println("===================================");
} }
} }

19
e2e/testng.xml

@ -26,13 +26,30 @@
<classes> <classes>
<class name="org.apache.dolphinscheduler.testcase.TestLogin"></class> <class name="org.apache.dolphinscheduler.testcase.TestLogin"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestTenantManage"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestTenantManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestUserManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestAlertManage"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestAlertManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestQueueManage"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestQueueManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestTokenManage"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestTokenManage"></class>
<class name="org.apache.dolphinscheduler.testcase.testSecurity.TestUserManage">
<methods>
<include name="testCreateUser" />
<include name="testEditUser" />
</methods>
</class>
<class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateProject"></class> <class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateProject"></class>
<class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateWorkflow"></class> <class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateWorkflow"></class>
<class name="org.apache.dolphinscheduler.testcase.testProject.TestRunWorkflow"></class>
<class name="org.apache.dolphinscheduler.testcase.testProject.TestTiming">
<methods>
<include name="testCreateTiming" />
<include name="testEditTiming" />
<include name="testOnlineTiming" />
<include name="testOfflineTiming" />
<include name="testDeleteTiming" />
</methods>
</class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteWorkflow"></class> <class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteWorkflow"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteProject"></class> <class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteProject"></class>

Loading…
Cancel
Save