BoYiZhang
4 years ago
committed by
GitHub
59 changed files with 1266 additions and 595 deletions
@ -1,25 +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://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. |
|
||||||
# |
|
||||||
dependencies: |
|
||||||
- name: postgresql |
|
||||||
version: 8.x.x |
|
||||||
repository: https://charts.bitnami.com/bitnami |
|
||||||
condition: postgresql.enabled |
|
||||||
- name: zookeeper |
|
||||||
version: 5.x.x |
|
||||||
repository: https://charts.bitnami.com/bitnami |
|
||||||
condition: redis.enabled |
|
@ -0,0 +1,35 @@ |
|||||||
|
# |
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one or more |
||||||
|
# contributor license agreements. See the NOTICE file distributed with |
||||||
|
# this work for additional information regarding copyright ownership. |
||||||
|
# The ASF licenses this file to You under the Apache License, Version 2.0 |
||||||
|
# (the "License"); you may not use this file except in compliance with |
||||||
|
# the License. You may obtain a copy of the License at |
||||||
|
# |
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0 |
||||||
|
# |
||||||
|
# Unless required by applicable law or agreed to in writing, software |
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
# See the License for the specific language governing permissions and |
||||||
|
# limitations under the License. |
||||||
|
# |
||||||
|
{{- if .Values.common.configmap }} |
||||||
|
apiVersion: v1 |
||||||
|
kind: ConfigMap |
||||||
|
metadata: |
||||||
|
name: {{ include "dolphinscheduler.fullname" . }}-common |
||||||
|
labels: |
||||||
|
app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-common |
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }} |
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }} |
||||||
|
data: |
||||||
|
DOLPHINSCHEDULER_ENV_PATH: {{ .Values.common.configmap.DOLPHINSCHEDULER_ENV_PATH | quote }} |
||||||
|
DOLPHINSCHEDULER_DATA_BASEDIR_PATH: {{ .Values.common.configmap.DOLPHINSCHEDULER_DATA_BASEDIR_PATH | quote }} |
||||||
|
RESOURCE_STORAGE_TYPE: {{ .Values.common.configmap.RESOURCE_STORAGE_TYPE | quote }} |
||||||
|
RESOURCE_UPLOAD_PATH: {{ .Values.common.configmap.RESOURCE_UPLOAD_PATH | quote }} |
||||||
|
FS_DEFAULT_FS: {{ .Values.common.configmap.FS_DEFAULT_FS | quote }} |
||||||
|
FS_S3A_ENDPOINT: {{ .Values.common.configmap.FS_S3A_ENDPOINT | quote }} |
||||||
|
FS_S3A_ACCESS_KEY: {{ .Values.common.configmap.FS_S3A_ACCESS_KEY | quote }} |
||||||
|
FS_S3A_SECRET_KEY: {{ .Values.common.configmap.FS_S3A_SECRET_KEY | quote }} |
||||||
|
{{- end }} |
@ -0,0 +1,25 @@ |
|||||||
|
/* |
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||||
|
* contributor license agreements. See the NOTICE file distributed with |
||||||
|
* this work for additional information regarding copyright ownership. |
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||||
|
* (the "License"); you may not use this file except in compliance with |
||||||
|
* the License. You may obtain a copy of the License at |
||||||
|
* |
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
* See the License for the specific language governing permissions and |
||||||
|
* limitations under the License. |
||||||
|
*/ |
||||||
|
package org.apache.dolphinscheduler.data.project; |
||||||
|
|
||||||
|
public class ProcessInstanceData { |
||||||
|
//Process Instance page title
|
||||||
|
public static final String PROCESS_INSTANCE_TITLE = "工作流实例 - DolphinScheduler"; |
||||||
|
public static final String RERUN_TYPE= "重跑"; |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
/* |
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||||
|
* contributor license agreements. See the NOTICE file distributed with |
||||||
|
* this work for additional information regarding copyright ownership. |
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||||
|
* (the "License"); you may not use this file except in compliance with |
||||||
|
* the License. You may obtain a copy of the License at |
||||||
|
* |
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
* See the License for the specific language governing permissions and |
||||||
|
* limitations under the License. |
||||||
|
*/ |
||||||
|
package org.apache.dolphinscheduler.locator.project; |
||||||
|
|
||||||
|
import org.openqa.selenium.By; |
||||||
|
|
||||||
|
public class ProcessInstanceLocator { |
||||||
|
// jump Process Instance page
|
||||||
|
//click Process Instance name
|
||||||
|
public static final By CLICK_PROCESS_INSTANCE_NAME = By.xpath("//div[3]/div/ul/li[2]"); |
||||||
|
|
||||||
|
// click rerun button
|
||||||
|
public static final By CLICK_RERUN_BUTTON = By.xpath("//tr[2]/td[14]/div[1]/button[2]"); |
||||||
|
|
||||||
|
//assert rerun type
|
||||||
|
public static final By RUNNING_TYPE = By.xpath("//tr[2]/td[5]/span"); |
||||||
|
} |
@ -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://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
* |
|
||||||
* Unless required by applicable law or agreed to in writing, software |
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, |
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
||||||
* See the License for the specific language governing permissions and |
|
||||||
* limitations under the License. |
|
||||||
*/ |
|
||||||
package org.apache.dolphinscheduler.page.project; |
|
||||||
|
|
||||||
import org.apache.dolphinscheduler.common.PageCommon; |
|
||||||
import org.apache.dolphinscheduler.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 { |
|
||||||
// click project name
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_PROJECT_NAME); |
|
||||||
Thread.sleep(TestConstant.ONE_THOUSAND); |
|
||||||
|
|
||||||
System.out.println("Click on workflow define to jump to workflow define page"); |
|
||||||
// click workflow define
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE); |
|
||||||
|
|
||||||
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE); |
|
||||||
} |
|
||||||
|
|
||||||
public boolean createWorkflow() throws InterruptedException { |
|
||||||
System.out.println("Click create workflow button"); |
|
||||||
// click create workflow button
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_CREATE_WORKFLOW_BUTTON); |
|
||||||
|
|
||||||
System.out.println("drag shell task"); |
|
||||||
//drag shell_task
|
|
||||||
dragAndDrop(CreateWorkflowLocator.MOUSE_DOWN_AT_SHELL,CreateWorkflowLocator.MOUSE_MOVE_SHELL_AT_DAG); |
|
||||||
|
|
||||||
//input shell task _name
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_SHELL_TASK_NAME , CreateWorkflowData.SHELL_TASK_NAME); |
|
||||||
|
|
||||||
//click stop run type
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_STOP_RUN_TYPE); |
|
||||||
|
|
||||||
//click normal run type
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_NORMAL_RUN_TYPE); |
|
||||||
|
|
||||||
//input shell task description
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_SHELL_TASK_DESCRIPTION , CreateWorkflowData.SHELL_TASK_DESCRIPTION); |
|
||||||
|
|
||||||
//select task priority
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_TASK_PRIORITY); |
|
||||||
clickElement(CreateWorkflowLocator.SELECT_TASK_PRIORITY); |
|
||||||
|
|
||||||
//select work group
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_WORK_GROUP); |
|
||||||
clickElement(CreateWorkflowLocator.SELECT_WORK_GROUP); |
|
||||||
|
|
||||||
//select number of failed retries
|
|
||||||
clickElement(CreateWorkflowLocator.SELECT_FAIL_RETRIES_NUMBER); |
|
||||||
|
|
||||||
//select failed retry interval
|
|
||||||
clickElement(CreateWorkflowLocator.SELECT_FAIL_RETRIES_INTERVAL); |
|
||||||
|
|
||||||
//click timeout alarm
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_TIMEOUT_ALARM); |
|
||||||
|
|
||||||
//select timeout fail
|
|
||||||
clickElement(CreateWorkflowLocator.SELECT_TIMEOUT_FAIL); |
|
||||||
|
|
||||||
//cancel timeout alarm
|
|
||||||
clickElement(CreateWorkflowLocator.CANCEL_TIMEOUT_ALARM); |
|
||||||
|
|
||||||
//select timeout alarm
|
|
||||||
clickElement(CreateWorkflowLocator.SELECT_TIMEOUT_ALARM); |
|
||||||
|
|
||||||
//clear timeout
|
|
||||||
clearInput(CreateWorkflowLocator.SELECT_TIMEOUT); |
|
||||||
clearInput(CreateWorkflowLocator.SELECT_TIMEOUT); |
|
||||||
|
|
||||||
//input timeout
|
|
||||||
sendInput(CreateWorkflowLocator.SELECT_TIMEOUT, CreateWorkflowData.INPUT_TIMEOUT); |
|
||||||
|
|
||||||
//click codeMirror and input script
|
|
||||||
inputCodeMirror(CreateWorkflowLocator.CLICK_CODE_MIRROR, CreateWorkflowLocator.INPUT_SCRIPT, CreateWorkflowData.SHELL_SCRIPT); |
|
||||||
scrollToElementBottom(CreateWorkflowLocator.SCROLL_BOTTOM); |
|
||||||
|
|
||||||
//click custom parameters
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_CUSTOM_PARAMETERS); |
|
||||||
|
|
||||||
//input custom parameters
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_CUSTOM_PARAMETERS, CreateWorkflowData.INPUT_CUSTOM_PARAMETERS); |
|
||||||
|
|
||||||
//input custom parameters value
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_CUSTOM_PARAMETERS_VALUE, CreateWorkflowData.INPUT_CUSTOM_PARAMETERS_VALUE); |
|
||||||
|
|
||||||
//click add custom parameters
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_ADD_CUSTOM_PARAMETERS); |
|
||||||
|
|
||||||
scrollToElementBottom(CreateWorkflowLocator.SCROLL_BOTTOM); |
|
||||||
|
|
||||||
//input add custom parameters
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_ADD_CUSTOM_PARAMETERS, CreateWorkflowData.INPUT_ADD_CUSTOM_PARAMETERS); |
|
||||||
|
|
||||||
//input add custom parameters value
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_ADD_CUSTOM_PARAMETERS_VALUE, CreateWorkflowData.INPUT_ADD_CUSTOM_PARAMETERS_VALUE); |
|
||||||
|
|
||||||
//click delete custom parameters
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_DELETE_CUSTOM_PARAMETERS); |
|
||||||
|
|
||||||
//click submit button
|
|
||||||
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 "); |
|
||||||
|
|
||||||
//click save workflow button
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_SAVE_WORKFLOW_BUTTON); |
|
||||||
|
|
||||||
//input workflow name
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_NAME, CreateWorkflowData.INPUT_WORKFLOW_NAME); |
|
||||||
|
|
||||||
//input workflow description
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_DESCRIPTION, CreateWorkflowData.INPUT_WORKFLOW_DESCRIPTION); |
|
||||||
|
|
||||||
//select tenant
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_TENANT); |
|
||||||
clickElement(CreateWorkflowLocator.SELECT_TENANT); |
|
||||||
|
|
||||||
//click workflow timeout alarm
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_TIMEOUT_ALARM); |
|
||||||
clearInput(CreateWorkflowLocator.INPUT_WORKFLOW_TIMEOUT); |
|
||||||
|
|
||||||
//input workflow timeout
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_TIMEOUT, CreateWorkflowData.INPUT_WORKFLOW_TIMEOUT); |
|
||||||
|
|
||||||
//click workflow global parameters
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_GLOBAL_PARAMETERS); |
|
||||||
|
|
||||||
//input workflow global parameters
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_GLOBAL_PARAMETERS, CreateWorkflowData.INPUT_WORKFLOW_GLOBAL_PARAMETERS); |
|
||||||
|
|
||||||
//input workflow global parameters value
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_WORKFLOW_GLOBAL_PARAMETERS_VALUES, CreateWorkflowData.INPUT_WORKFLOW_GLOBAL_PARAMETERS_VALUES); |
|
||||||
|
|
||||||
//click to add workflow global parameters
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_ADD_WORKFLOW_GLOBAL_PARAMETERS); |
|
||||||
|
|
||||||
//input to add workflow global parameters
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS, CreateWorkflowData.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS); |
|
||||||
|
|
||||||
//input to add workflow global parameters value
|
|
||||||
sendInput(CreateWorkflowLocator.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS_VALUES, CreateWorkflowData.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS_VALUES); |
|
||||||
|
|
||||||
//delete workflow global parameters value
|
|
||||||
clickElement(CreateWorkflowLocator.CLICK_DELETE_WORKFLOW_GLOBAL_PARAMETERS); |
|
||||||
Thread.sleep(TestConstant.ONE_THOUSAND); |
|
||||||
|
|
||||||
//click add button
|
|
||||||
System.out.println("submit workflow"); |
|
||||||
clickButton(CreateWorkflowLocator.CLICK_ADD_BUTTON); |
|
||||||
|
|
||||||
return ifTitleContains(CreateWorkflowData.CREATE_WORKFLOW_TITLE); |
|
||||||
} |
|
||||||
|
|
||||||
public boolean onlineWorkflow() throws InterruptedException { |
|
||||||
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE); |
|
||||||
|
|
||||||
// click online button
|
|
||||||
System.out.println("Click online workflow button"); |
|
||||||
clickButton(CreateWorkflowLocator.CLICK_ONLINE_WORKFLOW_BUTTON); |
|
||||||
|
|
||||||
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE); |
|
||||||
} |
|
||||||
|
|
||||||
public boolean offlineWorkflow() throws InterruptedException { |
|
||||||
clickElement(CreateWorkflowLocator.CLICK_WORKFLOW_DEFINE); |
|
||||||
|
|
||||||
// click offline button
|
|
||||||
System.out.println("offline workflow"); |
|
||||||
Thread.sleep(500); |
|
||||||
clickButton(CreateWorkflowLocator.CLICK_OFFLINE_WORKFLOW_BUTTON); |
|
||||||
|
|
||||||
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
public boolean deleteWorkflow() throws InterruptedException { |
|
||||||
//click delete workflow
|
|
||||||
Thread.sleep(500); |
|
||||||
clickButton(CreateWorkflowLocator.DELETE_WORKFLOW_BOTTOM); |
|
||||||
|
|
||||||
//click confirm delete project
|
|
||||||
clickButton(CreateWorkflowLocator.CONFIRM_DELETE_WORKFLOW_BOTTOM); |
|
||||||
|
|
||||||
// Whether to enter the specified page after submit
|
|
||||||
return ifTitleContains(CreateWorkflowData.WORKFLOW_TITLE); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,40 @@ |
|||||||
|
/* |
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||||
|
* contributor license agreements. See the NOTICE file distributed with |
||||||
|
* this work for additional information regarding copyright ownership. |
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||||
|
* (the "License"); you may not use this file except in compliance with |
||||||
|
* the License. You may obtain a copy of the License at |
||||||
|
* |
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
* See the License for the specific language governing permissions and |
||||||
|
* limitations under the License. |
||||||
|
*/ |
||||||
|
package org.apache.dolphinscheduler.page.project; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.common.PageCommon; |
||||||
|
import org.apache.dolphinscheduler.locator.project.ProcessInstanceLocator; |
||||||
|
import org.openqa.selenium.WebDriver; |
||||||
|
import org.apache.dolphinscheduler.data.project.ProcessInstanceData; |
||||||
|
|
||||||
|
|
||||||
|
public class ProcessInstancePage extends PageCommon { |
||||||
|
public ProcessInstancePage(WebDriver driver) { |
||||||
|
super(driver); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* rerun workflow page |
||||||
|
*/ |
||||||
|
public boolean rerunWorkflowPage() throws InterruptedException { |
||||||
|
clickTopElement(ProcessInstanceLocator.CLICK_PROCESS_INSTANCE_NAME); |
||||||
|
clickTopElement(ProcessInstanceLocator.CLICK_RERUN_BUTTON); |
||||||
|
return ifTitleContains(ProcessInstanceData.PROCESS_INSTANCE_TITLE); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,226 @@ |
|||||||
|
/* |
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||||
|
* contributor license agreements. See the NOTICE file distributed with |
||||||
|
* this work for additional information regarding copyright ownership. |
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||||
|
* (the "License"); you may not use this file except in compliance with |
||||||
|
* the License. You may obtain a copy of the License at |
||||||
|
* |
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
* See the License for the specific language governing permissions and |
||||||
|
* limitations under the License. |
||||||
|
*/ |
||||||
|
package org.apache.dolphinscheduler.page.project; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.common.PageCommon; |
||||||
|
import org.apache.dolphinscheduler.constant.TestConstant; |
||||||
|
import org.apache.dolphinscheduler.data.project.WorkflowDefineData; |
||||||
|
import org.apache.dolphinscheduler.locator.project.WorkflowDefineLocator; |
||||||
|
import org.openqa.selenium.WebDriver; |
||||||
|
|
||||||
|
public class WorkflowDefinePage extends PageCommon { |
||||||
|
public WorkflowDefinePage(WebDriver driver) { |
||||||
|
super(driver); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* jump create workflow page |
||||||
|
*/ |
||||||
|
|
||||||
|
public boolean jumpWorkflowPage() throws InterruptedException { |
||||||
|
// click project name
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_PROJECT_NAME); |
||||||
|
Thread.sleep(TestConstant.ONE_THOUSAND); |
||||||
|
|
||||||
|
System.out.println("Click on workflow define to jump to workflow define page"); |
||||||
|
// click workflow define
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_WORKFLOW_DEFINE); |
||||||
|
|
||||||
|
return ifTitleContains(WorkflowDefineData.WORKFLOW_TITLE); |
||||||
|
} |
||||||
|
|
||||||
|
public boolean createWorkflow() throws InterruptedException { |
||||||
|
System.out.println("Click create workflow button"); |
||||||
|
// click create workflow button
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_CREATE_WORKFLOW_BUTTON); |
||||||
|
|
||||||
|
System.out.println("drag shell task"); |
||||||
|
//drag shell_task
|
||||||
|
dragAndDrop(WorkflowDefineLocator.MOUSE_DOWN_AT_SHELL, WorkflowDefineLocator.MOUSE_MOVE_SHELL_AT_DAG); |
||||||
|
|
||||||
|
//input shell task _name
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_SHELL_TASK_NAME , WorkflowDefineData.SHELL_TASK_NAME); |
||||||
|
|
||||||
|
//click stop run type
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_STOP_RUN_TYPE); |
||||||
|
|
||||||
|
//click normal run type
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_NORMAL_RUN_TYPE); |
||||||
|
|
||||||
|
//input shell task description
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_SHELL_TASK_DESCRIPTION , WorkflowDefineData.SHELL_TASK_DESCRIPTION); |
||||||
|
|
||||||
|
//select task priority
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_TASK_PRIORITY); |
||||||
|
clickElement(WorkflowDefineLocator.SELECT_TASK_PRIORITY); |
||||||
|
|
||||||
|
//select work group
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_WORK_GROUP); |
||||||
|
clickElement(WorkflowDefineLocator.SELECT_WORK_GROUP); |
||||||
|
|
||||||
|
//select number of failed retries
|
||||||
|
clickElement(WorkflowDefineLocator.SELECT_FAIL_RETRIES_NUMBER); |
||||||
|
|
||||||
|
//select failed retry interval
|
||||||
|
clickElement(WorkflowDefineLocator.SELECT_FAIL_RETRIES_INTERVAL); |
||||||
|
|
||||||
|
//click timeout alarm
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_TIMEOUT_ALARM); |
||||||
|
|
||||||
|
//select timeout fail
|
||||||
|
clickElement(WorkflowDefineLocator.SELECT_TIMEOUT_FAIL); |
||||||
|
|
||||||
|
//cancel timeout alarm
|
||||||
|
clickElement(WorkflowDefineLocator.CANCEL_TIMEOUT_ALARM); |
||||||
|
|
||||||
|
//select timeout alarm
|
||||||
|
clickElement(WorkflowDefineLocator.SELECT_TIMEOUT_ALARM); |
||||||
|
|
||||||
|
//clear timeout
|
||||||
|
clearInput(WorkflowDefineLocator.SELECT_TIMEOUT); |
||||||
|
clearInput(WorkflowDefineLocator.SELECT_TIMEOUT); |
||||||
|
|
||||||
|
//input timeout
|
||||||
|
sendInput(WorkflowDefineLocator.SELECT_TIMEOUT, WorkflowDefineData.INPUT_TIMEOUT); |
||||||
|
|
||||||
|
//click codeMirror and input script
|
||||||
|
inputCodeMirror(WorkflowDefineLocator.CLICK_CODE_MIRROR, WorkflowDefineLocator.INPUT_SCRIPT, WorkflowDefineData.SHELL_SCRIPT); |
||||||
|
scrollToElementBottom(WorkflowDefineLocator.SCROLL_BOTTOM); |
||||||
|
|
||||||
|
//click custom parameters
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_CUSTOM_PARAMETERS); |
||||||
|
|
||||||
|
//input custom parameters
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_CUSTOM_PARAMETERS, WorkflowDefineData.INPUT_CUSTOM_PARAMETERS); |
||||||
|
|
||||||
|
//input custom parameters value
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_CUSTOM_PARAMETERS_VALUE, WorkflowDefineData.INPUT_CUSTOM_PARAMETERS_VALUE); |
||||||
|
|
||||||
|
//click add custom parameters
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_ADD_CUSTOM_PARAMETERS); |
||||||
|
|
||||||
|
scrollToElementBottom(WorkflowDefineLocator.SCROLL_BOTTOM); |
||||||
|
|
||||||
|
//input add custom parameters
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_ADD_CUSTOM_PARAMETERS, WorkflowDefineData.INPUT_ADD_CUSTOM_PARAMETERS); |
||||||
|
|
||||||
|
//input add custom parameters value
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_ADD_CUSTOM_PARAMETERS_VALUE, WorkflowDefineData.INPUT_ADD_CUSTOM_PARAMETERS_VALUE); |
||||||
|
|
||||||
|
//click delete custom parameters
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_DELETE_CUSTOM_PARAMETERS); |
||||||
|
|
||||||
|
//click submit button
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_SUBMIT_BUTTON); |
||||||
|
Thread.sleep(TestConstant.ONE_THOUSAND); |
||||||
|
System.out.println("Task node set up successfully"); |
||||||
|
System.out.println("move to Dag Element "); |
||||||
|
moveToDragElement(WorkflowDefineLocator.MOUSE_MOVE_SHELL_AT_DAG,-300,-100); |
||||||
|
|
||||||
|
return ifTitleContains(WorkflowDefineData.CREATE_WORKFLOW_TITLE); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* save workflow |
||||||
|
*/ |
||||||
|
public boolean saveWorkflow() throws InterruptedException { |
||||||
|
System.out.println("start to save workflow "); |
||||||
|
|
||||||
|
//click save workflow button
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_SAVE_WORKFLOW_BUTTON); |
||||||
|
|
||||||
|
//input workflow name
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_WORKFLOW_NAME, WorkflowDefineData.INPUT_WORKFLOW_NAME); |
||||||
|
|
||||||
|
//input workflow description
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_WORKFLOW_DESCRIPTION, WorkflowDefineData.INPUT_WORKFLOW_DESCRIPTION); |
||||||
|
|
||||||
|
//select tenant
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_TENANT); |
||||||
|
clickElement(WorkflowDefineLocator.SELECT_TENANT); |
||||||
|
|
||||||
|
//click workflow timeout alarm
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_WORKFLOW_TIMEOUT_ALARM); |
||||||
|
clearInput(WorkflowDefineLocator.INPUT_WORKFLOW_TIMEOUT); |
||||||
|
|
||||||
|
//input workflow timeout
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_WORKFLOW_TIMEOUT, WorkflowDefineData.INPUT_WORKFLOW_TIMEOUT); |
||||||
|
|
||||||
|
//click workflow global parameters
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_WORKFLOW_GLOBAL_PARAMETERS); |
||||||
|
|
||||||
|
//input workflow global parameters
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_WORKFLOW_GLOBAL_PARAMETERS, WorkflowDefineData.INPUT_WORKFLOW_GLOBAL_PARAMETERS); |
||||||
|
|
||||||
|
//input workflow global parameters value
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_WORKFLOW_GLOBAL_PARAMETERS_VALUES, WorkflowDefineData.INPUT_WORKFLOW_GLOBAL_PARAMETERS_VALUES); |
||||||
|
|
||||||
|
//click to add workflow global parameters
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_ADD_WORKFLOW_GLOBAL_PARAMETERS); |
||||||
|
|
||||||
|
//input to add workflow global parameters
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS, WorkflowDefineData.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS); |
||||||
|
|
||||||
|
//input to add workflow global parameters value
|
||||||
|
sendInput(WorkflowDefineLocator.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS_VALUES, WorkflowDefineData.INPUT_ADD_WORKFLOW_GLOBAL_PARAMETERS_VALUES); |
||||||
|
|
||||||
|
//delete workflow global parameters value
|
||||||
|
clickElement(WorkflowDefineLocator.CLICK_DELETE_WORKFLOW_GLOBAL_PARAMETERS); |
||||||
|
Thread.sleep(TestConstant.ONE_THOUSAND); |
||||||
|
|
||||||
|
//click add button
|
||||||
|
System.out.println("submit workflow"); |
||||||
|
clickButton(WorkflowDefineLocator.CLICK_ADD_BUTTON); |
||||||
|
|
||||||
|
return ifTitleContains(WorkflowDefineData.CREATE_WORKFLOW_TITLE); |
||||||
|
} |
||||||
|
|
||||||
|
public boolean onlineWorkflow() throws InterruptedException { |
||||||
|
clickElement(WorkflowDefineLocator.CLICK_WORKFLOW_DEFINE); |
||||||
|
|
||||||
|
// click online button
|
||||||
|
System.out.println("Click online workflow button"); |
||||||
|
clickButton(WorkflowDefineLocator.CLICK_ONLINE_WORKFLOW_BUTTON); |
||||||
|
|
||||||
|
return ifTitleContains(WorkflowDefineData.WORKFLOW_TITLE); |
||||||
|
} |
||||||
|
|
||||||
|
public boolean offlineWorkflow() throws InterruptedException { |
||||||
|
clickElement(WorkflowDefineLocator.CLICK_WORKFLOW_DEFINE); |
||||||
|
|
||||||
|
// click offline button
|
||||||
|
System.out.println("offline workflow"); |
||||||
|
Thread.sleep(500); |
||||||
|
clickButton(WorkflowDefineLocator.CLICK_OFFLINE_WORKFLOW_BUTTON); |
||||||
|
|
||||||
|
return ifTitleContains(WorkflowDefineData.WORKFLOW_TITLE); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public boolean deleteWorkflow() throws InterruptedException { |
||||||
|
//click delete workflow
|
||||||
|
Thread.sleep(500); |
||||||
|
clickElement(WorkflowDefineLocator.CLICK_WORKFLOW_DEFINE); |
||||||
|
clickButton(WorkflowDefineLocator.DELETE_WORKFLOW_BOTTOM); |
||||||
|
|
||||||
|
//click confirm delete project
|
||||||
|
clickButton(WorkflowDefineLocator.CONFIRM_DELETE_WORKFLOW_BOTTOM); |
||||||
|
|
||||||
|
// Whether to enter the specified page after submit
|
||||||
|
return ifTitleContains(WorkflowDefineData.WORKFLOW_TITLE); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
/* |
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||||
|
* contributor license agreements. See the NOTICE file distributed with |
||||||
|
* this work for additional information regarding copyright ownership. |
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||||
|
* (the "License"); you may not use this file except in compliance with |
||||||
|
* the License. You may obtain a copy of the License at |
||||||
|
* |
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
* See the License for the specific language governing permissions and |
||||||
|
* limitations under the License. |
||||||
|
*/ |
||||||
|
package org.apache.dolphinscheduler.testcase.testProject; |
||||||
|
|
||||||
|
import org.apache.dolphinscheduler.base.BaseTest; |
||||||
|
import org.apache.dolphinscheduler.page.project.ProcessInstancePage; |
||||||
|
import org.testng.annotations.Test; |
||||||
|
|
||||||
|
public class TestProcessInstance extends BaseTest { |
||||||
|
private ProcessInstancePage processInstancePage; |
||||||
|
|
||||||
|
@Test(groups={"functionTests","processInstance"},dependsOnGroups = { "login","workflow" },description = "testRerun") |
||||||
|
public void testRerun() throws InterruptedException { |
||||||
|
processInstancePage = new ProcessInstancePage(driver); |
||||||
|
//rerun workflow
|
||||||
|
System.out.println("start rerun workflow"); |
||||||
|
processInstancePage.rerunWorkflowPage(); |
||||||
|
System.out.println("end rerun workflow"); |
||||||
|
System.out.println("==================================="); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue