@@ -721,6 +721,15 @@ function formChange() {
721721 }
722722}
723723
724+ const filepathChange = () => {
725+ const items = testCaseWithSuite .value .data .request .filepath .split (" =" )
726+ if (items && items .length > 1 ) {
727+ testCaseWithSuite .value .data .request .form = [{
728+ key: items [0 ],
729+ value: items [1 ]
730+ } as Pair ]
731+ }
732+ }
724733const bodyType = ref (1 )
725734function bodyTypeChange(e : number ) {
726735 let contentType = " "
@@ -733,14 +742,7 @@ function bodyTypeChange(e: number) {
733742 break ;
734743 case 6 :
735744 contentType = ' multipart/form-data'
736-
737- const items = testCaseWithSuite .value .data .request .filepath .split (" =" )
738- if (items && items .length > 1 ) {
739- testCaseWithSuite .value .data .request .form = [{
740- key: items [0 ],
741- value: items [1 ]
742- } as Pair ]
743- }
745+ filepathChange ()
744746 break ;
745747 }
746748
@@ -867,44 +869,53 @@ Magic.Keys(() => {
867869 <el-button type =" primary" v-if =" !isHistoryTestCase && Cache.GetCurrentStore().kind.name == 'atest-store-orm'" @click =" openHistoryDialog" >{{ t('button.viewHistory') }}</el-button >
868870 <span v-if =" isHistoryTestCase" style =" margin-left : 15px ;" >{{ t('tip.runningAt') }}{{ HistoryTestCaseCreateTime }}</span >
869871 </div >
870- <div style =" display : flex ;" >
871- <el-select
872- v-if =" props.kindName !== 'tRPC' && props.kindName !== 'gRPC'"
873- v-model =" testCaseWithSuite.data.request.method"
874- class =" m-2"
875- placeholder =" Method"
876- size =" default"
877- test-id =" case-editor-method"
878- :disabled =" isHistoryTestCase"
879- >
880- <el-option
881- v-for =" item in options"
882- :key =" item.value"
883- :label =" item.key"
884- :value =" item.value"
885- />
886- </el-select >
887- <el-autocomplete
888- v-model =" testCaseWithSuite.data.request.api"
889- :fetch-suggestions =" querySuggestedAPIs"
890- placeholder =" API Address"
891- style =" width : 50% ; margin-left : 5px ; margin-right : 5px ; flex-grow : 1 ;"
892- :readonly =" isHistoryTestCase"
893- >
894- <template #default =" { item } " >
895- <div class =" value" >{{ item.request.method }}</div >
896- <span class =" link" >{{ item.request.api }}</span >
897- </template >
898- </el-autocomplete >
899-
900- <el-dropdown split-button type =" primary" @click =" sendRequest" v-loading =" requestLoading" v-if =" !isHistoryTestCase" >
901- {{ t('button.send') }}
902- <template #dropdown >
903- <el-dropdown-menu >
904- <el-dropdown-item @click =" openParameterDialog" >{{ t('button.sendWithParam') }}</el-dropdown-item >
905- </el-dropdown-menu >
906- </template >
907- </el-dropdown >
872+ <div >
873+ <el-row >
874+ <el-col :span =" 3" >
875+ <el-select
876+ v-if =" props.kindName !== 'tRPC' && props.kindName !== 'gRPC'"
877+ v-model =" testCaseWithSuite.data.request.method"
878+ class =" m-2"
879+ placeholder =" Method"
880+ size =" default"
881+ test-id =" case-editor-method"
882+ :disabled =" isHistoryTestCase"
883+ >
884+ <el-option
885+ v-for =" item in options"
886+ :key =" item.value"
887+ :label =" item.key"
888+ :value =" item.value"
889+ />
890+ </el-select >
891+ </el-col >
892+ <el-col :span =" 18" >
893+ <el-autocomplete
894+ v-model =" testCaseWithSuite.data.request.api"
895+ style =" width : 100% "
896+ :fetch-suggestions =" querySuggestedAPIs"
897+ placeholder =" API Address"
898+ :readonly =" isHistoryTestCase" >
899+ <template #default =" { item } " >
900+ <div class =" value" >{{ item.request.method }}</div >
901+ <span class =" link" >{{ item.request.api }}</span >
902+ </template >
903+ </el-autocomplete >
904+ </el-col >
905+ <el-col :span =" 3" >
906+ <el-dropdown split-button type =" primary"
907+ @click =" sendRequest"
908+ v-loading =" requestLoading"
909+ v-if =" !isHistoryTestCase" >
910+ {{ t('button.send') }}
911+ <template #dropdown >
912+ <el-dropdown-menu >
913+ <el-dropdown-item @click =" openParameterDialog" >{{ t('button.sendWithParam') }}</el-dropdown-item >
914+ </el-dropdown-menu >
915+ </template >
916+ </el-dropdown >
917+ </el-col >
918+ </el-row >
908919 </div >
909920 </el-header >
910921
@@ -1013,7 +1024,12 @@ Magic.Keys(() => {
10131024
10141025 <div style =" flex-grow : 1 ;" >
10151026 <div v-if =" bodyType === 6" >
1016- Filename: <el-input v-model =" testCaseWithSuite.data.request.filepath" placeholder =" file=sample.txt" />
1027+ <el-row >
1028+ <el-col :span =" 4" >Filename:</el-col >
1029+ <el-col :span =" 20" >
1030+ <el-input v-model =" testCaseWithSuite.data.request.filepath" placeholder =" file=sample.txt" @change =" filepathChange" />
1031+ </el-col >
1032+ </el-row >
10171033 </div >
10181034 <Codemirror v-if =" bodyType === 3 || bodyType === 5 || bodyType === 6"
10191035 @blur =" jsonFormat(-1)"
@@ -1040,27 +1056,34 @@ Magic.Keys(() => {
10401056 </el-tab-pane >
10411057
10421058 <el-tab-pane label =" Expected" name =" expected" v-if =" props.kindName !== 'tRPC' && props.kindName !== 'gRPC'" >
1043- <el-row :gutter =" 20" >
1044- <span
1045- class =" ml-3 w-50 text-gray-600 inline-flex items-center"
1046- style =" margin-left : 15px ; margin-right : 15px "
1047- >Status Code:</span
1048- >
1049- <el-input
1050- v-model =" testCaseWithSuite.data.response.statusCode"
1051- class =" w-50 m-2"
1052- placeholder =" Please input"
1053- style =" width : 200px "
1054- :readonly =" isHistoryTestCase"
1055- />
1059+ <el-row >
1060+ <el-col :span =" 4" >
1061+ Status Code:
1062+ </el-col >
1063+ <el-col :span =" 20" >
1064+ <el-input
1065+ v-model =" testCaseWithSuite.data.response.statusCode"
1066+ class =" w-50 m-2"
1067+ placeholder =" Please input"
1068+ :readonly =" isHistoryTestCase" >
1069+ <template #append >
1070+ {{ t('httpCode.' + testCaseWithSuite.data.response.statusCode) }}
1071+ </template >
1072+ </el-input >
1073+ </el-col >
1074+ </el-row >
1075+ <el-row >
1076+ <el-col :span =" 4" >Body:</el-col >
1077+ <el-col :span =" 20" >
1078+ <el-input
1079+ v-model =" testCaseWithSuite.data.response.body"
1080+ :autosize =" { minRows: 4, maxRows: 8 }"
1081+ type =" textarea"
1082+ placeholder =" Expected Body"
1083+ :readonly =" isHistoryTestCase"
1084+ />
1085+ </el-col >
10561086 </el-row >
1057- <el-input
1058- v-model =" testCaseWithSuite.data.response.body"
1059- :autosize =" { minRows: 4, maxRows: 8 }"
1060- type =" textarea"
1061- placeholder =" Expected Body"
1062- :readonly =" isHistoryTestCase"
1063- />
10641087 </el-tab-pane >
10651088
10661089 <el-tab-pane label =" Expected Headers" name =" expected-headers" v-if =" props.kindName !== 'tRPC' && props.kindName !== 'gRPC'" >
0 commit comments