You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/07/03 08:32:29 UTC

[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #10670: Project management basic test cases

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


##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/ProjectAPITest.java:
##########
@@ -0,0 +1,83 @@
+/*
+ * 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 lombok.extern.slf4j.Slf4j;
+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.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@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 = "wen";
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+

Review Comment:
   Please separate each method by one line.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowInstanceAPITest.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * 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 lombok.extern.slf4j.Slf4j;
+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.WorkFlowDefinitionPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowInstanceAPITest {
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String tenant = System.getProperty("user.name");
+
+    private static final String projectName = "wen";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    private static String genNumId = 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 testQueryWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+
+        flow.getGenNumId(sessionId,"wen");
+
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, workFlowName);
+
+    }
+
+
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/entity/ProjectListResponseData.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class ProjectListResponseData {
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/WorkFlowDefinitionPage.java:
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowCreateRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseTotalList;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowRunRequestData;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public final class WorkFlowDefinitionPage {
+    private static String genNumId = null;
+    private static String workFlowCode = null;
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.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) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowCreateRequestData workFlowCreateRequestData = new WorkFlowCreateRequestData();
+
+        String taskDefinitionJson = "[{\"code\":" + genNumId + ",\"delayTime\":\"0\",\"description\":\"\",\"environmentCode\":-1,\"failRetryInterval\":\"1\",\"failRetryTimes\":\"0\",\"flag\":\"YES\",\"name\":\"echo_123\",\"taskParams\":{\"localParams\":[],\"rawScript\":\"echo 123\",\"resourceList\":[]},\"taskPriority\":\"MEDIUM\",\"taskType\":\"SHELL\",\"timeout\":0,\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"workerGroup\":\"default\"}]";
+        String taskRelationJson = "[{\"name\":\"\",\"preTaskCode\":0,\"preTaskVersion\":0,\"postTaskCode\":"+ genNumId + ",\"postTaskVersion\":0,\"conditionType\":\"NONE\",\"conditionParams\":{}}]";
+        String locations = "[{\"taskCode\":" + genNumId +",\"x\":33.5,\"y\":38.5}]";
+        workFlowCreateRequestData.setTaskDefinitionJson(taskDefinitionJson);
+        workFlowCreateRequestData.setTaskRelationJson(taskRelationJson);
+        workFlowCreateRequestData.setLocations(locations);
+        workFlowCreateRequestData.setName(workFlowName);
+        workFlowCreateRequestData.setTenantCode("admin");
+        workFlowCreateRequestData.setExecutionType("PARALLEL");
+        workFlowCreateRequestData.setDescription("");
+        workFlowCreateRequestData.setGlobalParams("[]");
+        workFlowCreateRequestData.setTimeout(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));
+        logger.info("创建工作流结果:%s", res);
+        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);
+
+        logger.info("查询工作流结果:%s\n", res);
+        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");
+        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/"+workFlowCode+"/release", headers, params);
+
+        logger.info("上线工作流:%s", res);

Review Comment:
   Same as line 86.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/WorkFlowDefinitionPage.java:
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowCreateRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseTotalList;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowRunRequestData;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public final class WorkFlowDefinitionPage {
+    private static String genNumId = null;
+    private static String workFlowCode = null;
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.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) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowCreateRequestData workFlowCreateRequestData = new WorkFlowCreateRequestData();
+
+        String taskDefinitionJson = "[{\"code\":" + genNumId + ",\"delayTime\":\"0\",\"description\":\"\",\"environmentCode\":-1,\"failRetryInterval\":\"1\",\"failRetryTimes\":\"0\",\"flag\":\"YES\",\"name\":\"echo_123\",\"taskParams\":{\"localParams\":[],\"rawScript\":\"echo 123\",\"resourceList\":[]},\"taskPriority\":\"MEDIUM\",\"taskType\":\"SHELL\",\"timeout\":0,\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"workerGroup\":\"default\"}]";
+        String taskRelationJson = "[{\"name\":\"\",\"preTaskCode\":0,\"preTaskVersion\":0,\"postTaskCode\":"+ genNumId + ",\"postTaskVersion\":0,\"conditionType\":\"NONE\",\"conditionParams\":{}}]";
+        String locations = "[{\"taskCode\":" + genNumId +",\"x\":33.5,\"y\":38.5}]";
+        workFlowCreateRequestData.setTaskDefinitionJson(taskDefinitionJson);
+        workFlowCreateRequestData.setTaskRelationJson(taskRelationJson);
+        workFlowCreateRequestData.setLocations(locations);
+        workFlowCreateRequestData.setName(workFlowName);
+        workFlowCreateRequestData.setTenantCode("admin");
+        workFlowCreateRequestData.setExecutionType("PARALLEL");
+        workFlowCreateRequestData.setDescription("");
+        workFlowCreateRequestData.setGlobalParams("[]");
+        workFlowCreateRequestData.setTimeout(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));
+        logger.info("创建工作流结果:%s", res);
+        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);
+
+        logger.info("查询工作流结果:%s\n", res);
+        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");
+        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/"+workFlowCode+"/release", headers, params);
+
+        logger.info("上线工作流:%s", res);
+        return res;
+
+    }
+
+    public HttpResponse runWorkflow(String sessionId, String projectName, String workFlowName){
+        WorkFlowDefinitionPage workflow = new WorkFlowDefinitionPage();
+        workflow.queryWorkflow(sessionId, projectName, workFlowName);
+        workflow.onLineWorkflow(sessionId, projectName, workFlowName);
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowRunRequestData workFlowRunRequestData = new WorkFlowRunRequestData();
+        workFlowRunRequestData.setProcessDefinitionCode(workFlowCode);
+        workFlowRunRequestData.setStartEndTime("2022-06-25T16:00:00.000Z");
+        workFlowRunRequestData.setScheduleTime("2022-06-26 00:00:00,2022-06-26 00:00:00");
+        workFlowRunRequestData.setFailureStrategy("CONTINUE");
+        workFlowRunRequestData.setWarningType("NONE");
+        workFlowRunRequestData.setWarningGroupId("");
+        workFlowRunRequestData.setExecType("START_PROCESS");
+        workFlowRunRequestData.setStartNodeList("");
+        workFlowRunRequestData.setTaskDependType("TASK_POST");
+        workFlowRunRequestData.setDependentMode("OFF_MODE");
+        workFlowRunRequestData.setRunMode("RUN_MODE_SERIAL");
+        workFlowRunRequestData.setProcessInstancePriority("MEDIUM");
+        workFlowRunRequestData.setWorkerGroup("default");
+        workFlowRunRequestData.setEnvironmentCode("");
+        workFlowRunRequestData.setStartParams("");
+        workFlowRunRequestData.setExpectedParallelismNumber("");
+        workFlowRunRequestData.setDryRun(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+"/executors/start-process-instance", headers, JSONUtils.convertValue(workFlowRunRequestData, Map.class));
+
+        logger.info("运行工作流:%s", res);
+        return res;
+
+    }
+
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/WorkFlowDefinitionPage.java:
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowCreateRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseTotalList;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowRunRequestData;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public final class WorkFlowDefinitionPage {
+    private static String genNumId = null;
+    private static String workFlowCode = null;
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.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) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowCreateRequestData workFlowCreateRequestData = new WorkFlowCreateRequestData();
+
+        String taskDefinitionJson = "[{\"code\":" + genNumId + ",\"delayTime\":\"0\",\"description\":\"\",\"environmentCode\":-1,\"failRetryInterval\":\"1\",\"failRetryTimes\":\"0\",\"flag\":\"YES\",\"name\":\"echo_123\",\"taskParams\":{\"localParams\":[],\"rawScript\":\"echo 123\",\"resourceList\":[]},\"taskPriority\":\"MEDIUM\",\"taskType\":\"SHELL\",\"timeout\":0,\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"workerGroup\":\"default\"}]";
+        String taskRelationJson = "[{\"name\":\"\",\"preTaskCode\":0,\"preTaskVersion\":0,\"postTaskCode\":"+ genNumId + ",\"postTaskVersion\":0,\"conditionType\":\"NONE\",\"conditionParams\":{}}]";
+        String locations = "[{\"taskCode\":" + genNumId +",\"x\":33.5,\"y\":38.5}]";
+        workFlowCreateRequestData.setTaskDefinitionJson(taskDefinitionJson);
+        workFlowCreateRequestData.setTaskRelationJson(taskRelationJson);
+        workFlowCreateRequestData.setLocations(locations);
+        workFlowCreateRequestData.setName(workFlowName);
+        workFlowCreateRequestData.setTenantCode("admin");
+        workFlowCreateRequestData.setExecutionType("PARALLEL");
+        workFlowCreateRequestData.setDescription("");
+        workFlowCreateRequestData.setGlobalParams("[]");
+        workFlowCreateRequestData.setTimeout(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));
+        logger.info("创建工作流结果:%s", res);
+        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);
+
+        logger.info("查询工作流结果:%s\n", res);

Review Comment:
   Same as line 86.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/entity/TaskInstanceResponseTotalList.java:
##########
@@ -0,0 +1,135 @@
+/*
+ * 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.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class TaskInstanceResponseTotalList {
+
+    private String alertFlag;
+
+    private String appLink;
+
+    private boolean blockingTask;
+
+    private boolean conditionsTask;
+
+    private Integer delayTime;
+
+    private boolean dependTask;
+
+    private String dependency;
+
+    private String dependentResult;
+
+    private Integer dryRun;
+
+    private String duration;
+
+    private Date endTime;
+
+    private String environmentCode;
+
+    private String environmentConfig;
+
+    private String executePath;
+
+    private String executorId;
+
+    private String executorName;
+
+    private boolean firstRun;
+
+    private Date firstSubmitTime;
+
+    private String flag;
+
+    private String host;
+
+    private Integer id;
+
+    private String logPath;
+
+    private Integer maxRetryTimes;
+
+    private String name;
+
+    private Integer pid;
+
+    private String processDefine;
+
+    private String processInstance;
+
+    private Integer processInstanceId;
+
+    private String processInstanceName;
+
+    private String processInstancePriority;
+
+    private String resources;
+
+    private Integer retryInterval;
+
+    private Integer retryTimes;
+
+    private Date startTime;
+
+    private String state;
+
+    private boolean subProcess;
+
+    private Date submitTime;
+
+    private String switchDependency;
+
+    private boolean switchTask;
+
+    private String taskCode;
+
+    private boolean taskComplete;
+
+    private String taskDefine;
+
+    private Integer taskDefinitionVersion;
+
+    private Integer taskGroupId;
+
+    private Integer taskGroupPriority;
+
+    private String taskInstancePriority;
+
+    private String taskParams;
+
+    private String taskType;
+
+    private String varPool;
+
+    private String workerGroup;
+
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/entity/TaskInstanceResponseData.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class TaskInstanceResponseData {
+
+    private Integer currentPage;
+
+    private Integer pageSize;
+
+    private Integer start;
+
+    private Integer total;
+
+    private List<TaskInstanceResponseTotalList> totalList;
+
+    private Integer totalPage;
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/WorkFlowDefinitionPage.java:
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowCreateRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseTotalList;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowRunRequestData;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public final class WorkFlowDefinitionPage {
+    private static String genNumId = null;
+    private static String workFlowCode = null;
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.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) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowCreateRequestData workFlowCreateRequestData = new WorkFlowCreateRequestData();
+
+        String taskDefinitionJson = "[{\"code\":" + genNumId + ",\"delayTime\":\"0\",\"description\":\"\",\"environmentCode\":-1,\"failRetryInterval\":\"1\",\"failRetryTimes\":\"0\",\"flag\":\"YES\",\"name\":\"echo_123\",\"taskParams\":{\"localParams\":[],\"rawScript\":\"echo 123\",\"resourceList\":[]},\"taskPriority\":\"MEDIUM\",\"taskType\":\"SHELL\",\"timeout\":0,\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"workerGroup\":\"default\"}]";
+        String taskRelationJson = "[{\"name\":\"\",\"preTaskCode\":0,\"preTaskVersion\":0,\"postTaskCode\":"+ genNumId + ",\"postTaskVersion\":0,\"conditionType\":\"NONE\",\"conditionParams\":{}}]";
+        String locations = "[{\"taskCode\":" + genNumId +",\"x\":33.5,\"y\":38.5}]";
+        workFlowCreateRequestData.setTaskDefinitionJson(taskDefinitionJson);
+        workFlowCreateRequestData.setTaskRelationJson(taskRelationJson);
+        workFlowCreateRequestData.setLocations(locations);
+        workFlowCreateRequestData.setName(workFlowName);
+        workFlowCreateRequestData.setTenantCode("admin");
+        workFlowCreateRequestData.setExecutionType("PARALLEL");
+        workFlowCreateRequestData.setDescription("");
+        workFlowCreateRequestData.setGlobalParams("[]");
+        workFlowCreateRequestData.setTimeout(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));
+        logger.info("创建工作流结果:%s", res);
+        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);
+
+        logger.info("查询工作流结果:%s\n", res);
+        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");
+        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/"+workFlowCode+"/release", headers, params);
+
+        logger.info("上线工作流:%s", res);
+        return res;
+
+    }
+
+    public HttpResponse runWorkflow(String sessionId, String projectName, String workFlowName){
+        WorkFlowDefinitionPage workflow = new WorkFlowDefinitionPage();
+        workflow.queryWorkflow(sessionId, projectName, workFlowName);
+        workflow.onLineWorkflow(sessionId, projectName, workFlowName);
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowRunRequestData workFlowRunRequestData = new WorkFlowRunRequestData();
+        workFlowRunRequestData.setProcessDefinitionCode(workFlowCode);
+        workFlowRunRequestData.setStartEndTime("2022-06-25T16:00:00.000Z");
+        workFlowRunRequestData.setScheduleTime("2022-06-26 00:00:00,2022-06-26 00:00:00");
+        workFlowRunRequestData.setFailureStrategy("CONTINUE");
+        workFlowRunRequestData.setWarningType("NONE");
+        workFlowRunRequestData.setWarningGroupId("");
+        workFlowRunRequestData.setExecType("START_PROCESS");
+        workFlowRunRequestData.setStartNodeList("");
+        workFlowRunRequestData.setTaskDependType("TASK_POST");
+        workFlowRunRequestData.setDependentMode("OFF_MODE");
+        workFlowRunRequestData.setRunMode("RUN_MODE_SERIAL");
+        workFlowRunRequestData.setProcessInstancePriority("MEDIUM");
+        workFlowRunRequestData.setWorkerGroup("default");
+        workFlowRunRequestData.setEnvironmentCode("");
+        workFlowRunRequestData.setStartParams("");
+        workFlowRunRequestData.setExpectedParallelismNumber("");
+        workFlowRunRequestData.setDryRun(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+"/executors/start-process-instance", headers, JSONUtils.convertValue(workFlowRunRequestData, Map.class));
+
+        logger.info("运行工作流:%s", res);

Review Comment:
   Same as line 86.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/entity/WorkFlowResponseTotalList.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class WorkFlowResponseTotalList {
+
+    private String code;
+
+    private Date createTime;
+
+    private String description;
+
+    private String executionType;
+
+    private String flag;
+
+    private Arrays globalParamList;
+
+    private HashMap globalParamMap;
+
+    private String globalParams;
+
+    private Integer id;
+
+    private String locations;
+
+    private String modifyBy;
+
+    private String name;
+
+    private String projectCode;
+
+    private String projectName;
+
+    private String releaseState;
+
+    private String scheduleReleaseState;
+
+    private String tenantCode;
+
+    private String tenantId;
+
+    private Integer timeout;
+
+    private Date updateTime;
+
+    private Integer userId;
+
+    private String userName;
+
+    private Integer version;
+
+    private Integer warningGroupId;
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/WorkFlowDefinitionPage.java:
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowCreateRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseTotalList;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowRunRequestData;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public final class WorkFlowDefinitionPage {
+    private static String genNumId = null;
+    private static String workFlowCode = null;
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.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) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowCreateRequestData workFlowCreateRequestData = new WorkFlowCreateRequestData();
+
+        String taskDefinitionJson = "[{\"code\":" + genNumId + ",\"delayTime\":\"0\",\"description\":\"\",\"environmentCode\":-1,\"failRetryInterval\":\"1\",\"failRetryTimes\":\"0\",\"flag\":\"YES\",\"name\":\"echo_123\",\"taskParams\":{\"localParams\":[],\"rawScript\":\"echo 123\",\"resourceList\":[]},\"taskPriority\":\"MEDIUM\",\"taskType\":\"SHELL\",\"timeout\":0,\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"workerGroup\":\"default\"}]";
+        String taskRelationJson = "[{\"name\":\"\",\"preTaskCode\":0,\"preTaskVersion\":0,\"postTaskCode\":"+ genNumId + ",\"postTaskVersion\":0,\"conditionType\":\"NONE\",\"conditionParams\":{}}]";
+        String locations = "[{\"taskCode\":" + genNumId +",\"x\":33.5,\"y\":38.5}]";

Review Comment:
   We should use entities instead of writing json directly.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/ProjectAPITest.java:
##########
@@ -0,0 +1,83 @@
+/*
+ * 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 lombok.extern.slf4j.Slf4j;
+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.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@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 = "wen";
+
+    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(99)
+    public void testCreateProject() {
+        ProjectPage projectPage = new ProjectPage();
+
+        HttpResponse createProjectHttpResponse = projectPage.createProject(sessionId, projectName, "123", user);
+        logger.info(String.valueOf(createProjectHttpResponse.body()));
+        Assertions.assertTrue(createProjectHttpResponse.body().success());
+    }
+
+    @Test
+    @Order(1)
+    public void testQeuryProject() {
+        ProjectPage projectPage = new ProjectPage();
+
+        String aa = projectPage.getProjectCode(sessionId, projectName);
+        System.out.println(aa);
+    }

Review Comment:
   Please arrange the test methods according to the execution order.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/WorkFlowDefinitionPage.java:
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowCreateRequestData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseTotalList;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowResponseData;
+import org.apache.dolphinscheduler.api.test.entity.WorkFlowRunRequestData;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public final class WorkFlowDefinitionPage {
+    private static String genNumId = null;
+    private static String workFlowCode = null;
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.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) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+
+        WorkFlowCreateRequestData workFlowCreateRequestData = new WorkFlowCreateRequestData();
+
+        String taskDefinitionJson = "[{\"code\":" + genNumId + ",\"delayTime\":\"0\",\"description\":\"\",\"environmentCode\":-1,\"failRetryInterval\":\"1\",\"failRetryTimes\":\"0\",\"flag\":\"YES\",\"name\":\"echo_123\",\"taskParams\":{\"localParams\":[],\"rawScript\":\"echo 123\",\"resourceList\":[]},\"taskPriority\":\"MEDIUM\",\"taskType\":\"SHELL\",\"timeout\":0,\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"workerGroup\":\"default\"}]";
+        String taskRelationJson = "[{\"name\":\"\",\"preTaskCode\":0,\"preTaskVersion\":0,\"postTaskCode\":"+ genNumId + ",\"postTaskVersion\":0,\"conditionType\":\"NONE\",\"conditionParams\":{}}]";
+        String locations = "[{\"taskCode\":" + genNumId +",\"x\":33.5,\"y\":38.5}]";
+        workFlowCreateRequestData.setTaskDefinitionJson(taskDefinitionJson);
+        workFlowCreateRequestData.setTaskRelationJson(taskRelationJson);
+        workFlowCreateRequestData.setLocations(locations);
+        workFlowCreateRequestData.setName(workFlowName);
+        workFlowCreateRequestData.setTenantCode("admin");
+        workFlowCreateRequestData.setExecutionType("PARALLEL");
+        workFlowCreateRequestData.setDescription("");
+        workFlowCreateRequestData.setGlobalParams("[]");
+        workFlowCreateRequestData.setTimeout(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));
+        logger.info("创建工作流结果:%s", res);

Review Comment:
   Use English instead of Chinese.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/TaskInstancePage.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.TaskInstanceResponseData;
+import org.apache.dolphinscheduler.api.test.entity.TaskInstanceResponseTotalList;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+public final class TaskInstancePage {
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.class);
+    private static String taskState = null;
+    private static Integer taskInstanceId = null;
+
+    public String queryTaskInstance(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", "");
+        params.put("processInstanceId", "");
+        params.put("host", "");
+        params.put("stateType", "");
+        params.put("startDate", "");
+        params.put("endDate", "");
+        params.put("executorName", "");
+        params.put("processInstanceName", workFlowName);
+
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+        RequestClient requestClient = new RequestClient();
+        ProjectPage project = new ProjectPage();
+        String projectCode = project.getProjectCode(sessionId, projectName);
+
+        WorkFlowDefinitionPage workflow = new WorkFlowDefinitionPage();
+        workflow.runWorkflow(sessionId, projectName, workFlowName);
+
+        HttpResponse res = requestClient.get("/projects/"+projectCode+"/task-instances", headers, params);
+
+
+        for (TaskInstanceResponseTotalList taskInstanceRes : JSONUtils.convertValue(res.body().data(), TaskInstanceResponseData.class).totalList()) {
+
+            taskState =  taskInstanceRes.state();
+            taskInstanceId = taskInstanceRes.id();
+        }
+
+        logger.info("查询task状态:%s", taskState);
+        return taskState;
+
+    }
+
+
+    public HttpResponse queryTaskInstanceLog(String sessionId, String projectName, String workFlowName){
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+        RequestClient requestClient = new RequestClient();
+        TaskInstancePage taskInstance = new TaskInstancePage();
+        taskInstance.queryTaskInstance(sessionId, projectName, workFlowName);
+
+        params.put("taskInstanceId", taskInstanceId);
+        params.put("limit", 1000);
+        params.put("skipLineNum", 0);
+
+        HttpResponse res = requestClient.get("/log/detail", headers, params);
+        String res_log = (String) res.body().data();
+
+        logger.info("查询实例log:%s", res_log);
+
+        return res;
+
+    }
+
+
+
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/entity/WorkFlowResponseTotalList.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class WorkFlowResponseTotalList {
+
+    private String code;
+
+    private Date createTime;
+
+    private String description;
+
+    private String executionType;
+
+    private String flag;
+
+    private Arrays globalParamList;
+
+    private HashMap globalParamMap;

Review Comment:
   It's better to define generic types.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/pages/project/ProjectPage.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.ProjectAPITest;
+import org.apache.dolphinscheduler.api.test.core.Constants;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.ProjectListResponseData;
+import org.apache.dolphinscheduler.api.test.entity.ProjectListResponseTotalList;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.api.test.utils.RequestClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+public final class ProjectPage {
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.class);
+
+    public HttpResponse createProject(String sessionId, String projectName, String description, String userName) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+        params.put("projectName", projectName);
+        params.put("description", description);
+        params.put("userName", userName);
+
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+
+        RequestClient requestClient = new RequestClient();
+
+        return requestClient.post("/projects", headers, params);
+    }
+
+    public HttpResponse searchProject(String sessionId, String searchVal) {
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+        params.put("pageSize", 10);
+        params.put("pageNo", 1);
+        params.put("searchVal", searchVal);
+
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+
+        RequestClient requestClient = new RequestClient();
+
+        return requestClient.get("/projects", headers, params);
+    }
+
+    public String getProjectCode(String sessionId, String searchVal) {
+        String projectCode = null;
+        Map<String, Object> params = new HashMap<>();
+        Map<String, String> headers = new HashMap<>();
+        params.put("pageSize", 10);
+        params.put("pageNo", 1);
+        params.put("searchVal", searchVal);
+
+        headers.put(Constants.SESSION_ID_KEY, sessionId);
+
+        RequestClient requestClient = new RequestClient();
+
+        HttpResponse res = requestClient.get("/projects", headers, params);
+
+        logger.info("项目 %s", res);
+
+        for (ProjectListResponseTotalList ProjectListRes : JSONUtils.convertValue(res.body().data(), ProjectListResponseData.class).totalList()) {
+            logger.info(ProjectListRes.code());
+            projectCode =  ProjectListRes.code();
+        }
+        return projectCode;
+    }
+
+
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/entity/WorkFlowRunRequestData.java:
##########
@@ -0,0 +1,204 @@
+/*
+ * 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.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@AllArgsConstructor
+@NoArgsConstructor
+@Data
+public class WorkFlowRunRequestData {
+
+    private String processDefinitionCode;
+
+    private String startEndTime;
+
+    private String failureStrategy;
+
+    private String warningType;
+
+    private String warningGroupId;
+
+    private String execType;
+
+    private String startNodeList;
+
+    private String taskDependType;
+
+    private String dependentMode;
+
+    private String runMode;
+
+    private String processInstancePriority;
+
+    private String workerGroup;
+
+    private String environmentCode;
+
+    private String startParams;
+
+    private String expectedParallelismNumber;
+
+    private Integer dryRun;
+
+    private String scheduleTime;
+
+    public String getProcessDefinitionCode() {
+        return processDefinitionCode;
+    }
+
+    public String getStartEndTime() {
+        return startEndTime;
+    }
+
+    public String getFailureStrategy() {
+        return failureStrategy;
+    }
+
+    public String getWarningType() {
+        return warningType;
+    }
+
+    public String getWarningGroupId() {
+        return warningGroupId;
+    }
+
+    public String getExecType() {
+        return execType;
+    }
+
+    public String getStartNodeList() {
+        return startNodeList;
+    }
+
+    public String getTaskDependType() {
+        return taskDependType;
+    }
+
+    public String getDependentMode() {
+        return dependentMode;
+    }
+
+    public String getRunMode() {
+        return runMode;
+    }
+
+    public String getProcessInstancePriority() {
+        return processInstancePriority;
+    }
+
+    public String getWorkerGroup() {
+        return workerGroup;
+    }
+
+    public String getEnvironmentCode() {
+        return environmentCode;
+    }
+
+    public String getStartParams() {
+        return startParams;
+    }
+
+    public String getExpectedParallelismNumber() {
+        return expectedParallelismNumber;
+    }
+
+    public Integer getDryRun() {
+        return dryRun;
+    }
+
+    public String getScheduleTime() {
+        return scheduleTime;
+    }
+
+    public void setProcessDefinitionCode(String processDefinitionCode) {
+        this.processDefinitionCode = processDefinitionCode;
+    }
+
+    public void setStartEndTime(String startEndTime) {
+        this.startEndTime = startEndTime;
+    }
+
+    public void setFailureStrategy(String failureStrategy) {
+        this.failureStrategy = failureStrategy;
+    }
+
+    public void setWarningType(String warningType) {
+        this.warningType = warningType;
+    }
+
+    public void setWarningGroupId(String warningGroupId) {
+        this.warningGroupId = warningGroupId;
+    }
+
+    public void setExecType(String execType) {
+        this.execType = execType;
+    }
+
+    public void setStartNodeList(String startNodeList) {
+        this.startNodeList = startNodeList;
+    }
+
+    public void setTaskDependType(String taskDependType) {
+        this.taskDependType = taskDependType;
+    }
+
+    public void setDependentMode(String dependentMode) {
+        this.dependentMode = dependentMode;
+    }
+
+    public void setRunMode(String runMode) {
+        this.runMode = runMode;
+    }
+
+    public void setProcessInstancePriority(String processInstancePriority) {
+        this.processInstancePriority = processInstancePriority;
+    }
+
+    public void setWorkerGroup(String workerGroup) {
+        this.workerGroup = workerGroup;
+    }
+
+    public void setEnvironmentCode(String environmentCode) {
+        this.environmentCode = environmentCode;
+    }
+
+    public void setStartParams(String startParams) {
+        this.startParams = startParams;
+    }
+
+    public void setExpectedParallelismNumber(String expectedParallelismNumber) {
+        this.expectedParallelismNumber = expectedParallelismNumber;
+    }
+
+    public void setDryRun(Integer dryRun) {
+        this.dryRun = dryRun;
+    }
+
+    public void setScheduleTime(String scheduleTime) {
+        this.scheduleTime = scheduleTime;
+    }
+
+
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkFlowAPITest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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 lombok.extern.slf4j.Slf4j;
+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.WorkFlowDefinitionPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkFlowAPITest {
+    private static final Logger logger = LoggerFactory.getLogger(ProjectAPITest.class);
+
+    private static final String projectName = "wen";
+
+    private static final String workFlowName = "shell123";
+
+    private static final String user = "admin";
+
+    private static final String password = "dolphinscheduler123";
+
+    private static String sessionId = null;
+
+    private static String genNumId = 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(99)
+    public void testCreateWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId,"wen");
+        HttpResponse res = flow.createWorkflow(sessionId, projectName, workFlowName);
+        System.out.println(res);
+        System.out.println(res.body());
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(1)
+    public void testQueryWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        flow.getGenNumId(sessionId,"wen");
+        HttpResponse res = flow.queryWorkflow(sessionId, projectName, workFlowName);
+        System.out.println(res);
+        System.out.println(res.body());
+        Assertions.assertTrue(res.body().success());
+    }
+
+    @Test
+    @Order(98)
+    public void testOnlineWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.onLineWorkflow(sessionId, projectName, workFlowName);
+        System.out.println(res);
+        System.out.println(res.body());
+        Assertions.assertTrue(res.body().success());
+
+    }
+
+
+    @Test
+    @Order(97)
+    public void testRunWorkflow() {
+        WorkFlowDefinitionPage flow = new WorkFlowDefinitionPage();
+        HttpResponse res = flow.runWorkflow(sessionId, projectName, workFlowName);
+        System.out.println(res);
+        System.out.println(res.body());
+        Assertions.assertTrue(res.body().success());
+
+    }
+
+

Review Comment:
   Remove extra blank lines.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/ProjectAPITest.java:
##########
@@ -0,0 +1,83 @@
+/*
+ * 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 lombok.extern.slf4j.Slf4j;
+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.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@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 = "wen";
+
+    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(99)
+    public void testCreateProject() {
+        ProjectPage projectPage = new ProjectPage();
+
+        HttpResponse createProjectHttpResponse = projectPage.createProject(sessionId, projectName, "123", user);
+        logger.info(String.valueOf(createProjectHttpResponse.body()));
+        Assertions.assertTrue(createProjectHttpResponse.body().success());
+    }
+
+    @Test
+    @Order(1)
+    public void testQeuryProject() {
+        ProjectPage projectPage = new ProjectPage();
+
+        String aa = projectPage.getProjectCode(sessionId, projectName);

Review Comment:
   We should use names that represent specific meanings as variables rather than meaningless words.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/ProjectAPITest.java:
##########
@@ -0,0 +1,83 @@
+/*
+ * 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 lombok.extern.slf4j.Slf4j;
+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.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Assertions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@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 = "wen";
+
+    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(99)
+    public void testCreateProject() {
+        ProjectPage projectPage = new ProjectPage();
+
+        HttpResponse createProjectHttpResponse = projectPage.createProject(sessionId, projectName, "123", user);
+        logger.info(String.valueOf(createProjectHttpResponse.body()));
+        Assertions.assertTrue(createProjectHttpResponse.body().success());
+    }
+
+    @Test
+    @Order(1)
+    public void testQeuryProject() {
+        ProjectPage projectPage = new ProjectPage();
+
+        String aa = projectPage.getProjectCode(sessionId, projectName);
+        System.out.println(aa);

Review Comment:
   Please avoid using any of `system.out` in this.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org