@@ -564,41 +564,33 @@ const GetTestSuiteYaml = (suite: string, callback: (d: any) => void, errHandle?:
564564function GetHistoryTestCaseWithResult ( req : HistoryTestCase ,
565565 callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
566566 const requestOptions = {
567- method : 'POST' ,
568567 headers : {
569568 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
570569 'X-Auth' : getToken ( )
571- } ,
572- body : JSON . stringify ( {
573- ID : req . historyCaseID
574- } )
570+ }
575571 }
576- fetch ( '/server.Runner/GetHistoryTestCaseWithResult' , requestOptions )
572+ fetch ( `/api/v1/historyTestCaseWithResult/ ${ req . historyCaseID } ` , requestOptions )
577573 . then ( DefaultResponseProcess )
578574 . then ( callback ) . catch ( errHandle )
579575}
580576
581577function GetHistoryTestCase ( req : HistoryTestCase ,
582578 callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
583579 const requestOptions = {
584- method : 'POST' ,
585580 headers : {
586581 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
587582 'X-Auth' : getToken ( )
588- } ,
589- body : JSON . stringify ( {
590- ID : req . historyCaseID
591- } )
583+ }
592584 }
593- fetch ( '/server.Runner/GetHistoryTestCase' , requestOptions )
585+ fetch ( `/api/v1/historyTestCase/ ${ req . historyCaseID } ` , requestOptions )
594586 . then ( DefaultResponseProcess )
595587 . then ( callback ) . catch ( errHandle )
596588}
597589
598590function DeleteHistoryTestCase ( req : HistoryTestCase ,
599591 callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
600592 const requestOptions = {
601- method : 'POST ' ,
593+ method : 'DELETE ' ,
602594 headers : {
603595 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
604596 'X-Auth' : getToken ( )
@@ -607,16 +599,33 @@ function DeleteHistoryTestCase(req: HistoryTestCase,
607599 ID : req . historyCaseID
608600 } )
609601 }
610- fetch ( '/server.Runner/DeleteHistoryTestCase' , requestOptions )
602+ fetch ( `/api/v1/historyTestCase/ ${ req . historyCaseID } ` , requestOptions )
611603 . then ( callback ) . catch ( errHandle )
612604}
613605
606+ function DeleteAllHistoryTestCase ( suiteName : string , caseName : string ,
607+ callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
608+ const requestOptions = {
609+ method : 'DELETE' ,
610+ headers : {
611+ 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
612+ 'X-Auth' : getToken ( )
613+ } ,
614+ body : JSON . stringify ( {
615+ suiteName : suiteName ,
616+ caseName : caseName ,
617+ } )
618+ }
619+ fetch ( `/api/v1/suites/${ suiteName } /cases/${ caseName } ` , requestOptions )
620+ . then ( callback ) . catch ( errHandle )
621+ }
622+
614623export const API = {
615624 DefaultResponseProcess,
616625 GetVersion,
617626 CreateTestSuite, UpdateTestSuite, ImportTestSuite, GetTestSuite, DeleteTestSuite, ConvertTestSuite, GetTestSuiteYaml,
618627 CreateTestCase, UpdateTestCase, GetTestCase, ListTestCase, DeleteTestCase, RunTestCase,
619- GetHistoryTestCaseWithResult, DeleteHistoryTestCase, GetHistoryTestCase, GetTestCaseAllHistory,
628+ GetHistoryTestCaseWithResult, DeleteHistoryTestCase, GetHistoryTestCase, GetTestCaseAllHistory, DeleteAllHistoryTestCase ,
620629 GenerateCode, ListCodeGenerator,
621630 PopularHeaders,
622631 CreateOrUpdateStore, GetStores, DeleteStore, VerifyStore,
0 commit comments