|
@@ -1,226 +0,0 @@
|
|
|
-
|
|
|
- * Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
- * contributor license agreements. See the NOTICE file distributed with
|
|
|
- * this work for additional information regarding copyright ownership.
|
|
|
- * The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
- * (the "License"); you may not use this file except in compliance with
|
|
|
- * the License. You may obtain a copy of the License at
|
|
|
- *
|
|
|
- * http:
|
|
|
- *
|
|
|
- * Unless required by applicable law or agreed to in writing, software
|
|
|
- * distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
- * See the License for the specific language governing permissions and
|
|
|
- * limitations under the License.
|
|
|
- */
|
|
|
-package org.apache.dolphinscheduler.page.project;
|
|
|
-
|
|
|
-import org.apache.dolphinscheduler.common.PageCommon;
|
|
|
-import org.apache.dolphinscheduler.constant.TestConstant;
|
|
|
-import org.apache.dolphinscheduler.data.project.CreateWorkflowData;
|
|
|
-import org.apache.dolphinscheduler.locator.project.CreateWorkflowLocator;
|
|
|
-import org.apache.dolphinscheduler.locator.project.RunWorkflowLocator;
|
|
|
-import org.openqa.selenium.WebDriver;
|
|
|
-
|
|
|
-public class CreateWorkflowPage extends PageCommon {
|
|
|
- public CreateWorkflowPage(WebDriver driver) {
|
|
|
- super(driver);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * jump create workflow page
|
|
|
- */
|
|
|
-
|
|
|
- public boolean jumpWorkflowPage() throws InterruptedException {
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_PROJECT_NAME);
|
|
|
- Thread.sleep(TestConstant.ONE_THOUSAND);
|
|
|
-
|
|
|
- System.out.println("Click on workflow define to jump to workflow define page");
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE);
|
|
|
-
|
|
|
- return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
|
|
|
- }
|
|
|
-
|
|
|
- public boolean createWorkflow() throws InterruptedException {
|
|
|
- System.out.println("Click create workflow button");
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_CREATE_WORKFLOW_BUTTON);
|
|
|
-
|
|
|
- System.out.println("drag shell task");
|
|
|
-
|
|
|
- dragAndDrop(CreateWorkflowLocator.MOUSE_DOWN_AT_SHELL,CreateWorkflowLocator.MOUSE_MOVE_SHELL_AT_DAG);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_SHELL_TASK_NAME , CreateWorkflowData.SHELL_TASK_NAME);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_STOP_RUN_TYPE);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_NORMAL_RUN_TYPE);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_SHELL_TASK_DESCRIPTION , CreateWorkflowData.SHELL_TASK_DESCRIPTION);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_TASK_PRIORITY);
|
|
|
- clickElement(CreateWorkflowLocator.SELECT_TASK_PRIORITY);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_WORK_GROUP);
|
|
|
- clickElement(CreateWorkflowLocator.SELECT_WORK_GROUP);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.SELECT_FAIL_RETRIES_NUMBER);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.SELECT_FAIL_RETRIES_INTERVAL);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_TIMEOUT_ALARM);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.SELECT_TIMEOUT_FAIL);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CANCEL_TIMEOUT_ALARM);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.SELECT_TIMEOUT_ALARM);
|
|
|
-
|
|
|
-
|
|
|
- clearInput(CreateWorkflowLocator.SELECT_TIMEOUT);
|
|
|
- clearInput(CreateWorkflowLocator.SELECT_TIMEOUT);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.SELECT_TIMEOUT, CreateWorkflowData.INPUT_TIMEOUT);
|
|
|
-
|
|
|
-
|
|
|
- inputCodeMirror(CreateWorkflowLocator.CLICK_CODE_MIRROR, CreateWorkflowLocator.INPUT_SCRIPT, CreateWorkflowData.SHELL_SCRIPT);
|
|
|
- scrollToElementBottom(CreateWorkflowLocator.SCROLL_BOTTOM);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_CUSTOM_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_CUSTOM_PARAMETERS, CreateWorkflowData.INPUT_CUSTOM_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_CUSTOM_PARAMETERS_VALUE, CreateWorkflowData.INPUT_CUSTOM_PARAMETERS_VALUE);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_ADD_CUSTOM_PARAMETERS);
|
|
|
-
|
|
|
- scrollToElementBottom(CreateWorkflowLocator.SCROLL_BOTTOM);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_ADD_CUSTOM_PARAMETERS, CreateWorkflowData.INPUT_ADD_CUSTOM_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_ADD_CUSTOM_PARAMETERS_VALUE, CreateWorkflowData.INPUT_ADD_CUSTOM_PARAMETERS_VALUE);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_DELETE_CUSTOM_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_SUBMIT_BUTTON);
|
|
|
- Thread.sleep(TestConstant.ONE_THOUSAND);
|
|
|
- System.out.println("Task node set up successfully");
|
|
|
- System.out.println("move to Dag Element ");
|
|
|
- moveToDragElement(CreateWorkflowLocator.MOUSE_MOVE_SHELL_AT_DAG,-300,-100);
|
|
|
-
|
|
|
- return ifTitleContains(CreateWorkflowData.CREATE_WORKFLOW_TITLE);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * save workflow
|
|
|
- */
|
|
|
- public boolean saveWorkflow() throws InterruptedException {
|
|
|
- System.out.println("start to save workflow ");
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_SAVE_WORKFLOW_BUTTON);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_NAME, CreateWorkflowData.INPUT_WORKFLOW_NAME);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_DESCRIPTION, CreateWorkflowData.INPUT_WORKFLOW_DESCRIPTION);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_TENANT);
|
|
|
- clickElement(CreateWorkflowLocator.SELECT_TENANT);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_TIMEOUT_ALARM);
|
|
|
- clearInput(CreateWorkflowLocator.INPUT_WORKFLOW_TIMEOUT);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_TIMEOUT, CreateWorkflowData.INPUT_WORKFLOW_TIMEOUT);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_GLOBAL_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_GLOBAL_PARAMETERS, CreateWorkflowData.INPUT_WORKFLOW_GLOBAL_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_GLOBAL_PARAMETERS_VALUES, CreateWorkflowData.INPUT_WORKFLOW_GLOBAL_PARAMETERS_VALUES);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_ADD_WORKFLOW_GLOBAL_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS, CreateWorkflowData.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS);
|
|
|
-
|
|
|
-
|
|
|
- sendInput(CreateWorkflowLocator.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS_VALUES, CreateWorkflowData.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS_VALUES);
|
|
|
-
|
|
|
-
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_DELETE_WORKFLOW_GLOBAL_PARAMETERS);
|
|
|
- Thread.sleep(TestConstant.ONE_THOUSAND);
|
|
|
-
|
|
|
-
|
|
|
- System.out.println("submit workflow");
|
|
|
- clickButton(CreateWorkflowLocator.CLICK_ADD_BUTTON);
|
|
|
-
|
|
|
- return ifTitleContains(CreateWorkflowData.CREATE_WORKFLOW_TITLE);
|
|
|
- }
|
|
|
-
|
|
|
- public boolean onlineWorkflow() throws InterruptedException {
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE);
|
|
|
-
|
|
|
-
|
|
|
- System.out.println("Click online workflow button");
|
|
|
- clickButton(CreateWorkflowLocator.CLICK_ONLINE_WORKFLOW_BUTTON);
|
|
|
-
|
|
|
- return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
|
|
|
- }
|
|
|
-
|
|
|
- public boolean offlineWorkflow() throws InterruptedException {
|
|
|
- clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE);
|
|
|
-
|
|
|
-
|
|
|
- System.out.println("offline workflow");
|
|
|
- Thread.sleep(500);
|
|
|
- clickButton(CreateWorkflowLocator.CLICK_OFFLINE_WORKFLOW_BUTTON);
|
|
|
-
|
|
|
- return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public boolean deleteWorkflow() throws InterruptedException {
|
|
|
-
|
|
|
- Thread.sleep(500);
|
|
|
- clickButton(CreateWorkflowLocator.DELETE_WORKFLOW_BOTTOM);
|
|
|
-
|
|
|
-
|
|
|
- clickButton(CreateWorkflowLocator.CONFIRM_DELETE_WORKFLOW_BOTTOM);
|
|
|
-
|
|
|
-
|
|
|
- return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE);
|
|
|
- }
|
|
|
-}
|