Browse Source

Merge pull request #2 from apache/dev

merge
pull/2/head
Simon 5 years ago committed by GitHub
parent
commit
0b11275880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
  2. 41
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SqoopJobType.java
  3. 87
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/SqoopParameters.java
  4. 2
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetMysqlParameter.java
  5. 6
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java
  6. 39
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/CommonGenerator.java
  7. 14
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/SqoopJobGenerator.java
  8. 14
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/sources/MysqlSourceGenerator.java
  9. 2
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/targets/MysqlTargetGenerator.java
  10. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue
  11. 292
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue
  12. 7
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  13. 7
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
  14. 24
      e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java
  15. 36
      e2e/src/test/java/org/apache/dolphinscheduler/data/security/AlertManageData.java
  16. 42
      e2e/src/test/java/org/apache/dolphinscheduler/data/security/QueueManageData.java
  17. 24
      e2e/src/test/java/org/apache/dolphinscheduler/data/security/TokenManageData.java
  18. 35
      e2e/src/test/java/org/apache/dolphinscheduler/locator/security/AlertManageLocator.java
  19. 31
      e2e/src/test/java/org/apache/dolphinscheduler/locator/security/QueueManageLocator.java
  20. 41
      e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java
  21. 77
      e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java
  22. 85
      e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java
  23. 94
      e2e/src/test/java/org/apache/dolphinscheduler/page/security/TokenManagePage.java
  24. 4
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/TestLogin.java
  25. 42
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteAlert.java
  26. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteProject.java
  27. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteTenant.java
  28. 42
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteToken.java
  29. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteUser.java
  30. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java
  31. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateProject.java
  32. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java
  33. 36
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestAlertManage.java
  34. 42
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestQueueManage.java
  35. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestTenantManage.java
  36. 43
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestTokenManage.java
  37. 6
      e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java
  38. 28
      e2e/testng.xml

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java

@ -218,7 +218,7 @@ public enum Status {
DATA_IS_NOT_VALID(50017,"data {0} not valid", "数据[{0}]无效"), DATA_IS_NOT_VALID(50017,"data {0} not valid", "数据[{0}]无效"),
DATA_IS_NULL(50018,"data {0} is null", "数据[{0}]不能为空"), DATA_IS_NULL(50018,"data {0} is null", "数据[{0}]不能为空"),
PROCESS_NODE_HAS_CYCLE(50019,"process node has cycle", "流程节点间存在循环依赖"), PROCESS_NODE_HAS_CYCLE(50019,"process node has cycle", "流程节点间存在循环依赖"),
PROCESS_NODE_S_PARAMETER_INVALID(50020,"process node %s parameter invalid", "流程节点[%s]参数无效"), PROCESS_NODE_S_PARAMETER_INVALID(50020,"process node {0} parameter invalid", "流程节点[{0}]参数无效"),
PROCESS_DEFINE_STATE_ONLINE(50021, "process definition {0} is already on line", "工作流定义[{0}]已上线"), PROCESS_DEFINE_STATE_ONLINE(50021, "process definition {0} is already on line", "工作流定义[{0}]已上线"),
DELETE_PROCESS_DEFINE_BY_ID_ERROR(50022,"delete process definition by id error", "删除工作流定义错误"), DELETE_PROCESS_DEFINE_BY_ID_ERROR(50022,"delete process definition by id error", "删除工作流定义错误"),
SCHEDULE_CRON_STATE_ONLINE(50023,"the status of schedule {0} is already on line", "调度配置[{0}]已上线"), SCHEDULE_CRON_STATE_ONLINE(50023,"the status of schedule {0} is already on line", "调度配置[{0}]已上线"),

41
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SqoopJobType.java

@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.common.enums;
import com.baomidou.mybatisplus.annotation.EnumValue;
public enum SqoopJobType {
CUSTOM(0, "CUSTOM"),
TEMPLATE(1, "TEMPLATE");
SqoopJobType(int code, String descp){
this.code = code;
this.descp = descp;
}
@EnumValue
private final int code;
private final String descp;
public int getCode() {
return code;
}
public String getDescp() {
return descp;
}
}

87
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/SqoopParameters.java

@ -16,6 +16,8 @@
*/ */
package org.apache.dolphinscheduler.common.task.sqoop; package org.apache.dolphinscheduler.common.task.sqoop;
import org.apache.dolphinscheduler.common.enums.SqoopJobType;
import org.apache.dolphinscheduler.common.process.Property;
import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.process.ResourceInfo;
import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.task.AbstractParameters;
import org.apache.dolphinscheduler.common.utils.StringUtils; import org.apache.dolphinscheduler.common.utils.StringUtils;
@ -28,6 +30,23 @@ import java.util.List;
*/ */
public class SqoopParameters extends AbstractParameters { public class SqoopParameters extends AbstractParameters {
/**
* sqoop job type:
* CUSTOM - custom sqoop job
* TEMPLATE - sqoop template job
*/
private String jobType;
/**
* customJob eq 1, use customShell
*/
private String customShell;
/**
* sqoop job name - map-reduce job name
*/
private String jobName;
/** /**
* model type * model type
*/ */
@ -53,6 +72,16 @@ public class SqoopParameters extends AbstractParameters {
*/ */
private String targetParams; private String targetParams;
/**
* hadoop custom param for sqoop job
*/
private List<Property> hadoopCustomParams;
/**
* sqoop advanced param
*/
private List<Property> sqoopAdvancedParams;
public String getModelType() { public String getModelType() {
return modelType; return modelType;
} }
@ -101,14 +130,70 @@ public class SqoopParameters extends AbstractParameters {
this.targetParams = targetParams; this.targetParams = targetParams;
} }
public String getJobType() {
return jobType;
}
public void setJobType(String jobType) {
this.jobType = jobType;
}
public String getJobName() {
return jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public String getCustomShell() {
return customShell;
}
public void setCustomShell(String customShell) {
this.customShell = customShell;
}
public List<Property> getHadoopCustomParams() {
return hadoopCustomParams;
}
public void setHadoopCustomParams(List<Property> hadoopCustomParams) {
this.hadoopCustomParams = hadoopCustomParams;
}
public List<Property> getSqoopAdvancedParams() {
return sqoopAdvancedParams;
}
public void setSqoopAdvancedParams(List<Property> sqoopAdvancedParams) {
this.sqoopAdvancedParams = sqoopAdvancedParams;
}
@Override @Override
public boolean checkParameters() { public boolean checkParameters() {
return StringUtils.isNotEmpty(modelType)&&
boolean sqoopParamsCheck = false;
if (StringUtils.isEmpty(jobType)) {
return sqoopParamsCheck;
}
if (SqoopJobType.TEMPLATE.getDescp().equals(jobType)) {
sqoopParamsCheck = StringUtils.isEmpty(customShell) &&
StringUtils.isNotEmpty(modelType) &&
StringUtils.isNotEmpty(jobName) &&
concurrency != 0 && concurrency != 0 &&
StringUtils.isNotEmpty(sourceType) && StringUtils.isNotEmpty(sourceType) &&
StringUtils.isNotEmpty(targetType) && StringUtils.isNotEmpty(targetType) &&
StringUtils.isNotEmpty(sourceParams) && StringUtils.isNotEmpty(sourceParams) &&
StringUtils.isNotEmpty(targetParams); StringUtils.isNotEmpty(targetParams);
} else if (SqoopJobType.CUSTOM.getDescp().equals(jobType)) {
sqoopParamsCheck = StringUtils.isNotEmpty(customShell) &&
StringUtils.isEmpty(jobName);
}
return sqoopParamsCheck;
} }
@Override @Override

2
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetMysqlParameter.java

@ -106,7 +106,7 @@ public class TargetMysqlParameter {
this.preQuery = preQuery; this.preQuery = preQuery;
} }
public boolean isUpdate() { public boolean getIsUpdate() {
return isUpdate; return isUpdate;
} }

6
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/consumer/TaskPriorityQueueConsumer.java

@ -18,6 +18,7 @@
package org.apache.dolphinscheduler.server.master.consumer; package org.apache.dolphinscheduler.server.master.consumer;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.enums.SqoopJobType;
import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.common.enums.TaskType;
import org.apache.dolphinscheduler.common.enums.UdfType; import org.apache.dolphinscheduler.common.enums.UdfType;
import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNode;
@ -257,13 +258,15 @@ public class TaskPriorityQueueConsumer extends Thread{
/** /**
* set datax task relation * set sqoop task relation
* @param sqoopTaskExecutionContext sqoopTaskExecutionContext * @param sqoopTaskExecutionContext sqoopTaskExecutionContext
* @param taskNode taskNode * @param taskNode taskNode
*/ */
private void setSqoopTaskRelation(SqoopTaskExecutionContext sqoopTaskExecutionContext, TaskNode taskNode) { private void setSqoopTaskRelation(SqoopTaskExecutionContext sqoopTaskExecutionContext, TaskNode taskNode) {
SqoopParameters sqoopParameters = JSONUtils.parseObject(taskNode.getParams(), SqoopParameters.class); SqoopParameters sqoopParameters = JSONUtils.parseObject(taskNode.getParams(), SqoopParameters.class);
// sqoop job type is template set task relation
if (sqoopParameters.getJobType().equals(SqoopJobType.TEMPLATE.getDescp())) {
SourceMysqlParameter sourceMysqlParameter = JSONUtils.parseObject(sqoopParameters.getSourceParams(), SourceMysqlParameter.class); SourceMysqlParameter sourceMysqlParameter = JSONUtils.parseObject(sqoopParameters.getSourceParams(), SourceMysqlParameter.class);
TargetMysqlParameter targetMysqlParameter = JSONUtils.parseObject(sqoopParameters.getTargetParams(), TargetMysqlParameter.class); TargetMysqlParameter targetMysqlParameter = JSONUtils.parseObject(sqoopParameters.getTargetParams(), TargetMysqlParameter.class);
@ -282,6 +285,7 @@ public class TaskPriorityQueueConsumer extends Thread{
sqoopTaskExecutionContext.setTargetConnectionParams(dataTarget.getConnectionParams()); sqoopTaskExecutionContext.setTargetConnectionParams(dataTarget.getConnectionParams());
} }
} }
}
/** /**
* set SQL task relation * set SQL task relation

39
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/CommonGenerator.java

@ -16,10 +16,17 @@
*/ */
package org.apache.dolphinscheduler.server.worker.task.sqoop.generator; package org.apache.dolphinscheduler.server.worker.task.sqoop.generator;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.process.Property;
import org.apache.dolphinscheduler.common.task.sqoop.SqoopParameters; import org.apache.dolphinscheduler.common.task.sqoop.SqoopParameters;
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.List;
/** /**
* common script generator * common script generator
*/ */
@ -32,6 +39,38 @@ public class CommonGenerator {
try{ try{
result.append("sqoop ") result.append("sqoop ")
.append(sqoopParameters.getModelType()); .append(sqoopParameters.getModelType());
//set sqoop job name
result.append(" -D mapred.job.name")
.append(Constants.EQUAL_SIGN)
.append(sqoopParameters.getJobName());
//set hadoop custom param
List<Property> hadoopCustomParams = sqoopParameters.getHadoopCustomParams();
if (CollectionUtils.isNotEmpty(hadoopCustomParams)) {
for (Property hadoopCustomParam : hadoopCustomParams) {
String hadoopCustomParamStr = " -D " + hadoopCustomParam.getProp()
+ Constants.EQUAL_SIGN + hadoopCustomParam.getValue();
if (StringUtils.isNotEmpty(hadoopCustomParamStr)) {
result.append(hadoopCustomParamStr);
}
}
}
//set sqoop advanced custom param
List<Property> sqoopAdvancedParams = sqoopParameters.getSqoopAdvancedParams();
if (CollectionUtils.isNotEmpty(sqoopAdvancedParams)) {
for (Property sqoopAdvancedParam : sqoopAdvancedParams) {
String sqoopAdvancedParamStr = " " + sqoopAdvancedParam.getProp()
+ " " + sqoopAdvancedParam.getValue();
if (StringUtils.isNotEmpty(sqoopAdvancedParamStr)) {
result.append(sqoopAdvancedParamStr);
}
}
}
if(sqoopParameters.getConcurrency() >0){ if(sqoopParameters.getConcurrency() >0){
result.append(" -m ") result.append(" -m ")
.append(sqoopParameters.getConcurrency()); .append(sqoopParameters.getConcurrency());

14
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/SqoopJobGenerator.java

@ -16,6 +16,7 @@
*/ */
package org.apache.dolphinscheduler.server.worker.task.sqoop.generator; package org.apache.dolphinscheduler.server.worker.task.sqoop.generator;
import org.apache.dolphinscheduler.common.enums.SqoopJobType;
import org.apache.dolphinscheduler.common.task.sqoop.SqoopParameters; import org.apache.dolphinscheduler.common.task.sqoop.SqoopParameters;
import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext;
import org.apache.dolphinscheduler.server.worker.task.sqoop.generator.sources.HdfsSourceGenerator; import org.apache.dolphinscheduler.server.worker.task.sqoop.generator.sources.HdfsSourceGenerator;
@ -62,14 +63,23 @@ public class SqoopJobGenerator {
* @return * @return
*/ */
public String generateSqoopJob(SqoopParameters sqoopParameters,TaskExecutionContext taskExecutionContext){ public String generateSqoopJob(SqoopParameters sqoopParameters,TaskExecutionContext taskExecutionContext){
String sqoopScripts = "";
if (SqoopJobType.TEMPLATE.getDescp().equals(sqoopParameters.getJobType())) {
createSqoopJobGenerator(sqoopParameters.getSourceType(),sqoopParameters.getTargetType()); createSqoopJobGenerator(sqoopParameters.getSourceType(),sqoopParameters.getTargetType());
if(sourceGenerator == null || targetGenerator == null){ if(sourceGenerator == null || targetGenerator == null){
return null; throw new RuntimeException("sqoop task source type or target type is null");
} }
return commonGenerator.generate(sqoopParameters) sqoopScripts = commonGenerator.generate(sqoopParameters)
+ sourceGenerator.generate(sqoopParameters,taskExecutionContext) + sourceGenerator.generate(sqoopParameters,taskExecutionContext)
+ targetGenerator.generate(sqoopParameters,taskExecutionContext); + targetGenerator.generate(sqoopParameters,taskExecutionContext);
} else if (SqoopJobType.CUSTOM.getDescp().equals(sqoopParameters.getJobType())) {
sqoopScripts = sqoopParameters.getCustomShell().replaceAll("\\r\\n", "\n");
}
return sqoopScripts;
} }
/** /**

14
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/sources/MysqlSourceGenerator.java

@ -77,19 +77,19 @@ public class MysqlSourceGenerator implements ISourceGenerator {
}else{ }else{
srcQuery += " WHERE $CONDITIONS"; srcQuery += " WHERE $CONDITIONS";
} }
result.append(" --query \'"+srcQuery+"\'"); result.append(" --query \'").append(srcQuery).append("\'");
} }
List<Property> mapColumnHive = sourceMysqlParameter.getMapColumnHive(); List<Property> mapColumnHive = sourceMysqlParameter.getMapColumnHive();
if(mapColumnHive != null && !mapColumnHive.isEmpty()){ if(mapColumnHive != null && !mapColumnHive.isEmpty()){
String columnMap = ""; StringBuilder columnMap = new StringBuilder();
for(Property item:mapColumnHive){ for(Property item:mapColumnHive){
columnMap = item.getProp()+"="+ item.getValue()+","; columnMap.append(item.getProp()).append("=").append(item.getValue()).append(",");
} }
if(StringUtils.isNotEmpty(columnMap)){ if(StringUtils.isNotEmpty(columnMap.toString())){
result.append(" --map-column-hive ") result.append(" --map-column-hive ")
.append(columnMap.substring(0,columnMap.length()-1)); .append(columnMap.substring(0,columnMap.length()-1));
} }
@ -98,12 +98,12 @@ public class MysqlSourceGenerator implements ISourceGenerator {
List<Property> mapColumnJava = sourceMysqlParameter.getMapColumnJava(); List<Property> mapColumnJava = sourceMysqlParameter.getMapColumnJava();
if(mapColumnJava != null && !mapColumnJava.isEmpty()){ if(mapColumnJava != null && !mapColumnJava.isEmpty()){
String columnMap = ""; StringBuilder columnMap = new StringBuilder();
for(Property item:mapColumnJava){ for(Property item:mapColumnJava){
columnMap = item.getProp()+"="+ item.getValue()+","; columnMap.append(item.getProp()).append("=").append(item.getValue()).append(",");
} }
if(StringUtils.isNotEmpty(columnMap)){ if(StringUtils.isNotEmpty(columnMap.toString())){
result.append(" --map-column-java ") result.append(" --map-column-java ")
.append(columnMap.substring(0,columnMap.length()-1)); .append(columnMap.substring(0,columnMap.length()-1));
} }

2
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/sqoop/generator/targets/MysqlTargetGenerator.java

@ -78,7 +78,7 @@ public class MysqlTargetGenerator implements ITargetGenerator {
result.append(" --lines-terminated-by '").append(targetMysqlParameter.getLinesTerminated()).append("'"); result.append(" --lines-terminated-by '").append(targetMysqlParameter.getLinesTerminated()).append("'");
} }
if(targetMysqlParameter.isUpdate() if(targetMysqlParameter.getIsUpdate()
&& StringUtils.isNotEmpty(targetMysqlParameter.getTargetUpdateKey()) && StringUtils.isNotEmpty(targetMysqlParameter.getTargetUpdateKey())
&& StringUtils.isNotEmpty(targetMysqlParameter.getTargetUpdateMode())){ && StringUtils.isNotEmpty(targetMysqlParameter.getTargetUpdateMode())){
result.append(" --update-key ").append(targetMysqlParameter.getTargetUpdateKey()) result.append(" --update-key ").append(targetMysqlParameter.getTargetUpdateKey())

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue

@ -131,7 +131,7 @@
}, },
created () { created () {
let supportType = this.supportType || [] let supportType = this.supportType || []
this.typeList = _.cloneDeep(this.store.state.dag.dsTypeListS) this.typeList = this.data.typeList || _.cloneDeep(this.store.state.dag.dsTypeListS)
// Have a specified data source // Have a specified data source
if (supportType.length) { if (supportType.length) {
let is = (type) => { let is = (type) => {

292
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue

@ -17,13 +17,49 @@
<template> <template>
<div class="sql-model"> <div class="sql-model">
<m-list-box>
<div slot="text">{{$t('Custom Job')}}</div>
<div slot="content">
<x-switch
v-model="isCustomTask"
@on-click="_onSwitch"
:disabled="isDetails"
>
</x-switch>
</div>
</m-list-box>
<m-list-box v-show="isCustomTask">
<div slot="text">{{$t('Custom Script')}}</div>
<div slot="content">
<div class="from-mirror">
<textarea
id="code-shell-mirror"
name="code-shell-mirror"
style="opacity: 0;">
</textarea>
</div>
</div>
</m-list-box>
<template v-if="!isCustomTask">
<m-list-box>
<div slot="text">{{$t('Sqoop Job Name')}}</div>
<div slot="content">
<x-input
:disabled="isDetails"
type="text"
v-model="jobName"
:placeholder="$t('Please enter Job Name(required)')">
</x-input>
</div>
</m-list-box>
<m-list-box> <m-list-box>
<div slot="text">{{$t('Direct')}}</div> <div slot="text">{{$t('Direct')}}</div>
<div slot="content"> <div slot="content">
<x-select <x-select
style="width: 130px;" style="width: 130px;"
v-model="modelType" v-model="modelType"
:disabled="isDetails"> :disabled="isDetails"
@on-change="_handleModelTypeChange">
<x-option <x-option
v-for="city in modelTypeList" v-for="city in modelTypeList"
:key="city.code" :key="city.code"
@ -33,6 +69,28 @@
</x-select> </x-select>
</div> </div>
</m-list-box> </m-list-box>
<m-list-box>
<div slot="text" style="width: 110px;">{{$t('Hadoop Custom Params')}}</div>
<div slot="content">
<m-local-params
ref="refMapColumnHadoopParams"
@on-local-params="_onHadoopCustomParams"
:udp-list="hadoopCustomParams"
:hide="false">
</m-local-params>
</div>
</m-list-box>
<m-list-box>
<div slot="text" style="width: 100px;">{{$t('Sqoop Advanced Parameters')}}</div>
<div slot="content">
<m-local-params
ref="refMapColumnAdvancedParams"
@on-local-params="_onSqoopAdvancedParams"
:udp-list="sqoopAdvancedParams"
:hide="false">
</m-local-params>
</div>
</m-list-box>
<template> <template>
<m-list-box> <m-list-box>
@ -65,7 +123,9 @@
<m-datasource <m-datasource
ref="refSourceDs" ref="refSourceDs"
@on-dsData="_onSourceDsData" @on-dsData="_onSourceDsData"
:data="{ type:sourceMysqlParams.srcType,datasource:sourceMysqlParams.srcDatasource }" :data="{type:sourceMysqlParams.srcType,
typeList: [{id: 0, code: 'MYSQL', disabled: false}],
datasource:sourceMysqlParams.srcDatasource }"
> >
</m-datasource> </m-datasource>
</div> </div>
@ -385,7 +445,9 @@
<m-datasource <m-datasource
ref="refTargetDs" ref="refTargetDs"
@on-dsData="_onTargetDsData" @on-dsData="_onTargetDsData"
:data="{ type:targetMysqlParams.targetType,datasource:targetMysqlParams.targetDatasource }" :data="{ type:targetMysqlParams.targetType,
typeList: [{id: 0, code: 'MYSQL', disabled: false}],
datasource:targetMysqlParams.targetDatasource }"
> >
</m-datasource> </m-datasource>
</div> </div>
@ -474,7 +536,7 @@
</x-input> </x-input>
</div> </div>
</m-list-box> </m-list-box>
</template>
<m-list-box> <m-list-box>
<div slot="text">{{$t('Custom Parameters')}}</div> <div slot="text">{{$t('Custom Parameters')}}</div>
<div slot="content"> <div slot="content">
@ -498,16 +560,38 @@
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror' import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror'
let editor let editor
let shellEditor
export default { export default {
name: 'sql', name: 'sql',
data () { data () {
return { return {
/**
* Is Custom Task
*/
isCustomTask: false,
/** /**
* Customer Params * Customer Params
*/ */
localParams: [], localParams: [],
/**
* Hadoop Custom Params
*/
hadoopCustomParams: [],
/**
* Sqoop Advanced Params
*/
sqoopAdvancedParams: [],
/**
* script
*/
customShell: '',
/**
* task name
*/
jobName: '',
/** /**
* mysql query type * mysql query type
*/ */
@ -524,6 +608,10 @@
* concurrency * concurrency
*/ */
concurrency:1, concurrency:1,
/**
* default job type
*/
jobType:'TEMPLATE',
/** /**
* direct model type * direct model type
*/ */
@ -535,12 +623,6 @@
{ {
code: "MYSQL" code: "MYSQL"
}, },
{
code:"HDFS"
},
{
code:"HIVE"
}
], ],
targetTypeList:[ targetTypeList:[
@ -620,8 +702,32 @@
}, },
methods: { methods: {
_onSwitch(is){
if(is) {
this.jobType = 'CUSTOM'
this.isCustomTask = true
setTimeout(() => {
this._handlerShellEditor()
}, 200)
} else {
this.jobType = 'TEMPLATE'
this.isCustomTask = false
setTimeout(() => {
this._handlerEditor()
}, 200)
}
},
_handleQueryType(o){ _handleQueryType(o){
this.sourceMysqlParams.srcQueryType = this.srcQueryType this.sourceMysqlParams.srcQueryType = this.srcQueryType
this._getTargetTypeList(this.sourceType)
this.targetType = this.targetTypeList[0].code
},
_handleModelTypeChange(a){
this._getSourceTypeList(a.label)
this.sourceType = this.sourceTypeList[0].code
this._handleSourceTypeChange({label: this.sourceType, value: this.sourceType})
}, },
_handleSourceTypeChange(a){ _handleSourceTypeChange(a){
@ -629,9 +735,50 @@
this.targetType = this.targetTypeList[0].code this.targetType = this.targetTypeList[0].code
}, },
_getSourceTypeList(data){
switch(data){
case 'import':
this.sourceTypeList = [
{
code:"MYSQL"
},
]
break;
case 'export':
this.sourceTypeList = [
{
code: "HDFS"
},
{
code: "HIVE"
}
]
break;
default:
this.sourceTypeList = [
{
code:"MYSQL"
},
{
code:"HIVE"
},
{
code:"HDFS"
}
]
break;
}
},
_getTargetTypeList(data){ _getTargetTypeList(data){
switch(data){ switch(data){
case 'MYSQL': case 'MYSQL':
if (this.srcQueryType === "1") {
this.targetTypeList = [
{
code: "HDFS"
}]
} else {
this.targetTypeList = [ this.targetTypeList = [
{ {
code: "HIVE" code: "HIVE"
@ -640,6 +787,7 @@
code: "HDFS" code: "HDFS"
} }
] ]
}
break; break;
case 'HDFS': case 'HDFS':
this.targetTypeList = [ this.targetTypeList = [
@ -670,12 +818,10 @@
_onMapColumnHive (a) { _onMapColumnHive (a) {
this.sourceMysqlParams.mapColumnHive = a this.sourceMysqlParams.mapColumnHive = a
console.log(this.sourceMysqlParams.mapColumnHive)
}, },
_onMapColumnJava (a) { _onMapColumnJava (a) {
this.sourceMysqlParams.mapColumnJava = a this.sourceMysqlParams.mapColumnJava = a
console.log(this.sourceMysqlParams.mapColumnJava)
}, },
/** /**
@ -701,7 +847,8 @@
var params = null var params = null
switch(this.sourceType){ switch(this.sourceType){
case "MYSQL": case "MYSQL":
this.sourceMysqlParams.srcQuerySql = editor ? editor.getValue() : this.sourceMysqlParams.srcQuerySql this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === "1" && editor ?
editor.getValue() : this.sourceMysqlParams.srcQuerySql
params = JSON.stringify(this.sourceMysqlParams) params = JSON.stringify(this.sourceMysqlParams)
break; break;
case "ORACLE": case "ORACLE":
@ -791,6 +938,21 @@
* verification * verification
*/ */
_verification () { _verification () {
let sqoopParams = {
jobType: this.jobType,
localParams: this.localParams
}
if (this.jobType === 'CUSTOM') {
if (!shellEditor.getValue()) {
this.$message.warning(`${i18n.$t('Please enter Custom Shell(required)')}`)
return false
}
sqoopParams['customShell'] = shellEditor.getValue()
} else {
if (!this.jobName) {
this.$message.warning(`${i18n.$t('Please enter Job Name(required)')}`)
return false
}
switch (this.sourceType) { switch (this.sourceType) {
case "MYSQL": case "MYSQL":
@ -802,16 +964,22 @@
this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`) this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`)
return false return false
} }
this.sourceMysqlParams.srcTable = ""
this.sourceMysqlParams.srcColumnType = "0"
this.sourceMysqlParams.srcColumns = ""
} else { } else {
if (this.sourceMysqlParams.srcTable === "") { if (this.sourceMysqlParams.srcTable === "") {
this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`)
return false return false
} }
this.sourceMysqlParams.srcQuerySql = ""
if (this.sourceMysqlParams.srcColumnType === "1" && this.sourceMysqlParams.srcColumns === "") { if (this.sourceMysqlParams.srcColumnType === "1" && this.sourceMysqlParams.srcColumns === "") {
this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`) this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`)
return false return false
} }
if (this.sourceMysqlParams.srcColumnType === "0") {
this.sourceMysqlParams.srcColumns = ""
}
} }
break; break;
@ -865,17 +1033,19 @@
default: default:
break; break;
} }
sqoopParams['jobName'] = this.jobName
sqoopParams['hadoopCustomParams'] = this.hadoopCustomParams
sqoopParams['sqoopAdvancedParams'] = this.sqoopAdvancedParams
sqoopParams['concurrency'] = this.concurrency
sqoopParams['modelType'] = this.modelType
sqoopParams['sourceType'] = this.sourceType
sqoopParams['targetType'] = this.targetType
sqoopParams['targetParams'] = this._handleTargetParams()
sqoopParams['sourceParams'] = this._handleSourceParams()
}
// storage // storage
this.$emit('on-params', { this.$emit('on-params', sqoopParams)
concurrency:this.concurrency,
modelType:this.modelType,
sourceType:this.sourceType,
targetType:this.targetType,
sourceParams:this._handleSourceParams(),
targetParams:this._handleTargetParams(),
localParams:this.localParams
})
return true return true
}, },
@ -912,6 +1082,33 @@
return editor return editor
}, },
/**
* Processing code highlighting
*/
_handlerShellEditor () {
this._destroyShellEditor()
// shellEditor
shellEditor = codemirror('code-shell-mirror', {
mode: 'shell',
readOnly: this.isDetails
})
this.keypress = () => {
if (!shellEditor.getOption('readOnly')) {
shellEditor.showHint({
completeSingle: false
})
}
}
// Monitor keyboard
shellEditor.on('keypress', this.keypress)
shellEditor.setValue(this.customShell)
return shellEditor
},
/** /**
* return localParams * return localParams
*/ */
@ -919,6 +1116,20 @@
this.localParams = a this.localParams = a
}, },
/**
* return hadoopParams
*/
_onHadoopCustomParams (a) {
this.hadoopCustomParams = a
},
/**
* return sqoopAdvancedParams
*/
_onSqoopAdvancedParams (a) {
this.sqoopAdvancedParams = a
},
_cacheParams () { _cacheParams () {
this.$emit('on-cache-params', { this.$emit('on-cache-params', {
concurrency:this.concurrency, concurrency:this.concurrency,
@ -939,6 +1150,13 @@
editor = null editor = null
} }
}, },
_destroyShellEditor () {
if (shellEditor) {
shellEditor.toTextArea() // Uninstall
shellEditor.off($('.code-shell-mirror'), 'keypress', this.keypress)
shellEditor.off($('.code-shell-mirror'), 'changes', this.changes)
}
}
}, },
watch: { watch: {
// Listening to sqlType // Listening to sqlType
@ -970,15 +1188,25 @@
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.concurrency = o.params.concurrency || 1, this.jobType = o.params.jobType
this.modelType = o.params.modelType, this.isCustomTask = false
this.sourceType = o.params.sourceType, if (this.jobType === 'CUSTOM') {
this.customShell = o.params.customShell
this.isCustomTask = true
} else {
this.jobName = o.params.jobName
this.hadoopCustomParams = o.params.hadoopCustomParams
this.sqoopAdvancedParams = o.params.sqoopAdvancedParams
this.concurrency = o.params.concurrency || 1
this.modelType = o.params.modelType
this.sourceType = o.params.sourceType
this._getTargetTypeList(this.sourceType) this._getTargetTypeList(this.sourceType)
this.targetType = o.params.targetType, this.targetType = o.params.targetType
this._getSourceParams(o.params.sourceParams), this._getSourceParams(o.params.sourceParams)
this._getTargetParams(o.params.targetParams), this._getTargetParams(o.params.targetParams)
this.localParams = o.params.localParams this.localParams = o.params.localParams
} }
}
}, },
mounted () { mounted () {
@ -986,6 +1214,10 @@
this._handlerEditor() this._handlerEditor()
}, 200) }, 200)
setTimeout(() => {
this._handlerShellEditor()
}, 200)
setTimeout(() => { setTimeout(() => {
this.srcQueryType = this.sourceMysqlParams.srcQueryType this.srcQueryType = this.sourceMysqlParams.srcQueryType
}, 500) }, 500)

7
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -540,6 +540,9 @@ export default {
'Whether directory': 'Whether directory', 'Whether directory': 'Whether directory',
Yes: 'Yes', Yes: 'Yes',
No: 'No', No: 'No',
'Hadoop Custom Params': 'Hadoop Params',
'Sqoop Advanced Parameters': 'Sqoop Params',
'Sqoop Job Name': 'Job Name',
'Please enter Mysql Database(required)': 'Please enter Mysql Database(required)', 'Please enter Mysql Database(required)': 'Please enter Mysql Database(required)',
'Please enter Mysql Table(required)': 'Please enter Mysql Table(required)', 'Please enter Mysql Table(required)': 'Please enter Mysql Table(required)',
'Please enter Columns (Comma separated)': 'Please enter Columns (Comma separated)', 'Please enter Columns (Comma separated)': 'Please enter Columns (Comma separated)',
@ -554,6 +557,8 @@ export default {
'Please enter Lines Terminated': 'Please enter Lines Terminated', 'Please enter Lines Terminated': 'Please enter Lines Terminated',
'Please enter Concurrency': 'Please enter Concurrency', 'Please enter Concurrency': 'Please enter Concurrency',
'Please enter Update Key': 'Please enter Update Key', 'Please enter Update Key': 'Please enter Update Key',
'Please enter Job Name(required)': 'Please enter Job Name(required)',
'Please enter Custom Shell(required)': 'Please enter Custom Shell(required)',
Direct: 'Direct', Direct: 'Direct',
Type: 'Type', Type: 'Type',
ModelType: 'ModelType', ModelType: 'ModelType',
@ -587,6 +592,8 @@ export default {
'All Columns': 'All Columns', 'All Columns': 'All Columns',
'Some Columns': 'Some Columns', 'Some Columns': 'Some Columns',
'Branch flow': 'Branch flow', 'Branch flow': 'Branch flow',
'Custom Job': 'Custom Job',
'Custom Script': 'Custom Script',
'Cannot select the same node for successful branch flow and failed branch flow': 'Cannot select the same node for successful branch flow and failed branch flow', 'Cannot select the same node for successful branch flow and failed branch flow': 'Cannot select the same node for successful branch flow and failed branch flow',
'Successful branch flow and failed branch flow are required': 'Successful branch flow and failed branch flow are required', 'Successful branch flow and failed branch flow are required': 'Successful branch flow and failed branch flow are required',
'Unauthorized or deleted resources': 'Unauthorized or deleted resources', 'Unauthorized or deleted resources': 'Unauthorized or deleted resources',

7
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -540,6 +540,9 @@ export default {
'Whether directory': '是否文件夹', 'Whether directory': '是否文件夹',
Yes: '是', Yes: '是',
No: '否', No: '否',
'Hadoop Custom Params': 'Hadoop参数',
'Sqoop Advanced Parameters': 'Sqoop参数',
'Sqoop Job Name': '任务名称',
'Please enter Mysql Database(required)': '请输入Mysql数据库(必填)', 'Please enter Mysql Database(required)': '请输入Mysql数据库(必填)',
'Please enter Mysql Table(required)': '请输入Mysql表名(必填)', 'Please enter Mysql Table(required)': '请输入Mysql表名(必填)',
'Please enter Columns (Comma separated)': '请输入列名 , 隔开', 'Please enter Columns (Comma separated)': '请输入列名 , 隔开',
@ -554,6 +557,8 @@ export default {
'Please enter Lines Terminated': '请输入行分隔符', 'Please enter Lines Terminated': '请输入行分隔符',
'Please enter Concurrency': '请输入并发度', 'Please enter Concurrency': '请输入并发度',
'Please enter Update Key': '请输入更新列', 'Please enter Update Key': '请输入更新列',
'Please enter Job Name(required)': '请输入任务名称(必填)',
'Please enter Custom Shell(required)': '请输入自定义脚本',
Direct: '流向', Direct: '流向',
Type: '类型', Type: '类型',
ModelType: '模式', ModelType: '模式',
@ -587,6 +592,8 @@ export default {
'All Columns': '全表导入', 'All Columns': '全表导入',
'Some Columns': '选择列', 'Some Columns': '选择列',
'Branch flow': '分支流转', 'Branch flow': '分支流转',
'Custom Job': '自定义任务',
'Custom Script': '自定义脚本',
'Cannot select the same node for successful branch flow and failed branch flow': '成功分支流转和失败分支流转不能选择同一个节点', 'Cannot select the same node for successful branch flow and failed branch flow': '成功分支流转和失败分支流转不能选择同一个节点',
'Successful branch flow and failed branch flow are required': '成功分支流转和失败分支流转必填', 'Successful branch flow and failed branch flow are required': '成功分支流转和失败分支流转必填',
'Unauthorized or deleted resources': '未授权或已删除资源', 'Unauthorized or deleted resources': '未授权或已删除资源',

24
e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java

@ -23,7 +23,7 @@ import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import redis.clients.jedis.Jedis; import redis.clients.jedis.Jedis;
import org.openqa.selenium.JavascriptExecutor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -115,6 +115,7 @@ public class BrowserCommon {
/** /**
* Click button element * Click button element
*
* @param locator By * @param locator By
* @return clickButton * @return clickButton
*/ */
@ -128,6 +129,7 @@ public class BrowserCommon {
/** /**
* Click Navigation Bar element * Click Navigation Bar element
*
* @param locator By * @param locator By
* @return clickButton * @return clickButton
*/ */
@ -164,6 +166,7 @@ public class BrowserCommon {
inputElement.sendKeys(content); inputElement.sendKeys(content);
return inputElement; return inputElement;
} }
/** /**
* clear element * clear element
* *
@ -182,7 +185,6 @@ public class BrowserCommon {
* *
* @param codeMirrorLocator By codeMirror * @param codeMirrorLocator By codeMirror
* @param codeMirrorLineLocator By codeMirrorLine * @param codeMirrorLineLocator By codeMirrorLine
*/ */
public void inputCodeMirror(By codeMirrorLocator, By codeMirrorLineLocator, String content) { public void inputCodeMirror(By codeMirrorLocator, By codeMirrorLineLocator, String content) {
WebElement codeMirrorElement = locateElement(codeMirrorLocator); WebElement codeMirrorElement = locateElement(codeMirrorLocator);
@ -193,6 +195,7 @@ public class BrowserCommon {
/** /**
* move to element * move to element
*
* @param locator BY * @param locator BY
* @return actions * @return actions
*/ */
@ -249,9 +252,22 @@ public class BrowserCommon {
return driver; return driver;
} }
/**
* select time
*
* @return WebElement
*/
public WebElement selectDate(String js, By locator_time, String date) {
JavascriptExecutor removeAttribute = (JavascriptExecutor) driver;
removeAttribute.executeScript("var setDate=" + js + ";setDate.removeAttribute('readonly');");
WebElement dateElement = locateElement(locator_time);
//input date
dateElement.clear();
dateElement.sendKeys(Keys.HOME,Keys.chord(Keys.SHIFT,Keys.END));
dateElement.sendKeys(date);
return dateElement;
}
/** /**
* Multi-window switch handle, according to the handle number passed in * Multi-window switch handle, according to the handle number passed in

36
e2e/src/test/java/org/apache/dolphinscheduler/data/security/AlertManageData.java

@ -0,0 +1,36 @@
/*
* 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.security;
public class AlertManageData {
/**
* Alert Name
*/
public static final String ALERT_NAME = "selenium_alert_Name";
/**
* Alert Type
*/
public static final String ALERT_TYPE = "邮件";
/**
* Alert Description
*/
public static final String DESCRIPTION = "create alert test";
public static final String ALERT_MANAGE = "告警组管理 - DolphinScheduler";
}

42
e2e/src/test/java/org/apache/dolphinscheduler/data/security/QueueManageData.java

@ -0,0 +1,42 @@
/*
* 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.security;
public class QueueManageData {
/**
* Create Queue Name
*/
public static final String QUEUE_NAME = "selenium_queue_name";
/**
* Create Queue Value
*/
public static final String QUEUE_VALUE = "selenium_queue_value";
/**
* Edit Queue Name
*/
public static final String EDIT_QUEUE_NAME = "_edit";
/**
* Edit Queue Value
*/
public static final String EDIT_QUEUE_VALUE = "_edit";
public static final String QUEUE_MANAGE = "队列管理 - DolphinScheduler";
}

24
e2e/src/test/java/org/apache/dolphinscheduler/data/security/TokenManageData.java

@ -0,0 +1,24 @@
/*
* 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.security;
public class TokenManageData {
public static final String TOKEN_MANAGE = "令牌管理 - DolphinScheduler";
public static final String DATE = "2038-06-10 00:00:00";
}

35
e2e/src/test/java/org/apache/dolphinscheduler/locator/security/AlertManageLocator.java

@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.locator.security;
import org.openqa.selenium.By;
public class AlertManageLocator {
//create alert locator
public static final By CLICK_ALERT_MANAGE = By.xpath("//div[4]/div/a/div/a/span");
public static final By CLICK_CREATE_ALERT = By.xpath("//div[1]/div[2]/div/div[2]/div[2]/div/div[1]/button/span");
public static final By INPUT_ALERT_NAME = By.xpath("//div[2]/div/div[1]/div[2]/div/input");
public static final By CLICK_ALERT_TYPE = By.xpath("//div[2]/div/div[2]/div/div[2]/div[2]/div/div[1]/div/input");
public static final By SELECT_ALERT_EMAIL = By.xpath("//div[2]/div/div[2]/div/div[2]/div[2]/div/div[2]/div/div/div/ul/li[1]/span");
public static final By INPUT_ALERT_DESCRIPTION = By.xpath("//textarea");
public static final By SUBMIT_ALERT = By.xpath("//div[3]/button[2]/span");
//delete alert locator
public static final By DELETE_ALERT_BUTTON = By.xpath("//span/button");
public static final By CONFIRM_DELETE_ALERT_BUTTON = By.xpath("//div[2]/div/button[2]/span");
}

31
e2e/src/test/java/org/apache/dolphinscheduler/locator/security/QueueManageLocator.java

@ -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.security;
import org.openqa.selenium.By;
public class QueueManageLocator {
//create queue locator
public static final By CLICK_QUEUE_MANAGE = By.xpath("//div[6]/div/a/div/a/span");
public static final By CLICK_CREATE_QUEUE = By.xpath("//button/span");
public static final By INPUT_QUEUE_NAME = By.xpath("//div[2]/div/div/div[2]/div/input");
public static final By INPUT_QUEUE_VALUE = By.xpath("//div[2]/div[2]/div/input");
public static final By SUBMIT_QUEUE = By.xpath("//button[2]/span");
//edit queue locator
public static final By CLICK_EDIT_QUEUE = By.xpath("//td[6]/button/i");
}

41
e2e/src/test/java/org/apache/dolphinscheduler/locator/security/TokenManageLocator.java

@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.locator.security;
import org.openqa.selenium.By;
public class TokenManageLocator {
//create token
public static final By CLICK_TOKEN_MANAGE = By.xpath("//div[7]/div/a/div/a/span");
public static final By CLICK_CREATE_TOKEN = By.xpath("//div[2]/div/div[2]/div[2]/div/div[1]/button/span");
public static final By SELECT_USER = By.xpath("//div[2]/div[2]/div/div/div/span/i");
public static final By CLICK_GENERATE_TOKEN_BUTTON = By.xpath("//div[3]/div[2]/button/span");
public static final By CLICK_SUBMIT_BUTTON = By.xpath("//div[3]/button[2]/span");
//edit token
public static final By CLICK_EDIT_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[7]/button/i");
//delete token
public static final By CLICK_DELETE_BUTTON = By.xpath("//div[3]/div[1]/div/table/tr[2]/td[7]/span/button");
public static final By CLICK_CONFIRM_DELETE_BUTTON = By.xpath("//div[2]/div/button[2]/span");
}

77
e2e/src/test/java/org/apache/dolphinscheduler/page/security/AlertManagePage.java

@ -0,0 +1,77 @@
/*
* 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.security;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.data.security.AlertManageData;
import org.apache.dolphinscheduler.locator.security.AlertManageLocator;
import org.openqa.selenium.WebDriver;
public class AlertManagePage extends PageCommon {
/**
* Unique constructor
* @param driver driver
*/
public AlertManagePage(WebDriver driver) {
super(driver);
}
/**
* createTenant
*
* @return Whether to enter the specified page after create tenant
*/
public boolean createAlert() throws InterruptedException {
// click alert manage
clickElement(AlertManageLocator.CLICK_ALERT_MANAGE);
Thread.sleep(1000);
// click create alert button
clickElement(AlertManageLocator.CLICK_CREATE_ALERT);
Thread.sleep(1000);
// input alert data
sendInput(AlertManageLocator.INPUT_ALERT_NAME, AlertManageData.ALERT_NAME);
clickElement(AlertManageLocator.CLICK_ALERT_TYPE);
clickElement(AlertManageLocator.SELECT_ALERT_EMAIL);
sendInput(AlertManageLocator.INPUT_ALERT_DESCRIPTION, AlertManageData.DESCRIPTION);
// click button
clickButton(AlertManageLocator.SUBMIT_ALERT);
// Whether to enter the specified page after submit
return ifTitleContains(AlertManageData.ALERT_MANAGE);
}
public boolean deleteAlert() throws InterruptedException {
// click user manage
clickElement(AlertManageLocator.CLICK_ALERT_MANAGE);
// click delete user button
clickButton(AlertManageLocator.DELETE_ALERT_BUTTON);
// click confirm delete button
clickButton(AlertManageLocator.CONFIRM_DELETE_ALERT_BUTTON);
// Whether to enter the specified page after submit
return ifTitleContains(AlertManageData.ALERT_MANAGE);
}
}

85
e2e/src/test/java/org/apache/dolphinscheduler/page/security/QueueManagePage.java

@ -0,0 +1,85 @@
/*
* 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.security;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.data.security.QueueManageData;
import org.apache.dolphinscheduler.locator.security.QueueManageLocator;
import org.openqa.selenium.WebDriver;
public class QueueManagePage extends PageCommon {
/**
* Unique constructor
* @param driver driver
*/
public QueueManagePage(WebDriver driver) {
super(driver);
}
/**
* create queue
*
* @return Whether to enter the specified page after create queue
*/
public boolean createQueue() throws InterruptedException {
// click queue manage
clickElement(QueueManageLocator.CLICK_QUEUE_MANAGE);
Thread.sleep(1000);
// click create queue button
clickElement(QueueManageLocator.CLICK_CREATE_QUEUE);
Thread.sleep(1000);
// input queue data
sendInput(QueueManageLocator.INPUT_QUEUE_NAME, QueueManageData.QUEUE_NAME);
sendInput(QueueManageLocator.INPUT_QUEUE_VALUE, QueueManageData.QUEUE_VALUE);
// click button
clickButton(QueueManageLocator.SUBMIT_QUEUE);
// Whether to enter the specified page after submit
return ifTitleContains(QueueManageData.QUEUE_MANAGE);
}
/**
* edit queue
*
* @return Whether to enter the specified page after create queue
*/
public boolean editQueue() throws InterruptedException {
// click queue manage
Thread.sleep(1000);
clickElement(QueueManageLocator.CLICK_QUEUE_MANAGE);
Thread.sleep(1000);
// click edit queue button
clickElement(QueueManageLocator.CLICK_EDIT_QUEUE);
Thread.sleep(1000);
// input queue data
sendInput(QueueManageLocator.INPUT_QUEUE_NAME, QueueManageData.EDIT_QUEUE_NAME);
sendInput(QueueManageLocator.INPUT_QUEUE_VALUE, QueueManageData.EDIT_QUEUE_VALUE);
// click button
clickButton(QueueManageLocator.SUBMIT_QUEUE);
// Whether to enter the specified page after submit
return ifTitleContains(QueueManageData.QUEUE_MANAGE);
}
}

94
e2e/src/test/java/org/apache/dolphinscheduler/page/security/TokenManagePage.java

@ -0,0 +1,94 @@
/*
* 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.security;
import org.apache.dolphinscheduler.common.PageCommon;
import org.apache.dolphinscheduler.data.security.TokenManageData;
import org.apache.dolphinscheduler.locator.security.TokenManageLocator;
import org.openqa.selenium.WebDriver;
public class TokenManagePage extends PageCommon {
public TokenManagePage(WebDriver driver) {
super(driver);
}
/**
* createTenant
*
* @return Whether to enter the specified page after creat tenant
*/
public boolean createToken() throws InterruptedException {
//create token
Thread.sleep(1000);
clickElement(TokenManageLocator.CLICK_TOKEN_MANAGE);
Thread.sleep(1000);
// click create token button
clickButton(TokenManageLocator.CLICK_CREATE_TOKEN);
Thread.sleep(1000);
//selectDate(TokenManageLocator.js, TokenManageLocator.CLICK_TIME, TokenManageData.DATE);
clickButton(TokenManageLocator.SELECT_USER);
clickButton(TokenManageLocator.CLICK_GENERATE_TOKEN_BUTTON);
Thread.sleep(2500);
// click button
clickButton(TokenManageLocator.CLICK_SUBMIT_BUTTON);
// Whether to enter the specified page after submit
return ifTitleContains(TokenManageData.TOKEN_MANAGE);
}
//edit token
public boolean editToken() throws InterruptedException {
// click token manage
clickElement(TokenManageLocator.CLICK_TOKEN_MANAGE);
Thread.sleep(1000);
// click create token button
clickButton(TokenManageLocator.CLICK_EDIT_BUTTON);
Thread.sleep(1000);
clickButton(TokenManageLocator.SELECT_USER);
clickButton(TokenManageLocator.CLICK_GENERATE_TOKEN_BUTTON);
Thread.sleep(2500);
// click button
clickButton(TokenManageLocator.CLICK_SUBMIT_BUTTON);
// Whether to enter the specified page after submit
return ifTitleContains(TokenManageData.TOKEN_MANAGE);
}
//delete token
public boolean deleteToken() throws InterruptedException {
// click token manage
clickElement(TokenManageLocator.CLICK_TOKEN_MANAGE);
Thread.sleep(1000);
clickButton(TokenManageLocator.CLICK_DELETE_BUTTON);
clickButton(TokenManageLocator.CLICK_CONFIRM_DELETE_BUTTON);
return ifTitleContains(TokenManageData.TOKEN_MANAGE);
}
}

4
e2e/src/test/java/org/apache/dolphinscheduler/testcase/LoginTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/TestLogin.java

@ -22,10 +22,10 @@ import org.testng.annotations.Test;
import static org.apache.dolphinscheduler.base.BaseTest.driver; import static org.apache.dolphinscheduler.base.BaseTest.driver;
@Test(groups={"functionTests","login"}) @Test(groups={"functionTests","login"})
public class LoginTest { public class TestLogin {
private LoginPage loginPage; private LoginPage loginPage;
@Test(description = "LoginTest", priority = 1) @Test(description = "TestLogin")
public void testLogin() throws InterruptedException { public void testLogin() throws InterruptedException {
loginPage = new LoginPage(driver); loginPage = new LoginPage(driver);
System.out.println("==================================="); System.out.println("===================================");

42
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteAlert.java

@ -0,0 +1,42 @@
/*
* 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.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.AlertManagePage;
import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.testng.annotations.Test;
public class TestDeleteAlert extends BaseTest {
private AlertManagePage alertManagePage;
private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","alert" },description = "TestDeleteAlert",priority=8)
public void testDeleteAlert() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
System.out.println("jump to testSecurity to delete alert");
tenantManagePage.jumpSecurity();
alertManagePage = new AlertManagePage(driver);
//assert alert manage page
System.out.println("start delete alert");
assert alertManagePage.deleteAlert();
System.out.println("end delete alert");
System.out.println("===================================");
}
}

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteProjectTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteProject.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.deleteData; package org.apache.dolphinscheduler.testcase.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage; import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class DeleteProjectTest extends BaseTest { public class TestDeleteProject extends BaseTest {
private CreateProjectPage createProjectPage; private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","project"},description = "DeleteProjectTest",priority=7) @Test(groups={"functionTests"},dependsOnGroups = { "login","project"},description = "TestDeleteProject")
public void testDeleteProject() throws InterruptedException { public void testDeleteProject() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver); createProjectPage = new CreateProjectPage(driver);
//jump to project manage page //jump to project manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteTenantTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteTenant.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.deleteData; package org.apache.dolphinscheduler.testcase.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TenantManagePage; import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class DeleteTenantTest extends BaseTest { public class TestDeleteTenant extends BaseTest {
private TenantManagePage tenantManagePage; private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","createTenant"},description = "DeleteTenantTest",priority=9) @Test(groups={"functionTests"},dependsOnGroups = { "login","createTenant"},description = "TestDeleteTenant")
public void testDeleteTenant() throws InterruptedException { public void testDeleteTenant() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver); tenantManagePage = new TenantManagePage(driver);
//assert tenant manage page //assert tenant manage page

42
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteToken.java

@ -0,0 +1,42 @@
/*
* 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.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.apache.dolphinscheduler.page.security.TokenManagePage;
import org.testng.annotations.Test;
public class TestDeleteToken extends BaseTest {
private TokenManagePage tokenManagePage;
private TenantManagePage tenantManagePage;
@Test(groups = {"functionTests"}, dependsOnGroups = {"login", "token"}, description = "TestDeleteToken")
public void testUserManage() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver);
System.out.println("jump to security to delete token");
tenantManagePage.jumpSecurity();
tokenManagePage = new TokenManagePage(driver);
//delete token
System.out.println("start delete token");
assert tokenManagePage.deleteToken();
System.out.println("end delete token");
System.out.println("===================================");
}
}

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteUserTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteUser.java

@ -14,18 +14,18 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.deleteData; package org.apache.dolphinscheduler.testcase.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TenantManagePage; import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.apache.dolphinscheduler.page.security.UserManagePage; import org.apache.dolphinscheduler.page.security.UserManagePage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class DeleteUserTest extends BaseTest { public class TestDeleteUser extends BaseTest {
private UserManagePage userManagePage; private UserManagePage userManagePage;
private TenantManagePage tenantManagePage; private TenantManagePage tenantManagePage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","user" },description = "DeleteUserTest",priority=8) @Test(groups={"functionTests"},dependsOnGroups = { "login","user" },description = "TestDeleteUser")
public void testDeleteUser() throws InterruptedException { public void testDeleteUser() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver); tenantManagePage = new TenantManagePage(driver);
System.out.println("jump to security to delete user"); System.out.println("jump to security to delete user");

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/deleteData/DeleteWorkflowTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testDeleteData/TestDeleteWorkflow.java

@ -14,18 +14,18 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.deleteData; package org.apache.dolphinscheduler.testcase.testDeleteData;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage; import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.apache.dolphinscheduler.page.project.CreateWorkflowPage; import org.apache.dolphinscheduler.page.project.CreateWorkflowPage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class DeleteWorkflowTest extends BaseTest { public class TestDeleteWorkflow extends BaseTest {
private CreateWorkflowPage createWorkflowPage; private CreateWorkflowPage createWorkflowPage;
private CreateProjectPage createProjectPage; private CreateProjectPage createProjectPage;
@Test(groups={"functionTests"},dependsOnGroups = { "login","workflow"},description = "DeleteWorkflowTest",priority=6) @Test(groups={"functionTests"},dependsOnGroups = { "login","workflow"},description = "TestDeleteWorkflow")
public void testDeleteWorkflow() throws InterruptedException { public void testDeleteWorkflow() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver); createProjectPage = new CreateProjectPage(driver);
//jump to project manage page //jump to project manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/project/CreateProjectTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateProject.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.project; package org.apache.dolphinscheduler.testcase.testProject;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage; import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class CreateProjectTest extends BaseTest { public class TestCreateProject extends BaseTest {
private CreateProjectPage createProjectPage; private CreateProjectPage createProjectPage;
@Test(groups={"functionTests","project"},dependsOnGroups = { "login" },description = "CreateProjectTest",priority=4) @Test(groups={"functionTests","project"},dependsOnGroups = { "login" },description = "CreateProjectTest")
public void testCreateProject() throws InterruptedException { public void testCreateProject() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver); createProjectPage = new CreateProjectPage(driver);
// enter user manage page // enter user manage page

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/project/CreateWorkflowTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testProject/TestCreateWorkflow.java

@ -14,19 +14,19 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.project; package org.apache.dolphinscheduler.testcase.testProject;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.project.CreateProjectPage; import org.apache.dolphinscheduler.page.project.CreateProjectPage;
import org.apache.dolphinscheduler.page.project.CreateWorkflowPage; import org.apache.dolphinscheduler.page.project.CreateWorkflowPage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class CreateWorkflowTest extends BaseTest { public class TestCreateWorkflow extends BaseTest {
private CreateWorkflowPage createWorkflowPage; private CreateWorkflowPage createWorkflowPage;
private CreateProjectPage createProjectPage; private CreateProjectPage createProjectPage;
@Test(groups={"functionTests","workflow"},dependsOnGroups = { "login" },description = "CreateWorkflowTest",priority=5) @Test(groups={"functionTests","workflow"},dependsOnGroups = { "login" },description = "TestCreateWorkflow")
public void testCreateWorkflow() throws InterruptedException { public void testCreateWorkflow() throws InterruptedException {
createProjectPage = new CreateProjectPage(driver); createProjectPage = new CreateProjectPage(driver);
System.out.println("jump to the projectManage page to create workflow"); System.out.println("jump to the projectManage page to create workflow");

36
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestAlertManage.java

@ -0,0 +1,36 @@
/*
* 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.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.AlertManagePage;
import org.testng.annotations.Test;
public class TestAlertManage extends BaseTest {
private AlertManagePage alertManagePage;
@Test(groups={"functionTests","alert"},dependsOnGroups = { "login" },description = "AlertManagePage")
public void testAlertManage() throws InterruptedException {
alertManagePage = new AlertManagePage(driver);
//assert alert manage page
System.out.println("start create alert");
assert alertManagePage.createAlert();
System.out.println("end create alert");
System.out.println("===================================");
}
}

42
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestQueueManage.java

@ -0,0 +1,42 @@
/*
* 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.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.QueueManagePage;
import org.testng.annotations.Test;
public class TestQueueManage extends BaseTest {
private QueueManagePage queueManagePage;
@Test(groups={"functionTests","queue"},dependsOnGroups = { "login" },description = "TestQueueManage")
public void testTenantManage() throws InterruptedException {
queueManagePage = new QueueManagePage(driver);
//create queue
System.out.println("start create queue");
assert queueManagePage.createQueue();
System.out.println("end create queue");
System.out.println("===================================");
//edit queue
System.out.println("start edit queue");
assert queueManagePage.editQueue();
System.out.println("end edit queue");
System.out.println("===================================");
}
}

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/security/TenantManageTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestTenantManage.java

@ -14,17 +14,17 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.security; package org.apache.dolphinscheduler.testcase.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TenantManagePage; import org.apache.dolphinscheduler.page.security.TenantManagePage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class TenantManageTest extends BaseTest { public class TestTenantManage extends BaseTest {
private TenantManagePage tenantManagePage; private TenantManagePage tenantManagePage;
@Test(groups={"functionTests","createTenant"},dependsOnGroups = { "login" },description = "TenantManageTest",priority=2) @Test(groups={"functionTests","createTenant"},dependsOnGroups = { "login" },description = "TestTenantManage")
public void testTenantManage() throws InterruptedException { public void testTenantManage() throws InterruptedException {
tenantManagePage = new TenantManagePage(driver); tenantManagePage = new TenantManagePage(driver);
//assert tenant manage page //assert tenant manage page

43
e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestTokenManage.java

@ -0,0 +1,43 @@
/*
* 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.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.TokenManagePage;
import org.testng.annotations.Test;
public class TestTokenManage extends BaseTest {
private TokenManagePage tokenManagePage;
@Test(groups={"functionTests","token"},dependsOnGroups = { "login" },description = "TestTokenManage")
public void testUserManage() throws InterruptedException {
tokenManagePage = new TokenManagePage(driver);
//generate token
System.out.println("start create token");
assert tokenManagePage.createToken();
System.out.println("end create token");
System.out.println("===================================");
//edit token
System.out.println("start edit token");
assert tokenManagePage.editToken();
System.out.println("end edit token");
System.out.println("===================================");
}
}

6
e2e/src/test/java/org/apache/dolphinscheduler/testcase/security/UserManageTest.java → e2e/src/test/java/org/apache/dolphinscheduler/testcase/testSecurity/TestUserManage.java

@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.dolphinscheduler.testcase.security; package org.apache.dolphinscheduler.testcase.testSecurity;
import org.apache.dolphinscheduler.base.BaseTest; import org.apache.dolphinscheduler.base.BaseTest;
import org.apache.dolphinscheduler.page.security.UserManagePage; import org.apache.dolphinscheduler.page.security.UserManagePage;
import org.testng.annotations.Test; import org.testng.annotations.Test;
public class UserManageTest extends BaseTest { public class TestUserManage extends BaseTest {
private UserManagePage userManagePage; private UserManagePage userManagePage;
@Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "UserManageTest",priority=3) @Test(groups={"functionTests","user"},dependsOnGroups = { "login" },description = "TestUserManage")
public void testUserManage() throws InterruptedException { public void testUserManage() throws InterruptedException {
userManagePage = new UserManagePage(driver); userManagePage = new UserManagePage(driver);
//assert user manage page //assert user manage page

28
e2e/testng.xml

@ -16,24 +16,30 @@
~ limitations under the License. ~ limitations under the License.
--> -->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="dolphinscheduler_e2e" parallel="true"> <suite name="dolphinscheduler_e2e" verbose="1">
<test name="dolphinscheduler_test" preserve-order="true"> <test name="dolphinscheduler_test" preserve-order="true">
<groups> <groups>
<run> <run>
<include name="functionTests"/> <include name="functionTests"/>
</run> </run>
</groups> </groups>
<classes> <classes>
<class name="org.apache.dolphinscheduler.testcase.LoginTest"></class> <class name="org.apache.dolphinscheduler.testcase.TestLogin"></class>
<class name="org.apache.dolphinscheduler.testcase.security.TenantManageTest"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestTenantManage"></class>
<class name="org.apache.dolphinscheduler.testcase.security.UserManageTest"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestUserManage"></class>
<class name="org.apache.dolphinscheduler.testcase.project.CreateProjectTest"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestAlertManage"></class>
<class name="org.apache.dolphinscheduler.testcase.project.CreateWorkflowTest"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestQueueManage"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteWorkflowTest"></class> <class name="org.apache.dolphinscheduler.testcase.testSecurity.TestTokenManage"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteProjectTest"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteUserTest"></class> <class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateProject"></class>
<class name="org.apache.dolphinscheduler.testcase.deleteData.DeleteTenantTest"></class> <class name="org.apache.dolphinscheduler.testcase.testProject.TestCreateWorkflow"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteWorkflow"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteProject"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteAlert"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteToken"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteUser"></class>
<class name="org.apache.dolphinscheduler.testcase.testDeleteData.TestDeleteTenant"></class>
</classes> </classes>
</test> </test>

Loading…
Cancel
Save