@@ -566,41 +566,33 @@ const GetTestSuiteYaml = (suite: string, callback: (d: any) => void, errHandle?:
566566function GetHistoryTestCaseWithResult ( req : HistoryTestCase ,
567567 callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
568568 const requestOptions = {
569- method : 'POST' ,
570569 headers : {
571570 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
572571 'X-Auth' : getToken ( )
573- } ,
574- body : JSON . stringify ( {
575- ID : req . historyCaseID
576- } )
572+ }
577573 }
578- fetch ( '/server.Runner/GetHistoryTestCaseWithResult' , requestOptions )
574+ fetch ( `/api/v1/historyTestCaseWithResult/ ${ req . historyCaseID } ` , requestOptions )
579575 . then ( DefaultResponseProcess )
580576 . then ( callback ) . catch ( errHandle )
581577}
582578
583579function GetHistoryTestCase ( req : HistoryTestCase ,
584580 callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
585581 const requestOptions = {
586- method : 'POST' ,
587582 headers : {
588583 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
589584 'X-Auth' : getToken ( )
590- } ,
591- body : JSON . stringify ( {
592- ID : req . historyCaseID
593- } )
585+ }
594586 }
595- fetch ( '/server.Runner/GetHistoryTestCase' , requestOptions )
587+ fetch ( `/api/v1/historyTestCase/ ${ req . historyCaseID } ` , requestOptions )
596588 . then ( DefaultResponseProcess )
597589 . then ( callback ) . catch ( errHandle )
598590}
599591
600592function DeleteHistoryTestCase ( req : HistoryTestCase ,
601593 callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
602594 const requestOptions = {
603- method : 'POST ' ,
595+ method : 'DELETE ' ,
604596 headers : {
605597 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
606598 'X-Auth' : getToken ( )
@@ -609,16 +601,33 @@ function DeleteHistoryTestCase(req: HistoryTestCase,
609601 ID : req . historyCaseID
610602 } )
611603 }
612- fetch ( '/server.Runner/DeleteHistoryTestCase' , requestOptions )
604+ fetch ( `/api/v1/historyTestCase/ ${ req . historyCaseID } ` , requestOptions )
613605 . then ( callback ) . catch ( errHandle )
614606}
615607
608+ function DeleteAllHistoryTestCase ( suiteName : string , caseName : string ,
609+ callback : ( d : any ) => void , errHandle ?: ( e : any ) => void | null ) {
610+ const requestOptions = {
611+ method : 'DELETE' ,
612+ headers : {
613+ 'X-Store-Name' : Cache . GetCurrentStore ( ) . name ,
614+ 'X-Auth' : getToken ( )
615+ } ,
616+ body : JSON . stringify ( {
617+ suiteName : suiteName ,
618+ caseName : caseName ,
619+ } )
620+ }
621+ fetch ( `/api/v1/suites/${ suiteName } /cases/${ caseName } ` , requestOptions )
622+ . then ( callback ) . catch ( errHandle )
623+ }
624+
616625export const API = {
617626 DefaultResponseProcess,
618627 GetVersion,
619628 CreateTestSuite, UpdateTestSuite, ImportTestSuite, GetTestSuite, DeleteTestSuite, ConvertTestSuite, GetTestSuiteYaml,
620629 CreateTestCase, UpdateTestCase, GetTestCase, ListTestCase, DeleteTestCase, RunTestCase,
621- GetHistoryTestCaseWithResult, DeleteHistoryTestCase, GetHistoryTestCase, GetTestCaseAllHistory,
630+ GetHistoryTestCaseWithResult, DeleteHistoryTestCase, GetHistoryTestCase, GetTestCaseAllHistory, DeleteAllHistoryTestCase ,
622631 GenerateCode, ListCodeGenerator,
623632 PopularHeaders,
624633 CreateOrUpdateStore, GetStores, DeleteStore, VerifyStore,
0 commit comments