Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support extra global params per testsuite #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions src/components/TestSuiteUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const testSuite = ref({
devices: [],
testCases: [],
});
const paramEditor = ref({
idx: 0,
data: {},
});
const deviceData = ref([]);
const deviceDataBack = ref([]);
const getDevice = () => {
Expand Down Expand Up @@ -417,6 +421,68 @@ onMounted(() => {
</el-tab-pane>
</el-tabs>
</el-form-item>
<el-form-item prop="testSuitesGlobalParams" :label="$t('suite.testSuiteGlobalParams')">
<el-table :data="testSuite.testSuitesGlobalParams" style="width: 100%" max-height="250" size="small">
<el-table-column :label="$t('globalParamsTs.paramsList.name')" width="240" prop="paramsKey"/>
<el-table-column :label="$t('globalParamsTs.paramsList.value')" prop="paramsValue"/>
<el-table-column align="right">
<template #header>
<el-button size="small"
@click="paramEditor.data = {}; paramEditor.idx = 1 + testSuite.testSuitesGlobalParams.length"
>{{$t('globalParamsTs.addGlobalParams')}}</el-button>
</template>
<template #default="scope">
<el-button size="small"
@click="paramEditor.data = { ...scope.row }; paramEditor.idx = 1 + scope.$index"
>{{ $t('common.edit') }}
</el-button>
<el-button size="small" type="danger"
@click="testSuite.testSuitesGlobalParams.splice(scope.$index, 1)"
>{{ $t('common.delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog v-model="paramEditor.idx" :title="$t('globalParamsTs.dialogVisible.info')" width="600px">
<el-form size="small" :model="paramEditor.data" class="demo-table-expand" label-width="90px" label-position="left">
<el-form-item
prop="paramsKey"
:label="$t('globalParamsTs.dialogVisible.keyName')"
:rules="{
required: true,
message: $t('globalParamsTs.dialogVisible.keyNameMessage'),
trigger: 'blur',
}"
>
<el-input
v-model="paramEditor.data.paramsKey"
:placeholder="$t('globalParamsTs.dialogVisible.inputName')"
></el-input>
</el-form-item>
<el-form-item
prop="paramsValue"
:label="$t('globalParamsTs.dialogVisible.valueName')"
:rules="{
required: true,
message: $t('globalParamsTs.dialogVisible.valueNameMessage'),
trigger: 'blur',
}"
>
<el-input
v-model="paramEditor.data.paramsValue"
:placeholder="$t('globalParamsTs.dialogVisible.inputValue')"
></el-input>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button size="small" type="primary"
@click="testSuite.testSuitesGlobalParams.splice(paramEditor.idx - 1, 1, paramEditor.data); paramEditor.idx = 0"
>{{
$t('form.confirm')
}}</el-button>
</div>
</el-dialog>
</el-form-item>
</el-form>

<div style="text-align: center; margin-top: 20px">
Expand Down
1 change: 1 addition & 0 deletions src/locales/lang/en_US.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const suite = {
devicePlace:
'Please select the devices. You can enter the model, remarks, name and serial number to filter',
selectedCase: 'Selected Cases',
testSuiteGlobalParams: 'Extra parameters',
};
const testcase = {
info: 'Case Info',
Expand Down
1 change: 1 addition & 0 deletions src/locales/lang/ja_JP.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const suite = {
interval: '采集间隔',
devicePlace: '请选择测试设备,可输入型号、备注、中文名称、序列号筛选',
selectedCase: '已选用例',
testSuiteGlobalParams: '附加参数',
};
const testcase = {
info: '用例信息',
Expand Down
1 change: 1 addition & 0 deletions src/locales/lang/zh_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const suite = {
interval: '采集间隔',
devicePlace: '请选择测试设备,可输入型号、备注、中文名称、序列号筛选',
selectedCase: '已选用例',
testSuiteGlobalParams: '附加参数',
};
const testcase = {
info: '用例信息',
Expand Down
1 change: 1 addition & 0 deletions src/locales/lang/zh_TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const suite = {
interval: '采集间隔',
devicePlace: '请选择测试设备,可输入型号、备注、中文名称、序列号筛选',
selectedCase: '已选用例',
testSuiteGlobalParams: '附加参数',
};
const testcase = {
info: '用例信息',
Expand Down