SbloodyS commented on code in PR #10670:
URL: https://github.com/apache/dolphinscheduler/pull/10670#discussion_r930547365


##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/ProjectAPITest.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class ProjectAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case01_wen";

Review Comment:
   Please avoid using personal name.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/ProjectAPITest.java:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class ProjectAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case01_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    @BeforeAll
+    public static void setup() {
+        LoginPage loginPage = new LoginPage();
+        HttpResponse loginHttpResponse = loginPage.login(user, password);
+
+        sessionId = JSONUtils.convertValue(loginHttpResponse.body().data(), 
LoginResponseData.class).sessionId();
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateProject() {
+        ProjectPage projectPage = new ProjectPage();
+
+        HttpResponse res = projectPage.createProject(sessionId, projectName, 
projectDesc, user);

Review Comment:
   ```suggestion
           HttpResponse createProjectResponse = 
projectPage.createProject(sessionId, projectName, projectDesc, user);
   ```



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";

Review Comment:
   Avoid using personal name.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();

Review Comment:
   ```suggestion
       private static String conditionType = "NONE";
       
       private static String executionType = "PARALLEL";
       
       HashMap<String, Object> conditionParams = new HashMap<>();
   ```



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();
+    private String globalParams = "[]";
+
+    private static String startEndTime = "2022-06-25T16:00:00.000Z";
+
+    private static String scheduleTime = "2022-06-26 00:00:00,2022-06-26 
00:00:00";
+
+    private static String failureStrategy = "CONTINUE";
+
+    private static String warningType = "NONE";
+
+    private static String warningGroupId = "";
+
+    private static String execType = "START_PROCESS";
+
+    private static String startNodeList = "";
+
+    private static String taskDependType = "TASK_POST";
+
+    private static String dependentMode = "OFF_MODE";
+
+    private static String runMode = "RUN_MODE_SERIAL";
+
+    private static String processInstancePriority = "MEDIUM";
+
+    private static String startParams = "";
+
+    private static String expectedParallelismNumber = "";
+
+    private static int dryRun = 0;
+
+    @BeforeAll
+    public static void setup() {
+        LoginPage loginPage = new LoginPage();
+        ProjectPage projectPage = new ProjectPage();
+        HttpResponse loginHttpResponse = loginPage.login(user, password);
+        TenantPage tenantPage = new TenantPage();
+
+        sessionId = JSONUtils.convertValue(loginHttpResponse.body().data(), 
LoginResponseData.class).sessionId();
+        projectPage.createProject(sessionId, projectName, projectDesc, user);
+        tenantPage.createTenant(sessionId, tenantName, 1, "");
+
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, 
workFlowName, localParams, resourceList, rawScript, delayTime, description, 
environmentCode, failRetryInterval,
+            failRetryTimes, flag, taskDefinitionRequestDataName, taskPriority, 
taskType, timeout, timeoutFlag, timeoutNotifyStrategy, workerGroup, 
taskRelationRequestDataName, preTaskCode,
+            preTaskVersion, conditionType, conditionParams, executionType, 
globalParams);
+
+        logger.info("Create workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(2)
+    public void testOnlineWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.onLineWorkflow(sessionId, projectName, 
workFlowName);
+
+        logger.info("Online workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+
+    }
+
+    @Test
+    @Order(3)
+    public void testQueryWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.queryWorkflow(sessionId, projectName, 
workFlowName);
+
+        logger.info("Query workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(4)
+    public void testRunWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.runWorkflow(sessionId, projectName, 
workFlowName, startEndTime, scheduleTime, failureStrategy, warningType,
+            warningGroupId, execType, startNodeList, taskDependType, 
dependentMode, runMode, processInstancePriority,
+            workerGroup, environmentCode, startParams, 
expectedParallelismNumber, dryRun);
+
+        logger.info("Run workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+
+    }
+
+    @Test
+    @Order(5)
+    public void testQueryWorkflowInstanceState() throws InterruptedException {
+        WorkFlowInstancesPage instance = new WorkFlowInstancesPage();
+        String state = null;
+
+        for (int i = 0; i < Constants.SLEEP_FREQUENCY; i++) {
+            state = instance.queryWorkflowInstanceState(sessionId, 
projectName, workFlowName);
+            Thread.sleep(Constants.SLEEP_INTERVAL);
+        }
+        logger.info("Run workflow state:%s", state);

Review Comment:
   remove unnessnary log.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();
+    private String globalParams = "[]";
+
+    private static String startEndTime = "2022-06-25T16:00:00.000Z";
+
+    private static String scheduleTime = "2022-06-26 00:00:00,2022-06-26 
00:00:00";
+
+    private static String failureStrategy = "CONTINUE";
+
+    private static String warningType = "NONE";
+
+    private static String warningGroupId = "";
+
+    private static String execType = "START_PROCESS";
+
+    private static String startNodeList = "";
+
+    private static String taskDependType = "TASK_POST";
+
+    private static String dependentMode = "OFF_MODE";
+
+    private static String runMode = "RUN_MODE_SERIAL";
+
+    private static String processInstancePriority = "MEDIUM";
+
+    private static String startParams = "";
+
+    private static String expectedParallelismNumber = "";
+
+    private static int dryRun = 0;
+
+    @BeforeAll
+    public static void setup() {
+        LoginPage loginPage = new LoginPage();
+        ProjectPage projectPage = new ProjectPage();
+        HttpResponse loginHttpResponse = loginPage.login(user, password);
+        TenantPage tenantPage = new TenantPage();
+
+        sessionId = JSONUtils.convertValue(loginHttpResponse.body().data(), 
LoginResponseData.class).sessionId();
+        projectPage.createProject(sessionId, projectName, projectDesc, user);
+        tenantPage.createTenant(sessionId, tenantName, 1, "");
+
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, 
workFlowName, localParams, resourceList, rawScript, delayTime, description, 
environmentCode, failRetryInterval,
+            failRetryTimes, flag, taskDefinitionRequestDataName, taskPriority, 
taskType, timeout, timeoutFlag, timeoutNotifyStrategy, workerGroup, 
taskRelationRequestDataName, preTaskCode,
+            preTaskVersion, conditionType, conditionParams, executionType, 
globalParams);
+
+        logger.info("Create workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(2)
+    public void testOnlineWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.onLineWorkflow(sessionId, projectName, 
workFlowName);
+
+        logger.info("Online workflow res:%s", res);

Review Comment:
   remove unnessnary log.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();
+    private String globalParams = "[]";
+
+    private static String startEndTime = "2022-06-25T16:00:00.000Z";
+
+    private static String scheduleTime = "2022-06-26 00:00:00,2022-06-26 
00:00:00";
+
+    private static String failureStrategy = "CONTINUE";
+
+    private static String warningType = "NONE";
+
+    private static String warningGroupId = "";
+
+    private static String execType = "START_PROCESS";
+
+    private static String startNodeList = "";
+
+    private static String taskDependType = "TASK_POST";
+
+    private static String dependentMode = "OFF_MODE";
+
+    private static String runMode = "RUN_MODE_SERIAL";
+
+    private static String processInstancePriority = "MEDIUM";
+
+    private static String startParams = "";
+
+    private static String expectedParallelismNumber = "";
+
+    private static int dryRun = 0;
+
+    @BeforeAll
+    public static void setup() {
+        LoginPage loginPage = new LoginPage();
+        ProjectPage projectPage = new ProjectPage();
+        HttpResponse loginHttpResponse = loginPage.login(user, password);
+        TenantPage tenantPage = new TenantPage();
+
+        sessionId = JSONUtils.convertValue(loginHttpResponse.body().data(), 
LoginResponseData.class).sessionId();
+        projectPage.createProject(sessionId, projectName, projectDesc, user);
+        tenantPage.createTenant(sessionId, tenantName, 1, "");
+
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, 
workFlowName, localParams, resourceList, rawScript, delayTime, description, 
environmentCode, failRetryInterval,

Review Comment:
   ```suggestion
           HttpResponse createWorkflowResponse = flow.createWorkflow(sessionId, 
projectName, workFlowName, localParams, resourceList, rawScript, delayTime, 
description, environmentCode, failRetryInterval,
   ```



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();
+    private String globalParams = "[]";

Review Comment:
   I think we should avoid using json with string.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/TenantAPITest.java:
##########
@@ -76,38 +76,9 @@ public void testCreateTenant() {
     public void testDuplicateCreateTenant() {
         TenantPage tenantPage = new TenantPage();
 
-        HttpResponse createTenantHttpResponse = 
tenantPage.createTenant(sessionId, tenant, 1, "");
+        HttpResponse createTenantHttpResponse = 
tenantPage.createTenant(sessionId, tenantName, 1, "");
 
         Assertions.assertFalse(createTenantHttpResponse.body().success());
     }
 
-    @Test
-    @Order(5)
-    public void testGetTenantListPaging() {
-        TenantPage tenantPage = new TenantPage();
-
-        HttpResponse createTenantHttpResponse = 
tenantPage.getTenantListPaging(sessionId, 1, 10, "");
-        boolean result = false;
-
-        for (TenantListPagingResponseTotalList 
tenantListPagingResponseTotalList : 
JSONUtils.convertValue(createTenantHttpResponse.body().data(), 
TenantListPagingResponseData.class).totalList()) {
-            if (tenantListPagingResponseTotalList.tenantCode().equals(tenant)) 
{
-                result = true;
-                existTenantId = tenantListPagingResponseTotalList.id();
-                break;
-            }
-        }
-
-        Assertions.assertTrue(createTenantHttpResponse.body().success());
-        Assertions.assertTrue(result);
-    }
-
-    @Test
-    @Order(10)
-    public void testDeleteTenant() {
-        TenantPage tenantPage = new TenantPage();
-
-        HttpResponse deleteTenantHttpResponse = 
tenantPage.deleteTenant(sessionId, existTenantId);
-
-        Assertions.assertTrue(deleteTenantHttpResponse.body().success());
-    }

Review Comment:
   This has not been addressed.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();
+    private String globalParams = "[]";
+
+    private static String startEndTime = "2022-06-25T16:00:00.000Z";
+
+    private static String scheduleTime = "2022-06-26 00:00:00,2022-06-26 
00:00:00";
+
+    private static String failureStrategy = "CONTINUE";
+
+    private static String warningType = "NONE";
+
+    private static String warningGroupId = "";
+
+    private static String execType = "START_PROCESS";
+
+    private static String startNodeList = "";
+
+    private static String taskDependType = "TASK_POST";
+
+    private static String dependentMode = "OFF_MODE";
+
+    private static String runMode = "RUN_MODE_SERIAL";
+
+    private static String processInstancePriority = "MEDIUM";
+
+    private static String startParams = "";
+
+    private static String expectedParallelismNumber = "";
+
+    private static int dryRun = 0;
+
+    @BeforeAll
+    public static void setup() {
+        LoginPage loginPage = new LoginPage();
+        ProjectPage projectPage = new ProjectPage();
+        HttpResponse loginHttpResponse = loginPage.login(user, password);
+        TenantPage tenantPage = new TenantPage();
+
+        sessionId = JSONUtils.convertValue(loginHttpResponse.body().data(), 
LoginResponseData.class).sessionId();
+        projectPage.createProject(sessionId, projectName, projectDesc, user);
+        tenantPage.createTenant(sessionId, tenantName, 1, "");
+
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, 
workFlowName, localParams, resourceList, rawScript, delayTime, description, 
environmentCode, failRetryInterval,
+            failRetryTimes, flag, taskDefinitionRequestDataName, taskPriority, 
taskType, timeout, timeoutFlag, timeoutNotifyStrategy, workerGroup, 
taskRelationRequestDataName, preTaskCode,
+            preTaskVersion, conditionType, conditionParams, executionType, 
globalParams);
+
+        logger.info("Create workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(2)
+    public void testOnlineWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.onLineWorkflow(sessionId, projectName, 
workFlowName);
+
+        logger.info("Online workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+
+    }
+
+    @Test
+    @Order(3)
+    public void testQueryWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.queryWorkflow(sessionId, projectName, 
workFlowName);
+
+        logger.info("Query workflow res:%s", res);

Review Comment:
   remove unnessnary log.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();
+    private String globalParams = "[]";
+
+    private static String startEndTime = "2022-06-25T16:00:00.000Z";
+
+    private static String scheduleTime = "2022-06-26 00:00:00,2022-06-26 
00:00:00";
+
+    private static String failureStrategy = "CONTINUE";
+
+    private static String warningType = "NONE";
+
+    private static String warningGroupId = "";
+
+    private static String execType = "START_PROCESS";
+
+    private static String startNodeList = "";
+
+    private static String taskDependType = "TASK_POST";
+
+    private static String dependentMode = "OFF_MODE";
+
+    private static String runMode = "RUN_MODE_SERIAL";
+
+    private static String processInstancePriority = "MEDIUM";
+
+    private static String startParams = "";
+
+    private static String expectedParallelismNumber = "";
+
+    private static int dryRun = 0;
+
+    @BeforeAll
+    public static void setup() {
+        LoginPage loginPage = new LoginPage();
+        ProjectPage projectPage = new ProjectPage();
+        HttpResponse loginHttpResponse = loginPage.login(user, password);
+        TenantPage tenantPage = new TenantPage();
+
+        sessionId = JSONUtils.convertValue(loginHttpResponse.body().data(), 
LoginResponseData.class).sessionId();
+        projectPage.createProject(sessionId, projectName, projectDesc, user);
+        tenantPage.createTenant(sessionId, tenantName, 1, "");
+
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, 
workFlowName, localParams, resourceList, rawScript, delayTime, description, 
environmentCode, failRetryInterval,
+            failRetryTimes, flag, taskDefinitionRequestDataName, taskPriority, 
taskType, timeout, timeoutFlag, timeoutNotifyStrategy, workerGroup, 
taskRelationRequestDataName, preTaskCode,
+            preTaskVersion, conditionType, conditionParams, executionType, 
globalParams);
+
+        logger.info("Create workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(2)
+    public void testOnlineWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.onLineWorkflow(sessionId, projectName, 
workFlowName);
+
+        logger.info("Online workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+
+    }
+
+    @Test
+    @Order(3)
+    public void testQueryWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.queryWorkflow(sessionId, projectName, 
workFlowName);
+
+        logger.info("Query workflow res:%s", res);
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(4)
+    public void testRunWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.runWorkflow(sessionId, projectName, 
workFlowName, startEndTime, scheduleTime, failureStrategy, warningType,
+            warningGroupId, execType, startNodeList, taskDependType, 
dependentMode, runMode, processInstancePriority,
+            workerGroup, environmentCode, startParams, 
expectedParallelismNumber, dryRun);
+
+        logger.info("Run workflow res:%s", res);

Review Comment:
   remove unnessnary log.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";
+    HashMap<String, Object> conditionParams = new HashMap<>();
+    private String globalParams = "[]";
+
+    private static String startEndTime = "2022-06-25T16:00:00.000Z";
+
+    private static String scheduleTime = "2022-06-26 00:00:00,2022-06-26 
00:00:00";
+
+    private static String failureStrategy = "CONTINUE";
+
+    private static String warningType = "NONE";
+
+    private static String warningGroupId = "";
+
+    private static String execType = "START_PROCESS";
+
+    private static String startNodeList = "";
+
+    private static String taskDependType = "TASK_POST";
+
+    private static String dependentMode = "OFF_MODE";
+
+    private static String runMode = "RUN_MODE_SERIAL";
+
+    private static String processInstancePriority = "MEDIUM";
+
+    private static String startParams = "";
+
+    private static String expectedParallelismNumber = "";
+
+    private static int dryRun = 0;
+
+    @BeforeAll
+    public static void setup() {
+        LoginPage loginPage = new LoginPage();
+        ProjectPage projectPage = new ProjectPage();
+        HttpResponse loginHttpResponse = loginPage.login(user, password);
+        TenantPage tenantPage = new TenantPage();
+
+        sessionId = JSONUtils.convertValue(loginHttpResponse.body().data(), 
LoginResponseData.class).sessionId();
+        projectPage.createProject(sessionId, projectName, projectDesc, user);
+        tenantPage.createTenant(sessionId, tenantName, 1, "");
+
+    }
+
+    @Test
+    @Order(1)
+    public void testCreateWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId, projectName);
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, 
workFlowName, localParams, resourceList, rawScript, delayTime, description, 
environmentCode, failRetryInterval,
+            failRetryTimes, flag, taskDefinitionRequestDataName, taskPriority, 
taskType, timeout, timeoutFlag, timeoutNotifyStrategy, workerGroup, 
taskRelationRequestDataName, preTaskCode,
+            preTaskVersion, conditionType, conditionParams, executionType, 
globalParams);
+
+        logger.info("Create workflow res:%s", res);

Review Comment:
   remove unnessnary log.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowShellAPITest.java:
##########
@@ -0,0 +1,211 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.Constants;
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;
+import org.apache.dolphinscheduler.api.test.pages.project.ProjectPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowDefinitionPage;
+import 
org.apache.dolphinscheduler.api.test.pages.project.WorkFlowInstancesPage;
+import org.apache.dolphinscheduler.api.test.pages.security.TenantPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowShellAPITest {
+    private static final Logger logger = 
LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "case02_wen";
+
+    private static final String projectDesc = "123";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String tenantName = System.getProperty("user.name");
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    ArrayList<Object> localParams = new ArrayList<>();
+
+    ArrayList<Object> resourceList = new ArrayList<>();
+
+    private static String rawScript = "echo 123";
+
+    private static String delayTime = "0";
+
+    private static String description = "";
+
+    private static String environmentCode = "-1";
+
+    private static String failRetryInterval = "1";
+
+    private static String failRetryTimes = "0";
+
+    private static String flag = "YES";
+
+    private static String taskDefinitionRequestDataName = "shell123";
+
+    private static String taskPriority = "MEDIUM";
+
+    private static String taskType = "SHELL";
+
+    private int timeout = 0;
+
+    private static String timeoutFlag = "CLOSE";
+
+    private static String timeoutNotifyStrategy = "";
+
+    private static String workerGroup = "default";
+
+    private static String taskRelationRequestDataName = "";
+
+    private int preTaskCode = 0;
+
+    private int preTaskVersion = 0;
+
+    private static String conditionType = "NONE";
+    private static String executionType = "PARALLEL";

Review Comment:
   I think we should create corresponding enumeration types for enumeration 
values instead of using strings. But I'm not quite sure whether we should do 
this. PTAL @kezhenxu94 



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/WorkFlowDefinitionPage.java:
##########
@@ -0,0 +1,207 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.api.test.pages.project;
+
+import org.apache.dolphinscheduler.api.test.cases.TenantAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.TaskDefinitionRequestData;
+import org.apache.dolphinscheduler.api.test.entity.TaskParamsMap;
+import org.apache.dolphinscheduler.api.test.entity.TaskRelationRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowCreateRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseTotalList;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowRunRequestData;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class WorkFlowDefinitionPage {
+    private static String genNumId = null;
+    private static String workFlowCode = null;
+
+    private static final Logger logger = 
LoggerFactory.getLogger(WorkFlowDefinitionPage.class);
+
+    public void getGenNumId(String sessionId, String projectName) {
+
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+        params.put("genNum", 1);
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+        ProjectPage project = new ProjectPage();
+        String projectCode = project.getProjectCode(sessionId, projectName);
+        RequestClient requestClient = new RequestClient();
+        HttpResponse res = requestClient.get("/projects/" + projectCode + 
"/task-definition/gen-task-codes", headers, params);
+        ArrayList list = (ArrayList) res.body().data();
+        genNumId = list.get(0).toString();
+
+    }
+
+    public HttpResponse createWorkflow(String sessionId, String projectName, 
String workFlowName, ArrayList<Object> localParams, ArrayList<Object> 
resourceList,
+                                       String rawScript, String delayTime, 
String description,
+                                       String environmentCode, String 
failRetryInterval, String failRetryTimes, String flag, String 
taskDefinitionRequestDataName, String taskPriority,
+                                       String taskType, Integer timeout, 
String timeoutFlag, String timeoutNotifyStrategy, String workerGroup, String 
taskRelationRequestDataName,
+                                       Integer preTaskCode, Integer 
preTaskVersion, String conditionType, HashMap<String, Object> conditionParams,
+                                       String executionType, String 
globalParams) {
+        Map<String, String> headers = new HashMap<>();
+        WorkFlowCreateRequestData workFlowCreateRequestData = new 
WorkFlowCreateRequestData();
+        TaskDefinitionRequestData taskDefinitionRequestData = new 
TaskDefinitionRequestData();
+        TaskRelationRequestData taskRelationRequestData = new 
TaskRelationRequestData();
+
+        TaskParamsMap taskParams = new TaskParamsMap();
+        taskParams.localParams(localParams);
+        taskParams.resourceList(resourceList);
+        taskParams.rawScript(rawScript);
+
+        taskDefinitionRequestData.code(genNumId);
+        taskDefinitionRequestData.delayTime(delayTime);
+        taskDefinitionRequestData.description(description);
+        taskDefinitionRequestData.environmentCode(environmentCode);
+        taskDefinitionRequestData.failRetryInterval(failRetryInterval);
+        taskDefinitionRequestData.failRetryTimes(failRetryTimes);
+        taskDefinitionRequestData.flag(flag);
+        taskDefinitionRequestData.name(taskDefinitionRequestDataName);
+        taskDefinitionRequestData.taskParams(taskParams);
+        taskDefinitionRequestData.taskPriority(taskPriority);
+        taskDefinitionRequestData.taskType(taskType);
+        taskDefinitionRequestData.timeout(timeout);
+        taskDefinitionRequestData.timeoutFlag(timeoutFlag);
+        taskDefinitionRequestData.timeoutNotifyStrategy(timeoutNotifyStrategy);
+        taskDefinitionRequestData.workerGroup(workerGroup);
+
+        ArrayList<Object> taskDefinitionRequestDataList = new ArrayList<>();
+        taskDefinitionRequestDataList.add(taskDefinitionRequestData);
+
+        taskRelationRequestData.name(taskRelationRequestDataName);
+        taskRelationRequestData.preTaskCode(preTaskCode);
+        taskRelationRequestData.preTaskVersion(preTaskVersion);
+        taskRelationRequestData.preTaskCode(preTaskCode);
+        taskRelationRequestData.postTaskCode(genNumId);
+        taskRelationRequestData.conditionType(conditionType);
+        taskRelationRequestData.conditionParams(conditionParams);
+        ArrayList<Object> taskRelationRequestDataList = new ArrayList<>();
+        taskRelationRequestDataList.add(taskRelationRequestData);
+
+        HashMap<String, Object> locations = new HashMap();
+        locations.put("taskCode", genNumId);
+        locations.put("x", 33.5);
+        locations.put("y", 38.5);
+        ArrayList<Object> locationsList = new ArrayList<>();
+        locationsList.add(locations);
+
+        
workFlowCreateRequestData.locations(JSONUtils.toJsonString(locationsList));
+        
workFlowCreateRequestData.taskDefinitionJson(JSONUtils.toJsonString(taskDefinitionRequestDataList));
+        
workFlowCreateRequestData.taskRelationJson(JSONUtils.toJsonString(taskRelationRequestDataList));
+        workFlowCreateRequestData.name(workFlowName);
+        workFlowCreateRequestData.tenantCode(TenantAPITest.tenantName);
+        workFlowCreateRequestData.executionType(executionType);
+        workFlowCreateRequestData.description("");
+        workFlowCreateRequestData.globalParams(globalParams);
+        workFlowCreateRequestData.timeout(0);
+
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+        RequestClient requestClient = new RequestClient();
+        ProjectPage project = new ProjectPage();
+        String projectCode = project.getProjectCode(sessionId, projectName);
+
+        HttpResponse res = requestClient.post("/projects/" + projectCode + 
"/process-definition", headers, 
JSONUtils.convertValue(workFlowCreateRequestData, Map.class));
+        return res;
+    }
+
+    public HttpResponse queryWorkflow(String sessionId, String projectName, 
String workFlowName) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+        params.put("pageSize", 10);
+        params.put("pageNo", 1);
+        params.put("searchVal", workFlowName);
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+        RequestClient requestClient = new RequestClient();
+        ProjectPage project = new ProjectPage();
+        String projectCode = project.getProjectCode(sessionId, projectName);
+        HttpResponse res = requestClient.get("/projects/" + projectCode + 
"/process-definition", headers, params);
+
+        for (WorkFlowResponseTotalList workFlowList : 
JSONUtils.convertValue(res.body().data(), 
WorkFlowResponseData.class).totalList()) {
+            workFlowCode = workFlowList.code();
+        }
+
+        return res;
+    }
+
+    public HttpResponse onLineWorkflow(String sessionId, String projectName, 
String workFlowName) {
+        WorkFlowDefinitionPage workflow = new WorkFlowDefinitionPage();
+        workflow.queryWorkflow(sessionId, projectName, workFlowName);
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+        params.put("name", workFlowName);
+        params.put("releaseState", "ONLINE");

Review Comment:
   It's better to take this parameter as the input parameter of the method, and 
the on and off lines are implemented in this method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to