@@ -163,6 +163,24 @@ function DuplicateTestSuite(sourceSuiteName: string, targetSuiteName: string,
163163 . then ( callback ) . catch ( errHandle )
164164}
165165
166+ const RenameTestSuite = ( sourceSuiteName : string , targetSuiteName : string ,
167+ callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) => {
168+ const requestOptions = {
169+ method : 'POST' ,
170+ headers : {
171+ 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
172+ 'X-Auth' : getToken ( )
173+ } ,
174+ body : JSON . stringify ( {
175+ sourceSuiteName : sourceSuiteName ,
176+ targetSuiteName : targetSuiteName ,
177+ } )
178+ }
179+ fetch ( `/api/v1/suites/${ sourceSuiteName } /rename` , requestOptions )
180+ . then ( DefaultResponseProcess )
181+ . then ( callback ) . catch ( errHandle )
182+ }
183+
166184function ImportTestSuite ( source : ImportSource , callback : ( d : any ) => void ,
167185 errHandle ?: ( e : any ) => void | null ) {
168186 const requestOptions = {
@@ -367,6 +385,27 @@ function DuplicateTestCase(sourceSuiteName: string, targetSuiteName: string,
367385 . then ( callback ) . catch ( errHandle )
368386}
369387
388+ function RenameTestCase ( sourceSuiteName : string , targetSuiteName : string ,
389+ sourceTestCaseName : string , targetTestCaseName : string ,
390+ callback : ( d : any ) => void , errHandle ?: ( ( reason : any ) => PromiseLike < never > ) | undefined | null ) {
391+ const requestOptions = {
392+ method : 'POST' ,
393+ headers : {
394+ 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
395+ 'X-Auth' : getToken ( )
396+ } ,
397+ body : JSON . stringify ( {
398+ sourceSuiteName : sourceSuiteName ,
399+ targetSuiteName : targetSuiteName ,
400+ sourceCaseName : sourceTestCaseName ,
401+ targetCaseName : targetTestCaseName ,
402+ } )
403+ }
404+ fetch ( `/api/v1/suites/${ sourceSuiteName } /cases/${ sourceTestCaseName } /rename` , requestOptions )
405+ . then ( DefaultResponseProcess )
406+ . then ( callback ) . catch ( errHandle )
407+ }
408+
370409interface GenerateRequest {
371410 suiteName : string
372411 name : string
@@ -734,8 +773,8 @@ function DownloadResponseFile(testcase,
734773export const API = {
735774 DefaultResponseProcess,
736775 GetVersion,
737- CreateTestSuite, UpdateTestSuite, ImportTestSuite, GetTestSuite, DeleteTestSuite, ConvertTestSuite, DuplicateTestSuite, GetTestSuiteYaml,
738- CreateTestCase, UpdateTestCase, GetTestCase, ListTestCase, DeleteTestCase, RunTestCase, BatchRunTestCase,
776+ CreateTestSuite, UpdateTestSuite, ImportTestSuite, GetTestSuite, DeleteTestSuite, ConvertTestSuite, DuplicateTestSuite, RenameTestSuite , GetTestSuiteYaml,
777+ CreateTestCase, UpdateTestCase, GetTestCase, ListTestCase, DeleteTestCase, DuplicateTestCase , RenameTestCase , RunTestCase, BatchRunTestCase,
739778 GetHistoryTestCaseWithResult, DeleteHistoryTestCase, GetHistoryTestCase, GetTestCaseAllHistory, DeleteAllHistoryTestCase, DownloadResponseFile,
740779 GenerateCode, ListCodeGenerator, HistoryGenerateCode,
741780 PopularHeaders,
0 commit comments