From e97b4707a5e1adb6913112369a344c34891740f2 Mon Sep 17 00:00:00 2001 From: xingchun-chen <55787491+xingchun-chen@users.noreply.github.com> Date: Tue, 14 Jul 2020 11:48:13 +0800 Subject: [PATCH] [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 --- .github/workflows/ci_e2e.yml | 4 +- docker/docker-swarm/docker-compose.yml | 13 +- .../common/BrowserCommon.java | 17 +++ .../data/project/RunWorkflowData.java | 32 +++++ .../data/project/TimingData.java | 35 +++++ .../data/security/UserManageData.java | 10 ++ .../project/CreateWorkflowLocator.java | 18 ++- .../locator/project/RunWorkflowLocator.java | 48 +++++++ .../locator/project/TimingLocator.java | 61 ++++++++ .../locator/security/TokenManageLocator.java | 2 +- .../locator/security/UserManageLocator.java | 22 ++- .../page/project/CreateProjectPage.java | 1 - .../page/project/CreateWorkflowPage.java | 29 +++- .../page/project/RunWorkflowPage.java | 53 +++++++ .../page/project/TimingPage.java | 134 ++++++++++++++++++ .../page/security/AlertManagePage.java | 8 +- .../page/security/QueueManagePage.java | 8 +- .../page/security/UserManagePage.java | 79 ++++++++++- .../testDeleteData/TestDeleteWorkflow.java | 11 +- .../testProject/TestCreateWorkflow.java | 4 + .../testcase/testProject/TestRunWorkflow.java | 41 ++++++ .../testcase/testProject/TestTiming.java | 75 ++++++++++ .../testcase/testSecurity/TestUserManage.java | 18 ++- e2e/testng.xml | 19 ++- 24 files changed, 706 insertions(+), 36 deletions(-) create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/data/project/RunWorkflowData.java create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/data/project/TimingData.java create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/locator/project/RunWorkflowLocator.java create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/locator/project/TimingLocator.java create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/page/project/RunWorkflowPage.java create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/page/project/TimingPage.java create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestRunWorkflow.java create mode 100644 e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestTiming.java diff --git a/.github/workflows/ci_e2e.yml b/.github/workflows/ci_e2e.yml index 82c81ef4e1..eaffc04e62 100644 --- a/.github/workflows/ci_e2e.yml +++ b/.github/workflows/ci_e2e.yml @@ -66,9 +66,9 @@ jobs: run: cd ./e2e && mvn -B clean test - name: Collect logs if: failure() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: dslogs - path: /var/lib/docker/volumes/docker-swarm_dolphinscheduler-logs/_data + path: ${{ github.workspace }}/docker/docker-swarm/dolphinscheduler-logs diff --git a/docker/docker-swarm/docker-compose.yml b/docker/docker-swarm/docker-compose.yml index ee8be2570d..5cb6717f15 100644 --- a/docker/docker-swarm/docker-compose.yml +++ b/docker/docker-swarm/docker-compose.yml @@ -72,7 +72,7 @@ services: - dolphinscheduler-postgresql - dolphinscheduler-zookeeper volumes: - - dolphinscheduler-logs:/opt/dolphinscheduler/logs + - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs networks: - dolphinscheduler @@ -95,7 +95,7 @@ services: depends_on: - dolphinscheduler-api volumes: - - dolphinscheduler-logs:/var/log/nginx + - ./dolphinscheduler-logs:/var/log/nginx networks: - dolphinscheduler @@ -133,7 +133,7 @@ services: depends_on: - dolphinscheduler-postgresql volumes: - - dolphinscheduler-logs:/opt/dolphinscheduler/logs + - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs networks: - dolphinscheduler @@ -168,7 +168,7 @@ services: - dolphinscheduler-postgresql - dolphinscheduler-zookeeper volumes: - - dolphinscheduler-logs:/opt/dolphinscheduler/logs + - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs networks: - dolphinscheduler @@ -210,9 +210,7 @@ services: - type: volume source: dolphinscheduler-worker-data target: /tmp/dolphinscheduler - - type: volume - source: dolphinscheduler-logs - target: /opt/dolphinscheduler/logs + - ./dolphinscheduler-logs:/opt/dolphinscheduler/logs networks: - dolphinscheduler @@ -225,7 +223,6 @@ volumes: dolphinscheduler-postgresql-initdb: dolphinscheduler-zookeeper: dolphinscheduler-worker-data: - dolphinscheduler-logs: configs: dolphinscheduler-worker-task-env: diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java b/e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java index a7c1f7ffb4..437e81cfbb 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java +++ b/e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java @@ -167,6 +167,23 @@ public class BrowserCommon { 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 * diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/data/project/RunWorkflowData.java b/e2e/src/test/java/org/apache/dolphinscheduler/data/project/RunWorkflowData.java new file mode 100644 index 0000000000..70112edd7a --- /dev/null +++ b/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"; + + +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/data/project/TimingData.java b/e2e/src/test/java/org/apache/dolphinscheduler/data/project/TimingData.java new file mode 100644 index 0000000000..d00a562d9e --- /dev/null +++ b/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"; +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/data/security/UserManageData.java b/e2e/src/test/java/org/apache/dolphinscheduler/data/security/UserManageData.java index 080172d297..10dcd45af7 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/data/security/UserManageData.java +++ b/e2e/src/test/java/org/apache/dolphinscheduler/data/security/UserManageData.java @@ -18,6 +18,9 @@ package org.apache.dolphinscheduler.data.security; public class UserManageData { + /** + * create user + */ public static final String USERNAME = "selenium_user_1"; public static final String PASSWORD = "123456qwe"; @@ -28,4 +31,11 @@ public class UserManageData { 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"; } diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/CreateWorkflowLocator.java b/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/CreateWorkflowLocator.java index 496bbc4863..5163f0f66f 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/CreateWorkflowLocator.java +++ b/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/CreateWorkflowLocator.java @@ -136,8 +136,7 @@ public class CreateWorkflowLocator { //select tenant 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 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 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 */ //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 public static final By CONFIRM_DELETE_WORKFLOW_BOTTOM = By.xpath("//div[2]/div/button[2]/span"); diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/RunWorkflowLocator.java b/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/RunWorkflowLocator.java new file mode 100644 index 0000000000..36a788f479 --- /dev/null +++ b/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]"); +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/TimingLocator.java b/e2e/src/test/java/org/apache/dolphinscheduler/locator/project/TimingLocator.java new file mode 100644 index 0000000000..d9559b1236 --- /dev/null +++ b/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"); +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java b/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java index e7f7654811..0626ed8031 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java +++ b/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java @@ -20,7 +20,7 @@ import org.openqa.selenium.By; public class TokenManageLocator { //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"); diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/UserManageLocator.java b/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/UserManageLocator.java index 9f685f0717..ef2ec9095c 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/UserManageLocator.java +++ b/e2e/src/test/java/org/apache/dolphinscheduler/locator/security/UserManageLocator.java @@ -20,6 +20,9 @@ import org.openqa.selenium.By; 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_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 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 TENANT_INPUT_PHONE = By.xpath("//div[6]/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 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 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"); } diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateProjectPage.java b/e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateProjectPage.java index 52bfcc661d..cba62a4b34 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateProjectPage.java +++ b/e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateProjectPage.java @@ -31,7 +31,6 @@ public class CreateProjectPage extends PageCommon { * jump to ProjectManagePage */ public boolean jumpProjectManagePage() throws InterruptedException { - Thread.sleep(TestConstant.THREE_THOUSAND); clickTopElement(CreateProjectLocator.PROJECT_MANAGE); Thread.sleep(TestConstant.ONE_THOUSAND); return ifTitleContains(CreateProjectData.PROJECT_TITLE); diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateWorkflowPage.java b/e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateWorkflowPage.java index a529e76f44..ed978a80ed 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/page/project/CreateWorkflowPage.java +++ b/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.data.project.CreateWorkflowData; import org.apache.dolphinscheduler.locator.project.CreateWorkflowLocator; +import org.apache.dolphinscheduler.locator.project.RunWorkflowLocator; import org.openqa.selenium.WebDriver; public class CreateWorkflowPage extends PageCommon { @@ -183,13 +184,37 @@ public class CreateWorkflowPage extends PageCommon { Thread.sleep(TestConstant.ONE_THOUSAND); //click add button - clickButton(CreateWorkflowLocator.CLICK_ADD_BUTTON); System.out.println("submit workflow"); + clickButton(CreateWorkflowLocator.CLICK_ADD_BUTTON); + 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 { - //click delete project + //click delete workflow + Thread.sleep(500); clickButton(CreateWorkflowLocator.DELETE_WORKFLOW_BOTTOM); //click confirm delete project diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/page/project/RunWorkflowPage.java b/e2e/src/test/java/org/apache/dolphinscheduler/page/project/RunWorkflowPage.java new file mode 100644 index 0000000000..9f14dde8fa --- /dev/null +++ b/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); + } +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/page/project/TimingPage.java b/e2e/src/test/java/org/apache/dolphinscheduler/page/project/TimingPage.java new file mode 100644 index 0000000000..f74f4608ae --- /dev/null +++ b/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 ); + } +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java b/e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java index a205723867..4ea64dfc4c 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java +++ b/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 { // click alert manage + Thread.sleep(500); + System.out.println("start click alert manage button"); clickElement(AlertManageLocator.CLICK_ALERT_MANAGE); - Thread.sleep(1000); + Thread.sleep(500); // click create alert button + System.out.println("start click create alert button"); clickElement(AlertManageLocator.CLICK_CREATE_ALERT); - Thread.sleep(1000); + Thread.sleep(500); // input alert data + System.out.println("start input alert "); sendInput(AlertManageLocator.INPUT_ALERT_NAME, AlertManageData.ALERT_NAME); clickElement(AlertManageLocator.CLICK_ALERT_TYPE); diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java b/e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java index 33b7627254..95165aec1d 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java +++ b/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 { // click queue manage + Thread.sleep(500); + System.out.println("start click queue manage button"); clickElement(QueueManageLocator.CLICK_QUEUE_MANAGE); - Thread.sleep(1000); + Thread.sleep(500); // click create queue button + System.out.println("start click create queue button"); clickElement(QueueManageLocator.CLICK_CREATE_QUEUE); - Thread.sleep(1000); + Thread.sleep(500); // input queue data + System.out.println("start input queue"); sendInput(QueueManageLocator.INPUT_QUEUE_NAME, QueueManageData.QUEUE_NAME); sendInput(QueueManageLocator.INPUT_QUEUE_VALUE, QueueManageData.QUEUE_VALUE); diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/page/security/UserManagePage.java b/e2e/src/test/java/org/apache/dolphinscheduler/page/security/UserManagePage.java index 21dd4ca294..31f0445cd8 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/page/security/UserManagePage.java +++ b/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 */ @@ -45,8 +45,10 @@ public class UserManagePage extends PageCommon { clickButton(UserManageLocator.SELECT_TENANT); clickButton(UserManageLocator.CLICK_QUEUE); clickButton(UserManageLocator.SELECT_QUEUE); - sendInput(UserManageLocator.TENANT_INPUT_EMAIL, UserManageData.EMAIL); - sendInput(UserManageLocator.TENANT_INPUT_PHONE, UserManageData.PHONE); + sendInput(UserManageLocator.INPUT_EMAIL, UserManageData.EMAIL); + sendInput(UserManageLocator.INPUT_PHONE, UserManageData.PHONE); + clickElement(UserManageLocator.SELECT_STOP_STATE); + clickElement(UserManageLocator.SELECT_ENABLE_STATE); // click button clickButton(UserManageLocator.SUBMIT); @@ -55,15 +57,84 @@ public class UserManagePage extends PageCommon { 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 clickElement(UserManageLocator.CLICK_USER_MANAGE); // click delete user button + System.out.println("click delete user"); clickButton(UserManageLocator.DELETE_USER_BUTTON ); // click confirm delete button + System.out.println("click confirm delete user"); clickButton(UserManageLocator.CONFIRM_DELETE_USER_BUTTON); // Whether to enter the specified page after submit diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java b/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java index d84f34a65d..2d7714e4e9 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java +++ b/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 { createProjectPage = new CreateProjectPage(driver); //jump to project manage page - System.out.println("jump to the project manage page to delete workflow"); - createProjectPage.jumpProjectManagePage(); +// System.out.println("jump to the project manage page to delete workflow"); +// createProjectPage.jumpProjectManagePage(); createWorkflowPage = new CreateWorkflowPage(driver); - createWorkflowPage.jumpWorkflowPage(); - //assert tenant manage page +// createWorkflowPage.jumpWorkflowPage(); + System.out.println("start offline workflow"); + assert createWorkflowPage.offlineWorkflow(); + System.out.println("end offline workflow"); + System.out.println("start delete workflow"); assert createWorkflowPage.deleteWorkflow(); System.out.println("end delete workflow"); diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java b/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java index 2b7d2b6944..bac5b1a43c 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java +++ b/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.saveWorkflow(); System.out.println("end create workflow"); + + System.out.println("start online workflow"); + assert createWorkflowPage.onlineWorkflow(); + System.out.println("end online workflow"); System.out.println("==================================="); } } diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestRunWorkflow.java b/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestRunWorkflow.java new file mode 100644 index 0000000000..9d641bd2fb --- /dev/null +++ b/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("==================================="); + } +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestTiming.java b/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestTiming.java new file mode 100644 index 0000000000..dd64c9ddf8 --- /dev/null +++ b/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("==================================="); + } +} diff --git a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java b/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java index 20537de7a6..e464d7c57e 100644 --- a/e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java +++ b/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 { private UserManagePage userManagePage; - @Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "TestUserManage") - public void testUserManage() throws InterruptedException { + @Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "TestCreateUser") + public void testCreateUser() throws InterruptedException { userManagePage = new UserManagePage(driver); - //assert user manage page + //create user System.out.println("start create user"); assert userManagePage.createUser(); System.out.println("end create user"); 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("==================================="); } } diff --git a/e2e/testng.xml b/e2e/testng.xml index 438d5474d3..ee09e197d9 100644 --- a/e2e/testng.xml +++ b/e2e/testng.xml @@ -26,13 +26,30 @@ - + + + + + + + + + + + + + + + + + +