Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Commit 9203d86

Browse files
committed
0.7.0
1 parent 416ffcb commit 9203d86

File tree

8 files changed

+15
-55
lines changed

8 files changed

+15
-55
lines changed

src/api/action.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ export function deleteAction(actionId) {
3131
})
3232
}
3333

34-
export function getActionCascader(projectId, platform) {
34+
export function getActionCascader(projectId, platform, type) {
3535
return request({
3636
method: 'get',
3737
url: '/action/cascader',
3838
params: {
3939
projectId: projectId,
40-
platform: platform
40+
platform: platform,
41+
type: type
4142
}
4243
})
4344
}

src/pages/action/components/ActionImportList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div>
33
<el-button size="mini" @click="addJavaImport">+</el-button>
4-
<el-input v-for="(javaImport, index) in javaImports" :key="index" placeholder="请输入内容" v-model.trim="javaImports[index]" style="margin-top: 3px">
4+
<el-input v-for="(javaImport, index) in javaImports" :key="index" placeholder="示例: import java.util.List (不需要';'结尾)" v-model.trim="javaImports[index]" style="margin-top: 3px">
55
<el-button slot="append" icon="el-icon-delete" @click="deleteJavaImport(index)" />
66
</el-input>
77
</div>

src/pages/action/components/ActionStepList.vue

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
<span v-if="data.returnValue">{{ returnValue(data) }}</span>
3636
<el-divider v-if="data.returnValue" direction="vertical" />
3737
<span>{{ data.name }}</span>
38-
<el-divider v-if="data.params && data.params.length > 0" direction="vertical" />
39-
<span v-if="data.params && data.params.length > 0">{{ params(data) }}</span>
4038
</template>
4139
</el-cascader>
4240
</template>
@@ -113,10 +111,6 @@ import 'codemirror/addon/fold/brace-fold'
113111
import 'codemirror/addon/fold/comment-fold'
114112
import ImageInput from '@/components/ImageInput'
115113
export default {
116-
props: {
117-
// 当前编辑的actionId
118-
curActionId: Number
119-
},
120114
components: {
121115
ActionDetail,
122116
ImageInput
@@ -178,11 +172,6 @@ export default {
178172
}
179173
}
180174
},
181-
params() {
182-
return function(action) {
183-
return '(' + action.params.map(p => p.type + ' ' + p.name).join(', ') + ')'
184-
}
185-
},
186175
projectId() {
187176
return this.$store.state.project.id
188177
},
@@ -258,9 +247,6 @@ export default {
258247
fetchActionCascader() {
259248
getActionCascader(this.projectId, this.platform).then(resp => {
260249
this.selectableActions = resp.data
261-
if (this.curActionId) { // 编辑action时,第一次拿不到curActionId
262-
this.disableCurActionInSelectableActions(this.curActionId)
263-
}
264250
this.$emit('selectableActionsChange', this.selectableActions)
265251
})
266252
},
@@ -302,22 +288,6 @@ export default {
302288
}
303289
}
304290
}
305-
},
306-
disableAction(actions, actionId) {
307-
for (let i = 0; i < actions.length; i++) {
308-
if (actions[i].children) {
309-
this.disableAction(actions[i].children, actionId)
310-
} else {
311-
if (actions[i].id === actionId) {
312-
console.log('disable action', actions[i].id)
313-
actions[i].disabled = true
314-
}
315-
}
316-
}
317-
},
318-
// 禁用当前编辑的action
319-
disableCurActionInSelectableActions(actionId) {
320-
this.disableAction(this.selectableActions, actionId)
321291
}
322292
}
323293
}

src/pages/action/components/SaveAction.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
</div>
9292

9393
<div style="margin-top: 5px">
94-
<action-step-list ref="stepList" :cur-action-id="saveActionForm.id" @selectableActionsChange="onSelectableActionsChange" />
94+
<action-step-list ref="stepList" @selectableActionsChange="onSelectableActionsChange" />
9595
</div>
9696
</div>
9797
</template>
@@ -259,10 +259,7 @@ export default {
259259
}
260260
},
261261
fetchActionCategoryList() {
262-
let type = 2
263-
if (this.isTestCase) {
264-
type = 4
265-
}
262+
const type = this.isTestCase ? 4 : 2
266263
getCategoryList({ projectId: this.saveActionForm.projectId, type: type }).then(response => {
267264
this.categories = response.data
268265
})

src/pages/action/encapsulation/list.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<div class="app-container">
33
<div style="margin-bottom: 10px">
44
<el-button @click="$router.push({ name: 'AddEncapsulationAction' })">添加Action</el-button>
5-
</div>
6-
<div style="margin-bottom: 10px">
5+
76
<el-input v-model="queryForm.name" style="width: 200px" placeholder="action名" clearable />
87
<el-select v-model="queryForm.pageId" filterable clearable placeholder="选择page">
98
<el-option v-for="page in pageList" :key="page.id" :value="page.id" :label="page.name" />

src/pages/action/testcase/list.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
<div class="app-container">
33
<div style="margin-bottom: 10px">
44
<el-button @click="$router.push({ name: 'AddTestcaseAction' })">添加测试用例</el-button>
5-
</div>
65

7-
<div style="margin-bottom: 10px">
86
<el-input v-model="queryForm.name" style="width: 200px" placeholder="测试用例名" clearable />
97
<el-select v-model="queryForm.state" clearable placeholder="状态" style="width: 100px">
108
<el-option v-for="state in stateList" :key="state.state" :label="state.name" :value="state.state" />

src/pages/testplan/components/SaveTestPlan.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
filterable
1717
clearable
1818
style="width: 60%"
19-
@visible-change="actionSelectChange">
19+
>
2020
<template slot-scope="{ node, data }">
2121
<span v-if="data.returnValue">{{ returnValue(data) }}</span>
2222
<el-divider v-if="data.returnValue" direction="vertical" />
@@ -33,7 +33,7 @@
3333
filterable
3434
clearable
3535
style="width: 60%"
36-
@visible-change="actionSelectChange">
36+
>
3737
<template slot-scope="{ node, data }">
3838
<span v-if="data.returnValue">{{ returnValue(data) }}</span>
3939
<el-divider v-if="data.returnValue" direction="vertical" />
@@ -50,7 +50,7 @@
5050
filterable
5151
clearable
5252
style="width: 60%"
53-
@visible-change="actionSelectChange">
53+
>
5454
<template slot-scope="{ node, data }">
5555
<span v-if="data.returnValue">{{ returnValue(data) }}</span>
5656
<el-divider v-if="data.returnValue" direction="vertical" />
@@ -67,7 +67,7 @@
6767
filterable
6868
clearable
6969
style="width: 60%"
70-
@visible-change="actionSelectChange">
70+
>
7171
<template slot-scope="{ node, data }">
7272
<span v-if="data.returnValue">{{ returnValue(data) }}</span>
7373
<el-divider v-if="data.returnValue" direction="vertical" />
@@ -228,11 +228,6 @@ export default {
228228
})
229229
}
230230
},
231-
actionSelectChange(type) {
232-
if (type) {
233-
this.fetchActionCascader()
234-
}
235-
},
236231
fetchActionCascader() {
237232
getActionCascader(this.projectId, this.platform).then(response => {
238233
this.actions = response.data

src/pages/testsuite/components/SaveTestSuite.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
node-key="id"
1616
:default-checked-keys="testSuite.testcases"
1717
ref="tree"
18-
highlight-current>
18+
>
1919
</el-tree>
2020
</el-form-item>
2121

@@ -69,9 +69,9 @@ export default {
6969
},
7070
methods: {
7171
fetchActionCascader() {
72-
getActionCascader(this.projectId, this.platform).then(resp => {
73-
const testcases = resp.data.filter(a => a.name === '测试用例')
74-
this.treeData = testcases
72+
// 3: 测试用例
73+
getActionCascader(this.projectId, this.platform, 3).then(resp => {
74+
this.treeData = resp.data
7575
})
7676
},
7777
saveTestSuite() {

0 commit comments

Comments
 (0)