This commit is contained in:
wenyann 2020-08-29 12:00:55 +08:00
commit 02d5aa8bc7
10 changed files with 54 additions and 31 deletions

View File

@ -66,7 +66,7 @@ public class APITestController {
@PostMapping(value = "/update", consumes = {"multipart/form-data"})
public void update(@RequestPart("request") SaveAPITestRequest request, @RequestPart(value = "file") MultipartFile file, @RequestPart(value = "files") List<MultipartFile> bodyFiles) {
apiTestService.update(request, file, bodyFiles);
apiTestService.update(request, file, bodyFiles);
}
@PostMapping(value = "/copy")

View File

@ -157,7 +157,7 @@ public class JmeterDocumentParser {
u += k + "=" + ScriptEngineUtils.calculate(v);
return u;
});
ele.setTextContent(url + params);
ele.setTextContent(url + ((params != null && !params.equals("?")) ? params : ""));
break;
case "Argument.value":
String textContent = ele.getTextContent();

View File

@ -224,6 +224,10 @@ public class IssuesService {
String account = object.getString("account");
String password = object.getString("password");
String url = object.getString("url");
String issuetype = object.getString("issuetype");
if (StringUtils.isBlank(issuetype)) {
MSException.throwException("Jira 问题类型为空");
}
String auth = EncryptUtils.base64Encoding(account + ":" + password);
String testCaseId = issuesRequest.getTestCaseId();
@ -252,8 +256,7 @@ public class IssuesService {
" \"summary\":\"" + issuesRequest.getTitle() + "\",\n" +
" \"description\": " + JSON.toJSONString(desc) + ",\n" +
" \"issuetype\":{\n" +
" \"id\":\"10009\",\n" +
" \"name\":\"Defect\"\n" +
" \"name\":\"" + issuetype + "\"\n" +
" }\n" +
" }\n" +
"}";

View File

@ -17,7 +17,7 @@
<el-table border :data="tableData" class="adjust-table table-content" @sort-change="sort"
@row-click="handleView"
@filter-change="filter" @select-all="handleSelectAll" @select="selectionChange">
@filter-change="filter" @select-all="select" @select="select">
<el-table-column
type="selection"></el-table-column>
<el-table-column prop="name" :label="$t('commons.name')" width="250" show-overflow-tooltip>
@ -127,18 +127,7 @@
create() {
this.$router.push('/api/test/create');
},
handleSelectAll(selection) {
this.selectIds.clear()
this.selectProjectNames.clear()
this.selectProjectId.clear()
selection.forEach(s => {
this.selectIds.add(s.id)
this.selectProjectNames.add(s.projectName)
this.selectProjectId.add(s.projectId)
})
},
selectionChange(selection) {
select(selection) {
this.selectIds.clear()
this.selectProjectNames.clear()
this.selectProjectId.clear()

View File

@ -26,7 +26,7 @@
import MsApiScenarioConfig from "./components/ApiScenarioConfig";
import MsApiReportStatus from "../report/ApiReportStatus";
import MsApiReportDialog from "./ApiReportDialog";
import {getUUID} from "../../../../common/js/utils";
import {getUUID} from "@/common/js/utils";
export default {
@ -95,13 +95,12 @@
},
checkName(callback) {
for (let i of this.selectProjectId) {
this.result = this.$post('/api/checkName', {name: this.ruleForm.testName, projectId: i}, response => {
this.result = this.$post('/api/checkName', {name: this.ruleForm.testName, projectId: i}, () => {
if (callback) callback();
})
}
},
_getEnvironmentAndRunTest: function (item) {
let count = 0;
this.result = this.$get('/api/environment/list/' + item.projectId, response => {
let environments = response.data;
let environmentMap = new Map();
@ -131,7 +130,6 @@
scenarioDefinition: JSON.parse(item.scenarioDefinition),
schedule: {},
});
console.log(test)
this.test = this.test || test;
if (this.tests.length > 1) {
this.test.scenarioDefinition = this.test.scenarioDefinition.concat(test.scenarioDefinition);

View File

@ -142,6 +142,10 @@ export default {
}
},
initReportTimeInfo() {
if (this.status === 'Starting') {
this.clearData();
return;
}
if (this.reportId) {
this.result = this.$get("/performance/report/content/report_time/" + this.reportId)
.then(res => {
@ -155,7 +159,7 @@ export default {
}
}).catch(() => {
this.clearData();
})
});
}
},
initWebSocket() {
@ -226,10 +230,15 @@ export default {
onMessage(e) {
this.$set(this.report, "refresh", e.data); //
this.$set(this.report, "status", 'Running');
this.status = 'Running';
this.initReportTimeInfo();
window.console.log('receive a message:', e.data);
},
onClose(e) {
if (e.code === 1005) {
// socketreport
return;
}
this.$set(this.report, "refresh", Math.random()); //
this.$set(this.report, "status", 'Completed');
this.initReportTimeInfo();
@ -262,9 +271,6 @@ export default {
});
},
beforeDestroy() {
this.websocket.close() //websocket
},
watch: {
'$route'(to) {
if (to.name === "perReportView") {
@ -295,6 +301,9 @@ export default {
});
}
} else {
console.log("close socket.");
this.websocket.close() //websocket
}
}
}

View File

@ -25,6 +25,9 @@
<el-form-item :label="$t('organization.integration.jira_url')" prop="url" v-if="platform === 'Jira'">
<el-input v-model="form.url" :placeholder="$t('organization.integration.input_jira_url')"/>
</el-form-item>
<el-form-item :label="$t('organization.integration.jira_issuetype')" prop="issuetype" v-if="platform === 'Jira'">
<el-input v-model="form.issuetype" :placeholder="$t('organization.integration.input_jira_issuetype')"/>
</el-form-item>
</el-form>
</div>
@ -43,10 +46,13 @@
<div class="defect-tip">
<div>{{$t('organization.integration.use_tip')}}</div>
<div>
1. {{$t('organization.integration.use_tip_one')}}
1. {{$t('organization.integration.use_tip_tapd')}}
</div>
<div>
2. {{$t('organization.integration.use_tip_two')}}
2. {{$t('organization.integration.use_tip_jira')}}
</div>
<div>
3. {{$t('organization.integration.use_tip_two')}}
<router-link to="/track/project/all" style="margin-left: 5px">
{{$t('organization.integration.link_the_project_now')}}
</router-link>
@ -85,6 +91,11 @@
required: true,
message: this.$t('organization.integration.input_jira_url'),
trigger: ['change', 'blur']
},
issuetype: {
required: true,
message: this.$t('organization.integration.input_jira_issuetype'),
trigger: ['change', 'blur']
}
},
}
@ -105,6 +116,7 @@
this.$set(this.form, 'account', config.account);
this.$set(this.form, 'password', config.password);
this.$set(this.form, 'url', config.url);
this.$set(this.form, 'issuetype', config.issuetype);
} else {
this.clear();
}
@ -153,7 +165,8 @@
let auth = {
account: this.form.account,
password: this.form.password,
url: this.form.url
url: this.form.url,
issuetype: this.form.issuetype
};
param.organizationId = getCurrentUser().lastOrganizationId;
param.platform = this.platform;
@ -188,6 +201,7 @@
this.$set(this.form, 'account', config.account);
this.$set(this.form, 'password', config.password);
this.$set(this.form, 'url', config.url);
this.$set(this.form, 'issuetype', config.issuetype);
} else {
this.clear();
}
@ -197,6 +211,7 @@
this.$set(this.form, 'account', '');
this.$set(this.form, 'password', '');
this.$set(this.form, 'url', '');
this.$set(this.form, 'issuetype', '');
this.$nextTick(() => {
this.$refs.form.clearValidate();
});

View File

@ -186,11 +186,14 @@ export default {
api_account: 'API account',
api_password: 'API password',
jira_url: 'JIRA url',
jira_issuetype: 'JIRA issuetype',
input_api_account: 'please enter account',
input_api_password: 'Please enter password',
input_jira_url: 'Please enter Jira address, for example: https://metersphere.atlassian.net/',
input_jira_issuetype: 'Please enter the question type',
use_tip: 'Usage guidelines:',
use_tip_one: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"',
use_tip_tapd: 'Basic Auth account information is queried in "Company Management-Security and Integration-Open Platform"',
use_tip_jira: 'Jira software server authentication information is account password, Jira software cloud authentication information is account + token (account settings-security-create API token)',
use_tip_two: 'After saving the Basic Auth account information, you need to manually associate the ID/key in the Metersphere project',
link_the_project_now: 'Link the project now',
cancel_edit: 'Cancel edit',

View File

@ -187,11 +187,14 @@ export default {
api_account: 'API 账号',
api_password: 'API 口令',
jira_url: 'JIRA 地址',
jira_issuetype: '问题类型',
input_api_account: '请输入账号',
input_api_password: '请输入口令',
input_jira_url: '请输入Jira地址https://metersphere.atlassian.net/',
input_jira_issuetype: '请输入问题类型',
use_tip: '使用指引:',
use_tip_one: 'Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询',
use_tip_tapd: 'Tapd Basic Auth 账号信息在"公司管理-安全与集成-开放平台"中查询',
use_tip_jira: 'Jira software server 认证信息为 账号密码Jira software cloud 认证信息为 账号+令牌(账户设置-安全-创建API令牌)',
use_tip_two: '保存 Basic Auth 账号信息后,需要在 Metersphere 项目中手动关联 ID/key',
link_the_project_now: '马上关联项目',
cancel_edit: '取消编辑',

View File

@ -185,11 +185,14 @@ export default {
api_account: 'API 賬號',
api_password: 'API 口令',
jira_url: 'JIRA 地址',
jira_issuetype: '問題類型',
input_api_account: '請輸入賬號',
input_api_password: '請輸入口令',
input_jira_url: '請輸入Jira地址https://metersphere.atlassian.net/',
input_jira_issuetype: '請輸入問題類型',
use_tip: '使用指引:',
use_tip_one: 'Basic Auth 賬號信息在"公司管理-安全與集成-開放平台"中查詢',
use_tip_tapd: 'Basic Auth 賬號信息在"公司管理-安全與集成-開放平台"中查詢',
use_tip_jira: 'Jira software server 認證信息為 賬號密碼Jira software cloud 認證信息為 賬號+令牌(賬戶設置-安全-創建API令牌)',
use_tip_two: '保存 Basic Auth 賬號信息後,需要在 Metersphere 項目中手動關聯 ID/key',
link_the_project_now: '馬上關聯項目',
cancel_edit: '取消編輯',